Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.97a is out! (02/02/24); In-development patch notes for Starsector 0.98a (2/8/25)

Author Topic: Why do the AI captains do these things?  (Read 2751 times)

vok3

  • Lieutenant
  • **
  • Posts: 74
    • View Profile
Why do the AI captains do these things?
« on: March 11, 2022, 09:48:57 AM »

Small flimsy ship, engaged with something that will eventually overpower it.  Multiple friendlies are nearby - not close enough to assist directly, but close enough to reach in time for support.  Small flimsy ship has the maneuverability to get to support but instead moves away from friendies to make sure nothing can possibly save it in time.  This happens ALL THE FREAKING TIME.  It's like they're deliberately trying to do it - the frigates zoom in at maximum speed, separating from the main body, then when engaged, they retreat off to the sides, away from the friendly heavies, rather than back in the direction they came from to get help.  Or worse - I've seen frigates move in on enemy destroyers, move past the destroyers, and then lead the destroyers AWAY from the other friendly forces, WHILE deliberately staying within weapons range of the destroyers.  There is absolutely no possible outcome to this except the destruction of the frigate to no benefit - as such, this behavior should never, ever intentionally happen.  And they always die unless the player micromanages them.  It's such a deliberate thing there has to be some sort of specific logic in the code that is making them do it, and whatever that logic is, needs to be ripped out and electrocuted and totally expunged from the face of the universe.  I can sort of see how under some (very specific, very particular) circumstances some players might want to deliberately kite enemy support away from the heavies (although my experience is that it is nearly always better to quickly pop the support and then gang up on the heavies), and maybe there's some concept of attempting to envelop the enemy fleet and attack from all directions, but that needs to be an option or the consequence of specific orders, not a default behavior - and definitely not default when backing away from superior forces.

Small flimsy ship, assigned to escort larger ship.  Larger ship enters furball.  Small flimsy ship sits behind larger ship and does absolutely nothing while larger ship eats repeated Reapers and Atropos.

