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); New blog post: Simulator Enhancements (03/13/24)

Author Topic: Managing fleet aggression  (Read 2339 times)

Histidine

  • Admiral
  • *****
  • Posts: 4661
    • View Profile
    • GitHub profile
Managing fleet aggression
« on: December 23, 2015, 03:57:12 AM »

So, I want to be able to control the following behaviors for NPC fleets:
  • Don't pursue enemies
  • Pursue enemies if provoked (get too close or are fighting fleets not hostile to us), break off if they're outrunning us
  • Pursue any enemy entering sensor range doggedly until we lose them or they die


And separately controllable:
  • Don't assist ally fleets in battle
  • Assist ally fleets in battle


And separately controllable:
  • Don't attack enemies (particularly player) if they have transponder off and are of unknown identity
  • Do attack such fleets


(#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]
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23987
    • View Profile
Re: Managing fleet aggression
« Reply #1 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.
Logged

Histidine

  • Admiral
  • *****
  • Posts: 4661
    • View Profile
    • GitHub profile
Re: Managing fleet aggression
« Reply #2 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)
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23987
    • View Profile
Re: Managing fleet aggression
« Reply #3 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.
Logged