Page 1 of 1
Strange evade move.
Posted: Thu Aug 10, 2023 7:36 pm
by tyronec
This is from the Carthaginian tournament.
On about the third turn the left hand javelin unit is in rough terrain. The Pyrrhic javelins advance and shoot at it. Then the light cav charges - with the javelins in the rough the win/loses chances for the light cav is 0%/60% in both impact and melee. Yet the light javs evaded. There is no flank threat.
The only explanation I have for this is that they thought it was a flank charge - when the light cav charged they followed the blue track which does bring them in from the flank tile although clearly it is not a flank charge.
I set up a test bed to see if it replicates and it does. If you just charge with the light cav from this position then they follow the blue track and the javs evade (even though it is not a flank charge), however if you force them to follow the orange track then of course they lose and bounce off.

- A1.jpg (79.24 KiB) Viewed 680 times

- A2.jpg (163.36 KiB) Viewed 680 times
Re: Strange evade move.
Posted: Thu Aug 10, 2023 10:59 pm
by Ray552
Possibly they evaded because accepting the close combat with the light cavalry would have left them open to a flank attack in the following enemy turn by the light javelinmen currently in front of them.
I've seen similar situations where steady light infantry were charged by disrupted enemy lights, but evaded because enemy non-light units were within charge range, regardless of flank or rear charge exposure.
Re: Strange evade move.
Posted: Thu Aug 10, 2023 11:19 pm
by SnuggleBunnies
tyronec wrote: ↑Thu Aug 10, 2023 7:36 pm
Had the armored cav moved first? That would maybe put them within charge range.
Otherwise I don't know, never seen anything like this before.
Re: Strange evade move.
Posted: Fri Aug 11, 2023 6:17 am
by tyronec
This has nothing to do with the other units, it is all about pathing.
We know the game prefers units to charge through tile sides rather than tile corners, so it will prefer the cav to charge in from the front or side of the javs rather than on the diagonal.
If the friendly javs are not there the cav will charge from the front and will bounce off.
If the friendly javs are there then, if they can, the cav will charge in from the side - and the javs will evade.
What I think is happening is that the algorithm that determines whether to evade or not looks at the final approach direction and makes it's decision to evade or not on that, REGARDLESS of whether it counts as a flank charge or not. Looks like it is not working as intended to me...
From the test bed, the first pic the cav will bounce; second pic the javs will evade.

- A3.jpg (178.38 KiB) Viewed 657 times

- A4.jpg (223.04 KiB) Viewed 657 times
Re: Strange evade move.
Posted: Fri Aug 11, 2023 8:01 am
by rbodleyscott
Interesting.
The pathing issue in/near rough terrain I cannot do anything about, because it is done by the engine. Scripting it would have excessive processing overheads.
What I think is happening is that the algorithm that determines whether to evade or not looks at the final approach direction and makes it's decision to evade or not on that, REGARDLESS of whether it counts as a flank charge or not. Looks like it is not working as intended to me...
The evade decision uses the normal "IsFlankRearAttack()" function to determine whether it is a flank attack. That function takes into account both the final position of the charger and its starting position. So in this case it should return that it isn't a flank attack.
And on testing I can confirm that IsFlankRearAttack() is correctly returning 0.
I will have to look into it further to see if I can find any other reason for it.
Re: Strange evade move.
Posted: Fri Aug 11, 2023 8:35 am
by rbodleyscott
I have discovered the reason. As you probably know, the game checks for other possible chargers when deciding whether to evade.
In this case the combat margin vs the enemy javelinmen is worse than the combat margin vs the light horse, so that combat margin is used for the decision.
However, it is using the chance of being caught by the light horse as the other element of the decision, as to whether it is more dangerous to evade than to stay.
(If the light javelinmen charged, it would stay, not because it fancies the odds, but because of the high risk of being caught when charged from the adjacent square).
So it is the combination of the 2 enemy units that is making it evade, but it is nothing to do with flank attacks.
And it isn't a bug.