Small flimsy ship, in a furball in general vicinity of heavy cruiser or capital.  Maneuvers to place itself directly between the heavy friendly and the primary enemy target.  Sits there.  Friendly heavy can either not shoot at all and wait for flimsy to blow up, or shoot through flimsy and blow it up directly like it deserves.  (I have done this repeatedly when flying an Onslaught.  I don't bother recovering them, either.) 

Small flimsy ship, in general vicinity of friendly heavy with burn drive.  Drifts in a direction that will place it in front of friendly heavy.  Friendly heavy ignites burn drive.  Flimsy has plenty of time to move out of the way; doesn't.  Gets body-slammed by heavy, taking significant flux and/or hull damage.

Small flimsy moving forward.  Is completely alone.  Starts sighting multiple enemy forces.  Keeps moving forward until suddenly it is taking massive damage.  No one could have predicted this!  Small flimsy tries to retreat but blows up.

Small flimsy is retreating from overpowering enemy force.  Friendly heavy is coming up to engage said force.  Small flimsy attempts to retreat through friendly heavy, bangs off shields.  Attempts again, bang again.  Continues attempting to retreat through friendly heavy until fimsy blows up.  Sometimes it goes from full hull to boom in a matter of seconds.  It's as if flimsy expects heavy to get out of its way.

Small flimsy is assigned to escort something bigger, is already at high flux.  Really big enemy is approaching, launches a hellstorm of missiles and gunfire.  Friendly bigger is retreating, shields up, no flux, in no immediate danger.  Small flimsy charges into the enemy fire, fluxes out, blows up.  I've seen this repeatedly and it never makes any sense.  Often it's an escort carrier that very carefully puts itself out front so as to get blown up before the thing it's escorting even starts shooting.  Often also it's a frigate that makes a point of going in there and fluxing out almost instantly, then promptly taking most or all its hull in damage.  Why do they do this?  Why, why, why, why, why?  The player does not want them to do it.  The escort target does not need them to do it.  It accomplishes absolutely nothing whatsoever.  After seeing it often enough the player is inclined to think that there is zero purpose in deploying frigates, ever, for any reason, because all they do is die.  Why?

Ship is assigned a waypoint to defend.  Enemies approach waypoint.  Ship backs away from waypoint while still out of range of either side being able to hit the other, because being polite and ceding territory is more important than orders.  This happens both with user waypoints and the game-defined control points, and it is definitely specific to the waypoint order, because as soon as you cancel said waypoint the ship happily charges into combat.

Ship is assigned a waypoint.  Ship engages a small fast target.  A minute or so later, ship is literally ON THE OTHER SIDE OF THE FREAKING MAP, still with a green arrow pointing all the way across the map to the waypoint it knows perfectly well it's been ordered to defend, and still moving away from said waypoint to follow its obsession.  I've seen this with un-officered ships, so don't blame Reckless.

Ship is engaged with an enemy that will probably beat it.  Player orders ship to move to a waypoint, which would involve moving away from the current engagement.  Ship totally ignores movement order and continues losing battle.  Player assigns "avoid" order to the target.  Ship totally ignores avoid order and continues losing battle, including chasing current target farther away.  This too I have seen with unofficered ships - not overloaded or flamed out, either - so don't blame those.  The priorities are simply wrong: the ships are taking current combat to be more important than the player's orders, and that's just not the way it should work.

Enemy ship is given a "concentrate fire" order.  Two (2) and only two (2) ships from your fleet, one of which is always on the OPPOSITE SIDE OF THE MAP, drop whatever they're doing and suicidally charge enemy ship.

Enemy ship is given a "concentrate fire" order.  Not trusting AI captain judgement for some unfathomable reason, the player then selects one of the ships that auto-targeted the enemy and manually sets it to attack the chosen target, to make sure it doesn't spontaneously wander off to smoke a joint or something.  Game thinks: "One of my two selected units for this task has OTHER ORDERS!  I need another ship!"  Some other ship that has no business responding to this order now is selected to attack the target, even though two ships (one auto-selected, one player-selected that would be auto-selected if not for the player order) are already on the task.

Friendly ship is set to attack specific enemy.  Enemy promptly retreats through the middle of its fleet. Friendly ship decides the obvious best most sensible thing to do is to charge right through the middle of the enemy fleet, letting the entire enemy fleet pour fire into its flanks and rear.  This is definitely a good way to make sure the enemy blows up and not us.  Definitely effective.

Start of battle: carrier is given an order to move to a specific location.  Player unpauses.  Carrier immediately starts moving AWAY from the direction indicated - soemtimes to either side, sometimes directly away, almost never towards the destination.  This happens very consistently, with carriers in the front line and no friendlies or asteroids obstructing their movement.  Why?

Start of battle; player clicks one of the four control points and chooses "capture".  A ship is auto-selected to go there.  Having seen from previous deployments how the ships will change their mind and zigzag based on who's recently used a speed boost and who happens to be ahead. player selects said ship and manually sets it to take the control point.  Game thinks: "The ship I had selected to respond to that order now has OTHER ORDERS!  I need another ship!"  Some other ship auto-targets the control point.  Player now needs to clear previous orders and re-issue them, doing all the manually defined captures first.

Player wants to capture a control point but expects possible light resistance.  Selects two ships rather than one and manually clicks the control point.  ENTIRE FREAKING FLEET now is set to obsess over that control point.  What the hell?

Friendly ships have captured a control point.  Enemy forces are approaching.  Friendlies, being polite, back up to let them take the control point.  Player, being impolite, selects friendlies and manually sets them to attack enemy forces.  Ship ON OTHE OTHER SIDE OF THE FREAKING MAP decides that control point has nobody trying to control it and obviously the best thing to do is for THIS specific ship to fly there, the maximum distance and longest time possible, past an absolute maximum of enemy ships that might interfere with the voyage.  Because this is definitely a productive and useful thing to do.

Friendly ship has 360 degree shield coverage (Apogee is where I have particularly noticed this).  Friendly ship is at zero flux.  Enemy ship is approaching.  Friendly ship drops shields.  What the hell?  This isn't a one-time thing, they seem to really, really want to drop their shields as enemies approach.  Then they take armor/hull damage after re-shielding as the coverage slowly builds back up.  It's ***.

I understand that AI is not an easy problem and that there's a lot of stuff going on and for a coded algorithm to be able to understand the intricacies of all these factors is a lot harder than for a human being taking it all in at a glance.  But really, the AI behavior needs a revision or overhaul.  A major part of choosing which ships to use is knowing which ships the AI can't screw up with - which has very little to do with their on-paper capabilities.

To sum up, the things I would want to see:

1) Maneuvering to stay not-too-close to friendly heavies but close enough to benefit from their supporting fire.

