Closed zenseii closed 1 year ago
Ah, yes. I have this in my TODO list. Sometimes AI heroes indeed move on objects which they shouldn't. We need to connect HeroesValidObject() function from ai_normal_hero.cpp to ai_normal.cpp file.
I see! I believe it is OK for the AI to actually create the path through the pyramid (apart from the fact that it should actually go in the exact opposite direction to escape, really), the core issue described is that the AI shouldn't even make the choice to attack the pyramid, just ignore it and move along.
In fact I do wonder if the AI has attacked the pyramid many times during this map, thereby losing lots of heroes, but this I have not checked.
I don't see an issue for AI to pass through objects like Pyramids, especially here when it was trying to avoid another hero blocking the way. Better fix is to add a check during the visit for AI to decline the battle.
Preliminary checks
Platform
Windows
Describe the bug
The AI green player avoids the blue player by creating path through the pyramid and attacks it, but it is obviously too weak and dies.
It has a decent enough army:
https://github.com/ihhub/fheroes2/assets/12501091/c141cf27-1eca-430c-80aa-3ac373c2087a
There are several issues here, but the core one is that the AI's evaluation of the pyramid needs improvement.
Save file
ai suicide pyramid.zip
Additional info
No response