Page 1 of 1

Strange retreat logic

Posted: Sun Aug 08, 2010 1:11 pm
by Ebbingford
There is still a problem with the retreat logic in the area around Neisse, ID354, and Kosel, ID355.

I'm playing as Austria, long campaign, with 1.03b5 patch.
In the attached save I was entrenched in Kosel and attacked by overwhelming forces from Neisse. I succeeded in retreating and won the battle, but retreated to Neisse instead of to Freudenthal, clear terrain, easy retreat, which I still control and is towards a depot :(
Image

My forces then arrived in Neisse and were attacked again. Again I managed to retreat but lost the battle. My column then arrived back in Kosel where both sides retreated from battle and we all have ended up in Neisse. :w00t:

I have seen retreats like this in this area of the map quite a bit, but this one just looks more wrong than the others. Forces shouldn't be retreating into the area from where their attackers have come from. On another occassion I had a force in Neisse, controlled Kosel, was attacked from Glatz, and retreated there instead of to Kosel. :(

I guess that the snow in Freudenthal might be why my forces didn't retreat there in this example, but it does still seem wrong to retreat towards your enemy and away from your nearest depot. If you have 100% MC of an adjacent region then surely you should be retreating there instead of into a region which is 100% enemy controlled and is where the attack has come from.

Posted: Sun Aug 08, 2010 1:58 pm
by Ebbingford
It also looks like the second battle, which was given as an Austrian defeat despite inflicting twice as many casualties as I received and destroying several elements, has been actually treated as a victory. And rightly so. :D
The message log said that it was an Austrian defeat and 4NM lost, and the battle report said an Austrian defeat, but my NM looks like it has been increased by 4, not decreased.
The Prussian NM also looks like it has dropped with no mention of any events for either side to have altered the NM.

Posted: Mon Aug 09, 2010 2:10 pm
by Ebbingford
Here is another example from the same area of the map. same campaign as the last one.

Image

Here my hussars were attacked in Reichenbach, ID352, and retreated to Neisse, Prussian controlled, instead of the logical retreat rout to Nachod, back towards my supplies.
Save and backup attached if needed.

Posted: Tue Aug 10, 2010 2:33 pm
by Pocus
Wow, I can't believe I never saw the bug I found, despite going to this code perhaps 10 time since some years!

The bonus given to the interest in retreating in a region, received from structures there (depots) was always given, even if the structures were not your!

Sorry for this huge bug.

While I was on that, I exported this variable and upped it:
cltRetPenaltyPerNmySU = 4 // retreat penalty (in interest pts) for each nmy SU in retreating region

Posted: Tue Aug 10, 2010 2:54 pm
by Carnium
Pocus wrote:The bonus given to the interest in retreating in a region, received from structures there (depots) was always given, even if the structures were not your!

This would explain why the AI units were sometimes "retreating" even deeper into the human territory after a lost batle. This will be a big fix :w00t:

Posted: Tue Aug 10, 2010 2:57 pm
by Ebbingford
What about the apparently strange swing in the NM totals that I snuck into the post as well? :D

Posted: Tue Aug 10, 2010 4:31 pm
by squarian
Pocus wrote:Wow, I can't believe I never saw the bug I found, despite going to this code perhaps 10 time since some years!

The bonus given to the interest in retreating in a region, received from structures there (depots) was always given, even if the structures were not your!


Great news! I assume this logic applied to human-controlled units as much as AI-controlled, since the player was not involved in determining retreat path? Since your last improvements, retreat paths have been more logical, but this ought to take care of the remaining quirks.