2) Maneuvering to stay on the flanks of friendly heavies, relative to the nearest enemy concentration of force, rather than on the line between them.  This regardless of whether the ship is currently on escort duty or on its own.  (On some occasions it is useful to have escorting frigates zoom by in front to absorb some incoming fire and give the heavy a chance to recover, then move away quickly for the frigate to recover.  That's useful.  But SITTING THERE, in front of the heavy, is not.)  Even when the friendly heavies are all bunched up, as in a station assault, when there's not much room to maneuver - the lighter ships need to try to avoid staying on the line between any given heavy and the nearest big target.

3) Keeping track of the approximate locus of the center of friendly force cocentration, and being increasingly disinclined to move farther and farther away from it under normal circumstances (full assault and/or specific attack/movement orders would override this; possibly also a favorable ratio of deployed force).

4) Just because you CAN go at a certain speed does not mean you SHOULD.  Depending on the strength of the opposing forces, staying at something under maximum speed can be a good idea to remain within a certain range of the central locus of friendly forces.  (Maybe this is considered already implemented through escort orders.  The problem is, escorts are usually about 10% effective at anything.  They mostly just hang around without shooting.  The only ships that are worth using as escorts are Afflictors and Omens, because their firepower has no relation to their utility anyway.)  Default behavior should not be suicidally stupid behavior; the player ought to be able to trust that the ship captains, lacking specific instructions, won't deliberately slam their ships into the nearest wall but will do something that is perhaps not optimal but at least reasonable.  Frigates and destroyers (Shrikes, I'm looking at you) charging at top speed ahead of the rest of the fleet, into the teeth of enemy fire, and getting instantly vaporized, is not reasonable.  They should never have been implemented to have this behavior in the first place; since they do, it should be modified ASAP.

5) Any specific movement or retreat or avoidance orders take immediate and absolute priority over anything.

6) Any attack/capture orders are lower priority the farther away the target is.  This would also help fix the phenomenon of "charge that guy even though he's retreating twice as fast as we can follow and going through the middle of the enemy fleet".  As the target got farther away, the friendly ship would pay some attention to the clouds of hostiles it's entering, and it wouldn't go on a full-blown charge after the target until those were cleared - or until the target had moved back into range.  And this repetitive thing of setting an order and having two units respond, one of which is always ON THE OPPOSITE SIDE OF THE FREAKING MAP, has got to stop.  There really needs to be some sort of weighting of travel time to the destination involved in picking which units are appropriate for the task.

7) Remaining engaged with the current target is of higher or lower priority depending on relative flux levels and remaining hull.  If you're at half flux and the nearby enemy has 1% hull left and you've just got orders to go attack something on the other side of the map, sure, see if you can finish this guy off before leaving.  If you're at high flux and his paint is barely scratched, get the hell out of there.  This would be a good place for officer personalities to come into play.

