StarSector Wiki
Advertisement

Foreword[]

This is a community attempt to document known or suspected AI behaviours for the purposes of enabling players to more intelligently design ships for AI use and thus have more useful AI wingman. As an unofficial, work in progress effort it is based on incomplete information & conjecture so do take it with a grain of salt.  

Variants[]

The AI is very dependent on the loadout its given. Most ships lean towards a preferred role, building variants to help it perform that role and giving it a personality to match will make its chances of successfully performing that role much higher. You would do well to build a variant looking through the eyes of the particular personality you have in mind. Not looking at variants and personality as two separate things to assign.

Holistic approach[]

(replace Variants section?)

It is important to use a holistic approach to both officer personalities & specific loadout as both elements interact with other strongly. A Cautious officer can act aggressive and an Aggressive officer can act defensively with particular loadouts. Both elements need to be carefully considered together.

AI factors[]

List of things that can influence any of the AI personality behaviours

  • Current flux level (as percentage)
  • Range of longest weapon
  • Range of shortest weapon
  • Turret vs hardpoint (a given weapon across these two weapon mount types)
  • Enemy missile potential threat (unfired, based on range)
  • Enemy missiles (fired, distance based)
  • Proximity to non-primary target enemy ships
  • Current primary target flux level (as percentage)
  • Primary target shields raised (or down)
  • Primary target overloaded
  • Flux cost of firing vs benefit (based per weapon group, not per weapon)
  • Proximity to any threats (in order to safely vent)
  • Enemy weapon threats (ranges and type)
  • Friendly ships with same primary target (flanking)
  • Internal back off threshold reached (will back off until safe to vent)
  • Enemy weapons disabled
  • Own weapons disabled
  • Low armour on a facing (preference other facings)
  • Critically low hull
  • Ship TAGS, with particular note of carrier, carrier + combat, or civilian
  • Collision avoidance

Range[]

Range of your weapons is crucial and often plays a big part in the role of a ship. e.g. Putting certain long ranged weapons in combination with short ranged ones can make a ship blow its flux reserves before it gets its other weapons in range and be very bad at assaulting, even though it might have an aggressive or even reckless personality. In the case of more cautious personalities, the shorter range weapons might not see any use at all unless the enemy comes for you instead.

Maneuverability[]

Speed and maneuverability of a ship is very important when choosing a more aggressive personality. The faster ship dictates the pace of battle, by being able to engage and disengage at its whim. The counterpart to speed is range, though the bigger the difference between ships' speed, the less that range matters.

Ship stats: Speed refers to velocity, Maneuverability refers to turning speed, and Acceleration refers to, well, acceleration.

Flux[]

The AI handles flux a bit different than you do. It seems that there's thresholds it holds itself to, what they are determined by I don't know. It could be set % per personality, enemy damage potential, or something more complex/simple.

As of .9, the AI will try to manage its weapon groups to not build up too much soft flux. This makes it important to pay attention to how much flux various weapon groups use: if you have a weapon that you want firing all the time for some reason, it may be worth it for that weapon to be in its own group, or with other low flux weapons. Weapons that generate large bursts of flux, such as Phase Beams or AM Blasters, have their decision to fire based on the full flux of their burst, so the AI will be hesitant to fire them at all if too many are linked. Its best to put weapons such as this on alternating fire, or even in different groups.

Note from Purple:

I’d estimate that the “critical flux threshold” is about 80-85% flux, and this is universal on all ships. Once this threshold is reached, the ship will retreat and refuse to engage enemies until it reduces flux to below somewhere around 10-15%. Counter intuitively, AI ships in this state will often refuse to drop their shields and this results in what we call “flux locking” as the ship becomes unable to reduce flux and is in a vulnerable defensive state.

Missiles[]

Missiles are a special breed. They usually have a set type that determines when the AI will use them, like when a nearby enemy ship overloads. But could also use them when at high flux, almost dead, enemy at high flux, just whenever it's reloaded, only vs fighters, etc. Fast missiles, because of their range and ability to be an almost guaranteed hit, can make the AI very nervous about venting. This means they will often get "flux locked" until they get very far away and finally feel safe to vent.

Alone vs. With friends[]

A lone ship is a sad and insecure one. If the AI has no friends to keep the enemies' guns busy it will behave much more cautiously and only vent when it is safe. Battles between 2 ships without a clear superior often drag out into a CR war because the fight constantly resets.

Carriers vs. Combat Carriers[]

Ships with the CARRIER tag & without the COMBAT tag will act as carriers. This will cause them to primarily dynamically use their fighter wings as defined by their personality and try to keep the carrier themselves out of combat as if a timid personality ship.

Ships with the CARRIER tag & also with the COMBAT tag will act as combat carriers. This will cause them to act as both a carrier & also a ship simultaneously. Additional care needs to be taken as the officer personality will impact the dynamic behaviour of both the fighters and also the combat carrier ship itself.

