ihhub / fheroes2

fheroes2 is a recreation of Heroes of Might and Magic II game engine.
https://ihhub.github.io/fheroes2/
GNU General Public License v2.0
2.73k stars 377 forks source link

Combat, AI places his troops without consideration of enemy troops that have 2-hex attack #7402

Open Branikolog opened 1 year ago

Branikolog commented 1 year ago

Preliminary checks

Describe the problem requiring a solution

AI places zombies in graveyard too close to each other so my Phoenixes could easily proceed attacking two stacks. image

Describe the possible solution

I think AI should avoid placing his troops close to each other in a case enemy army has a creature with 2-hex attacking ability. If it's possible, for sure. Battlefield in the example above allows to place zombies without sacrificing walked distance per turn. Breath+zombies.zip

Additional info

No response

zenseii commented 1 year ago

There are also still cases when the AI chooses to expose its creatures by lining them up for a double-hex attack without any reasonable explanation. Example the Rocs and Mummies get attacked by the pheonixes (timestamp 5:45) https://youtu.be/NUV-xR94mag?t=345

LeHerosInconnu commented 5 months ago

In this example, the AI protects a troop of rangers with its crusaders, without taking into account the possible two-hex attack by the cyclops.

In fheroes2:

https://github.com/ihhub/fheroes2/assets/43583994/288da190-8c39-445a-b615-35206e15ad2b

Here is the save file: Siege corpse over count 02.zip