8) There needs to be a differentiation between "focus fire on this ship and try to move into range of it, but do try to avoid blowing up" and "suicidally attack this ship, disregarding all other factors".  There may be cases where "suicidal attack" is something the player wants to do - I haven't seen any, but I won't rule it out.  It definitely should not be the default behavior.  Officer personality might play in here also.  Right now the difference between engage and concentrate is "one guy shoot this guy if he happens to be nearby, otherwise do whatever" versus "two-ship suicide run".  I want the ability to lay multi-ship alpha strikes on a target without getting baited into a chase, or having to micromanage it each time.  Basically, I'd like to be able to concentrate fire, like the order says!

9) Manual orders to attack a ship or capture/defend a waypoint are not exclusive with automatically assigned priorities. If the auto-selection would choose a ship, and that ship has manual orders to do exactly what the auto-select is looking for, it counts as fulfilling the requirement rather than excluding the ship in question. 

10) Waypoint orders need to differentiate between "try to secure this at your discretion" and "hold this spot at all costs".  The difference is not how many ships get assigned to it, but in the behavior of the ships that are assigned to it.  Right now the difference between "capture" and "defend" is the difference between one ship backing off and letting them take it while pointing a green arrow to the spot, or the whole fleet backing off and letting them take it while pointing arrows to the spot.  Neither is terribly useful - often a significant part of the oncoming armada could be picked off by concentrated fire if the friendlies would just stand and fight.

11) Orders involving control points that are not "hold this position at all costs" should NOT absolutely require a ship to fulfill them, superceding all other priorities.  Currently, that is the case: if you have a ship that the game has assigned to the "capture" task, and you set it to something else (like, say, "destroy this ship that's trying to steal the control point from you"), the game SHOULD NOT try to hijack some other ship to fulfill this utterly useless task that is being fulfilled anyway through the manual command, forcing the player to assign manual orders and objectives to every other ship on the map to prevent them from charging over there even through the middle of the enemy fleet.  I should not have to un-toggle the "capture" on a control point in order to be able to specifically tell the nearby carrier to send a fighter strike at the frigate trying to steal it - and no, I do not trust the carrier AI to handle the situation on its own; too often I have seen them back off without a fight, which is just aw349awcn9;3w9o75!@!.  Setting an order on a control point should be "I'd like this done, if somebody's available reasonably near by and isn't fighitng for their lives".  Even if the friendly ship is not actively on the "capture" or "defend" task, the task IS being accomplished so long as the ship is nearby: the result is what matters.

12) Front-locked shields don't get dropped at low flux levels unless there is no enemy within range 1200 or so.  The wider the shield arc, the less inclined the ship is to drop shields.  Flickering omni shields makes sense because you can bring it back up wherever you need it.  Trying to flicker a 360 is a waste and just gets you tagged by Salamanders - and nerfing Salamanders is half the reason to use a 360 anyway.

And finally ...

13) In addition to the "Dismiss" option for your officers, there is also a "Public Firing Squad" option, which will permanently remove said officer from the game and strongly discourages all your other officers from doing whatever incredibly retardedly stupid thing it was that officer did in this most recent battle.

What?  I can dream, can't I?
Logged

Megas

  • Admiral
  • *****
  • Posts: 12732
    • View Profile
Re: Why do the AI captains do these things?
« Reply #1 on: March 11, 2022, 10:27:10 AM »

Also, AI totally ignores CR/PPT.  They will happily kite and cower until they literally cannot move anymore at zero CR then die a coward's death (or not if the other side is also at zero CR).  If CR is decaying, they should stop the kiting and either retreat (then reengage for another battle), or if that is not an option, become berserker and throw themselves at the enemy since they will die at zero CR anyway.

Player should be able to set general behavior instead of retreat ships one at a time when ships run out of PPT at different times but be able to set exceptions like for SO Hyperion.
Logged

DirectionsToL3Please

  • Commander
  • ***
  • Posts: 100
    • View Profile
Re: Why do the AI captains do these things?
« Reply #2 on: March 11, 2022, 04:27:41 PM »

There's been no clear effort to make ship AI move well in the battlespace. Firing weapons and raising/lowering shields seems to have taken all the dev hours into fleet AI.  Movement and target selection has no obvious checks on it to prevent catastrophically bad behavior.  Suspect there's only ship AI and no fleet AI, which exacerbates the problem.

