Following up on the discussion in this topic
, I have made some tests with a slightly modified flee AI and I was quite happy with the result. I therefore submit this change for your further testing and consideration.
The change applies to ships with accuracy greater than 0. Dumb ships will continue to act dumb and flee in straight lines, but more often than not, you will be encountering pilots who will react more like a normal pilot would. "Clever" NPC pilots now check your position against theirs when fleeing and, if they feel that they are sitting in your sights, they will attempt to react. Most of the times they will try to jink more in order to get out of the way of your guns, but sometimes, in an act of desperation, they will turn and try to land a few hits on their attacker, hoping to surprise them. Current probability is 65% continue fleeing, 35% go evasive and consider an attack and they are open to suggestions.
The change required to test this:
Function performFlee in ShipEntityAI.m is changed to:
- (void) performFlee
if (behaviour != BEHAVIOUR_FLEE_EVASIVE_ACTION)
behaviour = BEHAVIOUR_FLEE_TARGET;
frustration = 0.0;
if (accuracy > COMBAT_AI_ISNT_AWFUL)
double aspect = [self approachAspectToPrimaryTarget];
// alert! they've got us in their sights! react!!
if (aspect > 0.9995 || aspect < -0.999)
behaviour = randf() < 0.35 ? BEHAVIOUR_EVASIVE_ACTION : BEHAVIOUR_FLEE_EVASIVE_ACTION;
Test binary for Windows x64 here