fheroes2 icon indicating copy to clipboard operation
fheroes2 copied to clipboard

Combat, auto combat mode, strange behavior "The enemy has fled!"

Open LeHerosInconnu opened this issue 4 years ago • 2 comments

The first blue hero attacks the nearest green hero to the east.

In single mode, blue player. Click the "AUTO" button at the start of the combat. Click the "AUTO" button while the Dwarves are moving. In the next round, the player did not regain control of the Elementals. And as soon as a troop of Dwarves is decimated, the combat ends "The enemy has fled!".

In multiplayer mode, two players. Click the "AUTO" button at the start of the combat for the blue player. Click the "AUTO" button at the start of the combat for the green player. Click on the "AUTO" button while the Dwarves are moving to regain control. Click on the "AUTO" button to switch back to automatic mode and wait. As soon as a troop of Dwarves is decimated, the combat ends "The enemy has fled!".

In fheroes2:

Auto mode fled fh2 01

Auto mode fled fh2 02

Here is the test scenario file: The enemy has fled.zip

LeHerosInconnu avatar Sep 29 '20 16:09 LeHerosInconnu

Hi @LeHerosInconnu , I cannot reproduce this issue anymore. Could you please check again?

ihhub avatar Aug 20 '21 15:08 ihhub

Hello @ihhub,

Hi @LeHerosInconnu , I cannot reproduce this issue anymore. Could you please check again?

I redid some tests with version 0.9.6 4032.

The first blue hero attacks the nearest green hero to the east.

In single mode, blue player. Click the "AUTO" button at the start of the combat. Click the "AUTO" button while the Dwarves are moving. In the next round, the player did not regain control of the Elementals. And as soon as the second troop of Dwarves is decimated, the combat ends "The enemy has fled!".

In multiplayer mode, two players. Click the "AUTO" button at the start of the combat for the blue player. Click the "AUTO" button at the start of the combat for the green player. Click on the "AUTO" button while the Dwarves are moving to regain control. Click on the "AUTO" button to switch back to automatic mode and wait. The green hero does not flee.

In fheroes2:

The enemy has fled 11

The enemy has fled 12

LeHerosInconnu avatar Aug 21 '21 12:08 LeHerosInconnu

I'm not sure what is wrong here. AI decided to flee after some losses, what's wrong with this?

oleg-derevenetz avatar Nov 13 '22 00:11 oleg-derevenetz

Hello @oleg-derevenetz,

I'm not sure what is wrong here. AI decided to flee after some losses, what's wrong with this?

When the AI hero flees, all remaining troops in the hero's army are lost anyway. The AI should wait until the last moment to flee (but without risking the loss of his hero) in order to maximize the damage inflicted on the opposing troops (with spells and troop attacks). In the original case, the AI could wait a little longer before fleeing (although the dwarves wouldn't have done much more damage anyway (but I doubt that the hero's escape was intentional with that taken into account in the example)). If the AI troops and the hero's spells can't inflict damage to the opponent's troops, then the hero might as well run away from the start of the combat so as not to waste spell points or give experience to the opponent hero.

Now look at the result with a different version of the game than the original post (second test). The hero doesn't flee (same in the latest version (hero does not flee at start of combat)).

LeHerosInconnu avatar Nov 13 '22 15:11 LeHerosInconnu

@LeHerosInconnu Ah OK, so this issue is related not to game logic itself, but to AI decisions. I couldn't figure out what was wrong with the logic of the game. I'll reclassify it then.

oleg-derevenetz avatar Nov 13 '22 16:11 oleg-derevenetz