fheroes2 icon indicating copy to clipboard operation
fheroes2 copied to clipboard

AI hero gets stuck in an infinite loop jumping between 2 castles

Open ihhub opened this issue 2 years ago • 3 comments

Preliminary checks

Platform

Windows

Describe the bug

AI hero goes into an infinite loop while using Town Portal and jumping between 2 castles. Load the save file to pass the control to AI.

Save file

town_portal_infinite_loop.zip

Additional info

No response

ihhub avatar Apr 01 '23 03:04 ihhub

This issue requires implementation of #7139 in order to avoid such a behavior.

ihhub avatar Aug 22 '23 11:08 ihhub

This issue requires implementation of https://github.com/ihhub/fheroes2/issues/7139 in order to avoid such a behavior.

Hi @ihhub could you please explain in more detail how #7139 is related to the Town Portal spell? Please also note that as soon as Solmyr hires enough troops, he stops jumping from castle to castle and attacks the wandering stack of dwarves nearby, so it's not "endless" at all - he just has nothing to do until he hires more troops.

oleg-derevenetz avatar Aug 22 '23 13:08 oleg-derevenetz

Hi @oleg-derevenetz , I actually realized that AI heroes do start their turn by executing an action when they are in castles. So yes, you are right.

I don't think that we can improve this behavior at the moment.

ihhub avatar Aug 22 '23 14:08 ihhub