Fractal Softworks Forum

Starsector => Mods => Modding => Topic started by: Histidine on December 23, 2015, 03:57:12 AM

Title: Managing fleet aggression
Post by: Histidine on December 23, 2015, 03:57:12 AM
So, I want to be able to control the following behaviors for NPC fleets:


And separately controllable:


And separately controllable:


(#3 can be done with the pirate fleet memory key, but this has potentially unwanted side effects like making the affected fleet turn its transponder off. #2 requires the trade fleet memory flag, which seems even worse.)

Can this be done? If not, could it be implemented for 0.7.2?

Specific use cases where I've encountered issues:
Spoiler
  • The "Follow Me" ability in Nexerelin currently gives nearby fleets an ORBIT_AGGRESSIVE assignment targeted on the player. This makes them basically ignore the order if there's a nearby enemy fleet they can chase all day. This can be solved with the ORBIT_PASSIVE assignment, but now said fleets won't come to the player's aid (ally battle) if player is attacked, which can be a huge noob trap.
  • Templars should opportunistically attack the player fleet if the player is the enemy, even if player's transponder is off, like pirates and Pathers do. (Else it becomes too easy to avoid a fight simply by keeping transponder off) But they should not do so too aggressively, as being constantly hunted down would get annoying very quickly given how powerful and far-seeing Templar fleets are.
[close]
Title: Re: Managing fleet aggression
Post by: Alex on December 25, 2015, 07:24:55 PM
I would suggest having a script change it from ORBIT_AGGRESSIVE to ORBIT_PASSIVE to INTERCEPT or whatever other assignments make sense. With INTERCEPT you should have fine-enough-grained control over what they attack so you wouldn't, hopefully, need to write the whole AI from scratch.
Title: Re: Managing fleet aggression
Post by: Histidine on April 19, 2016, 10:14:18 PM
If a fleet normally wouldn't assist the player in combat, is there a way to make it do so when the fleet encounter dialog starts?
(i.e. without having to check the fleet's surroundings constantly and give it an aggressive assignment if it looks like anyone is about to fight the player)
Title: Re: Managing fleet aggression
Post by: Alex on April 20, 2016, 08:43:43 AM
Setting its $isPatrol to true should do it, I believe.

Another very sure-fire way to do that would be to provide a FIDPI implementation that overrides the pullInNearbyFleets() method, though that's somewhat less future-proof.