[Guide] Flee Behaviors Explained

This forum is the ideal place for all discussion relating to X4. You will also find additional information from developers here.

Moderator: Moderators for English X Forum

Rezoken
Posts: 13
Joined: Sat, 6. Feb 16, 08:54
x4

[Guide] Flee Behaviors Explained

Post by Rezoken » Wed, 13. May 20, 19:24

Hi everyone,

So I got kind of sick of not understanding the flee behavior and the available options in the Flee Command (in your behavior tab) and not understand why it did it what it did at times. Here is what I uncovered, please add your feedback if you have any other ideas or found differeing behaviors.

Flee Methods

1 - Highway
2 - Dock
3 - Boost
4 - Maneuver
5 - ? (Same as Highway)


Flee Basic Behavior
  • Ships will attempt to flee a maximum of 20km away
  • Ships will only boost for a maximum of 30 seconds
  • If Ships have Laser Towers then they will deploy them as they are fleeing as long as you are not on a highway.
  • If Ships have some wares then there is a chance it will drop it based on Morale and your Flee Method is not set to 4 (Maneuver)
  • If hold fire is set all it does is set weapon modes to hold fire.
  • Flee behavior has some logic to check how FAR a ship must flee before the attacker can no longer see it.
  • Fleeing will grant pilot XP if they successfully escape, the amount of XP depends on the difficulty of the engagement (ship hull and damage per second are factors)
  • Fleeing with the flee methods will follow a set flow: Order is 1 (Highway), 2 (Dock), 3 (Boost), 4 (Maneuver)
  • If after that order is complete the attacker is still in range then it will start the flee attempt again starting at 1 (Highway) regardless of setting.
  • If after 3 re-attempts at fleeing it will give upo and wait between 3-10 seconds before attempting to flee again. (this is why we may see ships getting stuck in the Flee then attack logic)
  • Setting your Flee option to a different value changes the starting point of the order. Setting Flee option to "3" means it will not attempt to dock and/or use highways if possible. "5" is the same as "1" as far as I can tell.
  • After successful flee it will re-arm weapons.

1 - Flee Highway Behavior
  • If Ship Type is L or XL then it will exit this method immediately and go to next method (Dock).
  • If a Highway is within Radar Range of the Ship then it will target it and attempt to use it. It will attempt to boost for a maximum of 30 seconds towards that Highway.
  • I am unsure what it considers a Highway at this point. Might be Highway Ring, Super Highway or might be Sector Jump Gates or might be all? But since L and XL ships are excluded I assume it is just referring to the Highways you can hop on and off at any time. If you have the mod remove super highways turned on then this flee method does next to nothing?

2 - Flee Dock Behavior
  • If Ship Type is L or XL then it will exit this method immediately and go to next method (Boost).
  • If the ship is already docked then it will check if it is safe by ensuring the attacker is greater than 15 KM away. If the attacker is more than 15 KM away then resume behavior. If less than 15 KM it will wait for 1-2 minutes, after which will recheck. If rechecked 3 times then it will just risk it and resume behavior.
  • The ship will check for any stations in the zone that are neautral or higher relation and choose the closest one. If no stations then will go to next method (Boost).
  • If a ship has subordinates it will attempt to recall them (indefinitely....) before attempting to dock.
  • Ship will attempt to dock, and if docking fails (no docking ports, they are all full etc) it will method to next method (Boost).
  • If able to dock, then it will boost towards the assigned dock, if it takes longer than 10 minutes to get to the dock it will then attempt default behavior I believe?
  • If the attacker dies during this time, it will cancel docking request and resume default behavior.
Major issue here! It only considers Stations for docking. It does not consider L or XL player ships that have a dock capable to hold your ship.
3 - Flee Boost Behavior
  • Will boost only a maximum of 20km and a maximum of 30 seconds.
  • If the ship does not have any shields and can't boost then it will go to next method (Maneuver)
  • If there are no L, XL or Stations in its flight path (25 degrees in a cone in front of it then it will boost in a straight line in the opposite direction of the enemy). Note that if the enemy is on the outskirts of the fight then there is a high chance that your ships will attempt to boost in the opposite direction straight into the middle of the main group of enemies.
  • It will attempt to fly away 20km.
Important!! If the shields are less than 50% it will NOT boost at all. Greater than 50% it will boost. If you want your ships to flee then make sure you initiate before 50% shield dmg.