Collision avoidance[]

Starfarer_Dev_-_Collision_Avoidance_AI_Demo

Starfarer Dev - Collision Avoidance AI Demo

Starfarer Dev - Collision Avoidance AI Demo circa 2011

Larger ships will not move to avoid colliding with smaller friendly ships. Video from circa 2011 blog [1]



Personalities[]

Timid[]

Likes to stay back, has very little initiative to attack even when told to. It will generally only attack with its longest range weapon(s), but its priority is staying out of enemy weapon ranges.

Strongly attempts to stay out of enemy weapon threat areas and use longest range non-missile weapon. Fighters almost always set to escort. Strongly attempts to move away from non-target enemy ships. Starts back off behaviour at ~80% flux capacity.

Cautious[]

Is a bit more aggressive than timid. Will still try to engage with its longest range weapons for the sake of being able to disengage easily. Which then is entirely up to you giving it the correct fits to work with.

Strongly attempts to stay at range of longest range non-missile weapon. Lightly considers target’s flux levels for moving closer. Fighters ~90/10% escort/attack. Strongly attempts to move away from non-target enemy ships. Starts back off behaviour at ~80% flux capacity.

Steady[]

The default personality if no officer is present. It will generally form your battle line and go after ships the AI deems inferior to itself. Will try to get in range with all of its (non PD) weapons. Survivability is still a priority.

Attempts to range to target enemy based on relative flux levels. Fighters ~50/50% escort/attack. Strongly attempts to move away from non-target enemy ships. Starts back off behaviour at ~85% flux capacity.

Aggressive[]

Useful for strike variants and variants you are comfortable with are strong and should consistently engage enemies. It will still respect enemy damage potential and weapon range and tries to act accordingly. Works much better on faster ships because of their ability to disengage faster. The AI seemingly decides to pull back after a certain flux threshold has been exceeded, which on slower ships is often too late.

Strongly attempts to stay at range of its shortest non-missile weapon, including PD weapons. Strongly considers target’s flux levels for moving closer. Fighters ~10/90% escort/attack. Strongly attempts to move away from non-target enemy ships. Starts back off behaviour at ~90% flux capacity.

Reckless[]

Throws all restrictions out of the window, suicidal, engages anything. The only way to keep this personality from killing itself by driving into a brick wall is keeping it busy with orders. Only cares about its own flux level and lets it get very high before deciding to back off. There’s often only 2 outcomes, either it dies, or the enemy does. However—when paired with Safety Overrides and a pack of tough, speedy, expendable brawling ships (usually destroyers and/or cruisers)—this behavior can work like a charm.

Strongly attempts to stay at range of its shortest non-missile weapon, including PD weapons. Fighters ~5/95% escort/attack. Does not consider non-target enemy ships. Starts back off behaviour at ~90% flux capacity.

Ships that are shieldless, flux-neutral & Reckless deserve special attention as the effective nullification of mechanisms that would nominally cause a fallback will cause this type of ship build to attack almost without pause. Only its imminent or actual death or being heavily disabled will give it pause. Shieldless & flux-neutral means that it will effectively never reach 90% flux capacity while reckless ignores the positioning of other enemy ships.

Note from Purple[]

AI tends to “switch” personalities based on how many friendlies and enemies are present. If one steady ship fights three, it is likely to act closer to a cautious ship, and the outnumbering ships will perform more aggressively.

Reckless personalities specifically ignore this effect, and will only acknowledge their target when considering whether or not they should engage. Reckless ships will often willingly expose themselves to danger because, until their flux is critically high and they are forced to pull back, nothing matters except their quarry.

Note from Inventor Raccoon[]

AI doesn't escort if they have bombers. Which bypasses a large problem with cautious officers in carriers.

Known bugs[]

Escort jostling[]

If there are three carriers escorting a single combat ship, one of them will end up ahead of the escortee where it is vulnerable. Escorts (including non-carriers) can also get pushed out of their "slots" by nearby ships and end up moving to a tactically undesirable position.[2]

Runaway derelict[]

Sometimes in a battle with derelicts, an enemy ship will run off into the fog of war and require the player to search for it after other enemies have been destroyed. This can be caused by a Sentry running out of missiles (its only weapons) and pulling back; killing it before it can get away should prevent the issue.

References[]

Change History[]

0.9

  • Ships ordered to "Eliminate" or "Full Assault" will be more aggressive when facing an orbital station
  • Improved use of Maneuvering Jets/Plasma Jets to back off while at high flux
  • Ensured that retreat orders are obeyed promptly
  • "Escort" order will now take precedence over "Avoid"
  • More liberal missile use when they're at full ammo and the ship is having difficulties
  • Further reduced tendency to fire off missiles vs unshielded ships
  • Fixed autofiring inaccuracy with dumbfire rockets/torpedoes when paired with missile speed bonuses
  • Also affects autofiring weapons on player's ship
Advertisement