If you can condense your complaints into a couple core issues (and I think movement and target selection are the ccause of almost every thing you've mentioned) then maybe mosey on over to the Suggestions section of the forum and put in your two cents. Can't hurt.

In the meantime, you may find that you can mitigate a lot of the problem - though nowhere near all of it - by setting your fleet up into good formations for making contact with the enemy fleet.  It'll still make bad decisions, but if you correctly position your fleet (and that's going to be dependent on fleet composition so I can't tell you what "the right way" is for your ships and loadout and way of playing) then you should find that bad behavior only starts showing up once the main press is over and you're segueing into cleanup, where bad choices make little difference.
Logged

Thaago

  • Global Moderator
  • Admiral
  • *****
  • Posts: 7779
  • Harpoon Affectionado
    • View Profile
Re: Why do the AI captains do these things?
« Reply #3 on: March 11, 2022, 04:44:31 PM »

There's been no clear effort to make ship AI move well in the battlespace. Firing weapons and raising/lowering shields seems to have taken all the dev hours into fleet AI.  Movement and target selection has no obvious checks on it to prevent catastrophically bad behavior.  Suspect there's only ship AI and no fleet AI, which exacerbates the problem.

If you can condense your complaints into a couple core issues (and I think movement and target selection are the ccause of almost every thing you've mentioned) then maybe mosey on over to the Suggestions section of the forum and put in your two cents. Can't hurt.

In the meantime, you may find that you can mitigate a lot of the problem - though nowhere near all of it - by setting your fleet up into good formations for making contact with the enemy fleet.  It'll still make bad decisions, but if you correctly position your fleet (and that's going to be dependent on fleet composition so I can't tell you what "the right way" is for your ships and loadout and way of playing) then you should find that bad behavior only starts showing up once the main press is over and you're segueing into cleanup, where bad choices make little difference.

There is a fleet AI on the AI side which sets orders in the same way that the player does (limited command points and all). On the player side there is... the player. The main problem is that there isn't very good tutorials or information on how to command the fleet in effective ways. Most of the OPs points (a few do sound like bugs or things that can't be addressed) can be quickly and immediately solved with the right orders, its just that its hard to know without a lot of experimentation what the right orders are! At the very least the description of the commands could be made much more precise so that people know exactly what the behaviors do.
Logged

DirectionsToL3Please

  • Commander
  • ***
  • Posts: 100
    • View Profile
Re: Why do the AI captains do these things?
« Reply #4 on: March 11, 2022, 05:34:36 PM »

There is a fleet AI on the AI side which sets orders in the same way that the player does (limited command points and all). On the player side there is... the player.
I may not have phrased that ideally. There's no clear evidence of fleet awareness, by which I mean ships don't consider what other ships are doing unless they've been assigned (or autoassigned) to avoid, target, or escort them. That means there's a lot of boneheaded decisionmaking that could have been avoided by just adopting a few basic fleet awareness concepts.  The omnipresent "why tf did you go over there and do that when the fight IS CLEARLY NOT THERE" is perhaps the most visible of those things, but it's not the only one.
At the very least the description of the commands could be made much more precise so that people know exactly what the behaviors do.
That would be great.  I still think "Defend" means "Go there unless you don't want to, and stay there until either something of no significance shows up in which case follow it to your death, or until the entire enemy fleet is 200 units out of range in which case stick to the point like your life depends on it" and "move to" means "whatever you do, don't go here unless it would be incredibly inconvenient if you did"  :P
Logged

Goumindong

  • Admiral
  • *****
  • Posts: 1906
    • View Profile
Re: Why do the AI captains do these things?
« Reply #5 on: March 13, 2022, 07:50:13 PM »

Fleet awareness is expensive. But the AI does engage in behavior that should mimic it. Your frigates are attempting to surround the enemy so that you could use their presence to push. It’s not their fault that your fleet was not there to aid them.
Logged

Hal900x

  • Lieutenant
  • **
  • Posts: 50
    • View Profile
Re: Why do the AI captains do these things?
« Reply #6 on: March 13, 2022, 10:11:10 PM »

There's been no clear effort to make ship AI move well in the battlespace.

That's putting it mildly. But it's understandable given the brain-melting number of variables this tiny team has to consider.

The main problem is that there isn't very good tutorials or information on how to command the fleet in effective ways.

This, in addition to being eminently true to a degree I can only express in astronomical scale, is much more addressable. The starting tutorials are every bit as simplistic as AI programming is complex. If there is a decent one I can check out please let me know.
Logged

FenMuir

  • Commander
  • ***
  • Posts: 101
    • View Profile
    • Fen Muir Youtube channel
Re: Why do the AI captains do these things?
« Reply #7 on: March 17, 2022, 11:10:58 PM »

You should check out my series for this version of the game (0.95.1a). It might help you with the game in some way. Good luck!
https://youtu.be/X2ioB8rrbE8
Logged

Daynen

  • Captain
  • ****
  • Posts: 466
    • View Profile
Re: Why do the AI captains do these things?
« Reply #8 on: March 19, 2022, 11:08:29 AM »

The really funny/sad thing is, I have personally experienced every single one of the OP's described scenarios so I know for a fact he's not making this up.  A few suggestions, if not arrived at already:

No burn drives.  Burn drives WILL be used by the AI at every cooldown, causing even the biggest ships to charge in like untethered frigates and get hammered.  The AI doesn't understand how to use or conserve burn drives, so take them away.  One less thing for the AI to completely screw up.

The only frigates I willingly add to a fleet are the nigh-indestructible ones with good point defense, like monitors for example.  Even then I only use a couple to split the enemy fleet and buy time while I personally wipe out the enemy's main force.

Point defense, point defense, point defense.  NEVER skimp on point defense for any AI controlled ship, EVER.  One lucky reaper is all it takes to completely shatter your battle line, ruin your formation, panic your AI and cost you your entire fleet.  And I'm not talking flak either; flak WILL let you down when you need it most.

A pilum boat can do wonders to push the enemy fleet around, as they'll spend a lot of effort avoiding the pilums--meaning those ships won't have full time on target.  Given that pilums are infinite, one good pilum boat, like say, a falcon(p) can be great for crowd control.  If it stays far enough away from the enemy it won't even lose PPT.

In general, I tend to skill my officers very defensively and give them ships they can't possibly be suicidal with, that are designed to hold off multiple targets and that are somewhat maneuverable and durable even when they DO screw up.  That way, I can bring my death machine of choice and systematically eradicate the enemy fleet while my fleet just holds the line, keeps enemy flux high and drains enemy PPT and maybe picks off a straggler or two.

All vents, no capacitors.  Having a bigger flux bar means nothing if it takes longer to empty.  The reason many of my ships are so tough is because I make it my MISSION to maximize their venting potential.  Having all capacitors means a ship can take a bigger burst of flux, yes, but then that ship is going to have a much longer window of vulnerability as it backs off to vent; it's also going to have a harder time managing its own weapons fire.  No idea why anyone ever prioritizes capacitors except in the most cleverly designed modded ships which directly benefit from them in some way.


Make no mistake, the AI is not your friend in this game.  Your own fleet WILL try to betray you.  Take away their ability to do so.  Simplify your fleet doctrine, remove the problem ships, maximize your flux dissipation, bolster your defenses and go on the attack while your boys have their staring contest.
Logged

Thaago

  • Global Moderator
  • Admiral
  • *****
  • Posts: 7779
  • Harpoon Affectionado
    • View Profile
Re: Why do the AI captains do these things?
« Reply #9 on: March 19, 2022, 11:11:27 AM »

Burn drive got reworked this very latest update btw - it is now cancellable and the AI was retooled to do cancel when under threat if not reckless/under an eliminate order.  Its still a 'go forward only' system but it works pretty well now.
Logged