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.69k stars 375 forks source link

Computer casts Haste on flying creatures #3905

Closed jdm closed 1 year ago

jdm commented 3 years ago

I observed an AI player cast the haste spell on a vampire in a battle. This doesn't seem like a useful action.

jdm commented 3 years ago

It looks like this calculation is incomplete: https://github.com/ihhub/fheroes2/blob/9efabb1fe74febdc7ee9297a5a83baea68c70c00/src/fheroes2/ai/normal/ai_normal_spell.cpp#L254

saox commented 3 years ago

It can be useful when you want one specific unit to move before another one of the enemy. Remember that in HoMM2 flying units fly however far they want and their speed influences when will be their time to make a move. I would frequently Haste non-upgraded vampires to fly over to shooting units and block them.

ihhub commented 3 years ago

I think it's a matter of optimization of Haste usage rather than disabling the spell for AI.

ihhub commented 1 year ago

Closing this issue as there are no actions required at the moment and we greatly improved AI behaviour in battles.