4 - Flee Maneuver Behavior
  • If Ship Type is L or XL then it will exit this method immediately and attempt to go back to Boost after 3 attempts it will just move slowly and do nothing... kind of pointless of L and XL ships haha. Best option for all L and XL ships is definitely stack with Laser Towers, and escorts.
  • This will just perform random movements for a period of time, going in random directions. Not very helpful if the ships do not have any additional supplies such as Laser Towers.

aurelcourt
Posts: 267
Joined: Fri, 20. Oct 17, 09:20
x4

Re: [Guide] Flee Behaviors Explained

Post by aurelcourt » Wed, 13. May 20, 22:32

Whoa awesome explanations!

Can we have that kind of guide in the wiki for all behaviours and commands ?? 😀😀😀


Rezoken
Posts: 13
Joined: Sat, 6. Feb 16, 08:54
x4

Re: [Guide] Flee Behaviors Explained

Post by Rezoken » Wed, 13. May 20, 23:19

aurelcourt wrote:
Wed, 13. May 20, 22:32
Can we have that kind of guide in the wiki for all behaviours and commands ?? 😀😀😀
If someone has edit abilities for the Wiki and the Developers can confirm that my understand is correct, then they can put it up.

Also, since this is probably a moving target (with patches and also the ability to be modified via Mods) it might be a bit hard to keep it up todate.

The main one for me that needs to be fixed as soon as possible is the Flee using Dock command. That would be AMAZING if using Flee with option 3 causes your fighters to run into your Carrier with their tail between their legs. I plan to mod it as soon as I can... but just finding the time between work, family and getting the small amount of play time in makes me less inclined, and I know we have some very smart cookies out there in the modding world that can do it better and quicker than me.

Rezoken
Posts: 13
Joined: Sat, 6. Feb 16, 08:54
x4

Re: [Guide] Flee Behaviors Explained

Post by Rezoken » Wed, 13. May 20, 23:23

A couple of small tweeks I would like to make, either Devs to include in base game, or a modder.
  • The Flee Dock mechanic should check for both stations and friendly L and XL ships with Docks and sort by distance
  • Add the ability to override the 50% boost mechanic, this is because a Carrier or Destroyer at 50% shield is still as HELL of a lot shield, and my destroyers can boost away at 1500 m/s with mods

easternsun
Posts: 512
Joined: Fri, 15. Nov 19, 22:17

Re: [Guide] Flee Behaviors Explained

Post by easternsun » Wed, 13. May 20, 23:56

Interesting finding. In my game all i ever see from ships when they flee is to fly to the edges of the galaxy forever. I'll start loading them with laser towers and mines now that I know they will use them.

User avatar
Nort The Fragrent
Posts: 954
Joined: Fri, 5. Jan 18, 21:00
x4

Re: [Guide] Flee Behaviors Explained

Post by Nort The Fragrent » Thu, 14. May 20, 03:08

I have got it all wrong !

I thought it meant my ship has Flea’s

And needs to quarantine out in deep space till the infestation has subsided.




Goodness knows what es mean by flee.
my ships just hang around waiting to get deaded.
Even though they have the flee command as default.

chip56
Posts: 500
Joined: Mon, 13. Apr 20, 21:52

Re: [Guide] Flee Behaviors Explained

Post by chip56 » Thu, 14. May 20, 08:12

I think this shows beautifully why i was cursing so often about the flee function when i build my first 2 destroyers to stop xenon invasions.
There is no logic to use a jump gate at all.

I had mine defending a jump gate (not the one to the xenon sector, but the one to the next friendly sector) and when i gave them an order to flee through the jump gate cause an I or multiple K attacked:
The flee command overwrote the "move to the other sector" command. End result: my destroyers moved away from the gate and got themselves killed even though they were pretty much sitting on the gate and could have simply moved through it and then safely active their travel drive to get far enough away

leoriq
Posts: 365
Joined: Wed, 20. Mar 13, 06:42
x3ap

Re: [Guide] Flee Behaviors Explained

Post by leoriq » Thu, 14. May 20, 08:20

Behavior 5 is for moving into neighboring sectors.
Behavior 1 works only in current sector.
Signature yes signature a GIGANTIC SIGNATURE!!

Andrey12y
Posts: 71
Joined: Mon, 7. May 18, 21:06
x4

Re: [Guide] Flee Behaviors Explained

Post by Andrey12y » Thu, 14. May 20, 14:02

@Rezoken
Interesting information, thanks.

Just wondering where there is check for at least 30-40% recharged shield before set to previous command.
I saw my ships flees and then immediately jump to fight again and die because no shields. No much point of such flee maneuver.

Can you also extract info about Morale skill earning from fight and trade activities?
Like if my pilot bought spaceweed for 200 cr and sold it on black market with crazy margin - did it make him happy, more motivated and more experienced?

Rezoken
Posts: 13
Joined: Sat, 6. Feb 16, 08:54
x4

Re: [Guide] Flee Behaviors Explained

Post by Rezoken » Thu, 14. May 20, 18:26

leoriq wrote:
Thu, 14. May 20, 08:20
Behavior 5 is for moving into neighboring sectors.
Behavior 1 works only in current sector.
I didn’t see any code or conditions that would cause that? Can you point out where you see that behavior in the files?

Rezoken
Posts: 13
Joined: Sat, 6. Feb 16, 08:54
x4

Re: [Guide] Flee Behaviors Explained

Post by Rezoken » Thu, 14. May 20, 18:31

Andrey12y wrote:
Thu, 14. May 20, 14:02
Just wondering where there is check for at least 30-40% recharged shield before set to previous command.
I saw my ships flees and then immediately jump to fight again and die because no shields. No much point of such flee maneuver.
Unfortunately I do not see that behavior at all. However, I see no reason why it couldn't be added? It should all be possible in the files that I saw. Currently it only checks to see if the attacker is still in the area and then resumes (or it tried to flee to many times). However, an attacker is a single attacker for the most part, and so if it runs from the single heavy fighter that then dies, but 40 of his buddies are still around it can then fly back into the frey.
Andrey12y wrote:
Thu, 14. May 20, 14:02
Can you also extract info about Morale skill earning from fight and trade activities?
Like if my pilot bought spaceweed for 200 cr and sold it on black market with crazy margin - did it make him happy, more motivated and more experienced?
The experience gain and when and where it does it is beyond me. There are too many files that deal with experience and really don't want to go through hundreds of files trying to pull it out.

I do know however that trading will increase both Pilot and Morale skill. I am not sure if you get more or less depending on the quantity of wares traded or the % of profit made. I also know that Morale can decrease slowly over time if your ship is just idling and do nothing.

Sao t'Lp
Posts: 135
Joined: Tue, 17. Nov 09, 21:18
x4

Re: [Guide] Flee Behaviors Explained

Post by Sao t'Lp » Fri, 15. May 20, 18:42

I took the liberty of putting some of your findings into a wiki article. It's not as detailed as your guide but that's by choice because I did not wanted the guide to be too close to the actual implementation.
You want Split? :split:

leoriq
Posts: 365
Joined: Wed, 20. Mar 13, 06:42
x3ap

Re: [Guide] Flee Behaviors Explained

Post by leoriq » Sat, 16. May 20, 16:43

Rezoken wrote:
Thu, 14. May 20, 18:26
leoriq wrote:
Thu, 14. May 20, 08:20
Behavior 5 is for moving into neighboring sectors.
Behavior 1 works only in current sector.
I didn’t see any code or conditions that would cause that? Can you point out where you see that behavior in the files?
I saw that in game, not in files.
Signature yes signature a GIGANTIC SIGNATURE!!

Ahrimon
Posts: 15
Joined: Sun, 28. Mar 04, 20:46
x4

Re: [Guide] Flee Behaviors Explained

Post by Ahrimon » Tue, 29. Sep 20, 14:34

Where's the stop fleeing and do what I tell you command instead of constantly overriding my orders with "Flee". :evil:

Ezarkal
Posts: 1610
Joined: Wed, 22. Apr 15, 02:27
x4

Re: [Guide] Flee Behaviors Explained

Post by Ezarkal » Tue, 29. Sep 20, 15:05

Ahrimon wrote:
Tue, 29. Sep 20, 14:34
Where's the stop fleeing and do what I tell you command instead of constantly overriding my orders with "Flee". :evil:
I always assumed the "button" for that was supposed to be called "crew morale", but then I saw some ships with very high morale fleeing immediately.
Still, over the last few patches, I find that ships are more responsive. Unless they are in an overwhelming situation, they tend to stick to orders.

(I still don't get why fighters will boost away half their shields right at the start of an engagement, but at least they do come back to finish the fight.)

@ OP: Thank you very much for shedding some light on this.
Humans are deuterostomes, which means that when they develop in the womb the first opening they develop is the anus.
This means that at one point you were nothing but an asshole.

Some people never develop beyond this stage.

Raevyan
Posts: 1463
Joined: Sat, 4. Oct 08, 17:35
x4

Re: [Guide] Flee Behaviors Explained

Post by Raevyan » Tue, 29. Sep 20, 15:48

The sad thing about this is, that even the very basics of information has to be tested and written down by the players who do not know if it’s actually working as intended or bugged.

Scoob
Posts: 10071
Joined: Thu, 27. Feb 03, 22:28
x4

Re: [Guide] Flee Behaviors Explained

Post by Scoob » Tue, 29. Sep 20, 16:26

The main issue with the Flee behaviour is that it can put perfectly safe ships in danger.

I'll often see a ship of mine be harassed by Pirates from up to forty Kilometres away while my ship is flying away using its Travel Drive from said Pirate. Basically, the Transporter is in ZERO danger as long as it simply keeps following its current order. It's not like the Pirate is ahead of my ship and able to cut it off, for example.

However, what happens? Well, my ships is like "Oh no, I've been HARASSED by a ship that poses no danger to me and I can EASILY escape by doing nothing other than continuing to follow my current orders. What shall I do?"

a) Proceed with current orders, there is no threat here, no way that Pirate can catch me as I'm already zipping along in Travel mode.

b) Engage "Flee" mode by STOPPING DEAD IN SPACE and oh so slowly re-engaging my travel drive, giving the pirate ample time to catch up.

Decisions decisions, I choose B!

I have commented on this behaviour a number of times in the past, as it appears that when a ship is scanned - even though it occurs from up to 40km away remember -this instantly disrupts said ships travel drive. I assume that this is the "Flee" behaviour being triggered, the same as the ship will exit travel mode if it's configured to attack as default behaviour in this event.

Needless to say this is exceedingly frustrating to see play out. Pirates are not smart, they don't lurk shipping lanes and hang out at obvious choke points. They have the ability to initiate a Scan from up to 40km away and, quite often, my ship has already passed out of scanner range (the aforementioned 40km) by the time I get the alert of pirate activity, so there are NO pirates in range. Yet, my ships has still halted dead in space, while showing the order "Flee" but taking an age to get back up to speed - MUCH slower than when it usually engages its travel drive.

Flee behaviour, when used appropriately, is much better than it once was. A fleeing ship used to regularly fly right AT its harasser, taking time to turn around to do so. Crazy lol. Now they generally follow their prior path - which is generally already away from the Pirate, yet because they HALT and PAUSE for an extended period when the Flee command is triggered, they often get caught.

Flee, in essence, is ok, as are the methods it chooses to Flee, ducking into a Highway etc. etc. However, the fact that triggering Flee temporarily stops the ship dead in space is a MAJOR flaw. The command needs to be smarter, be mindful of the direction the ship is already travelling in (is it safe, is it a valid "flee" route such as a gate, highway or even station) and NOT break Travel Mode if it's currently engaged.

Bit of a ramble I know, but I've observed the Flee behaviour directly killing my ships time and time again, despite the ship being in ZERO danger prior to the command being issued.

Scoob.

Raevyan
Posts: 1463
Joined: Sat, 4. Oct 08, 17:35
x4

Re: [Guide] Flee Behaviors Explained

Post by Raevyan » Tue, 29. Sep 20, 16:42

The question I have in my mind right now is: why are pirates able to scan from 40km while I have to stay in 2km range?

Ezarkal
Posts: 1610
Joined: Wed, 22. Apr 15, 02:27
x4

Re: [Guide] Flee Behaviors Explained

Post by Ezarkal » Tue, 29. Sep 20, 19:34

Add to that the fact that police will also need to come in close to scan your ships, and they do so with no apparent issues.
So pirates should not need to scan from 40km away.
Humans are deuterostomes, which means that when they develop in the womb the first opening they develop is the anus.
This means that at one point you were nothing but an asshole.

Some people never develop beyond this stage.

Post Reply

Return to “X4: Foundations”