fheroes2 icon indicating copy to clipboard operation
fheroes2 copied to clipboard

Computer casts Haste on flying creatures

Open jdm opened this issue 4 years ago • 3 comments

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

jdm avatar Jul 25 '21 15:07 jdm

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

jdm avatar Jul 25 '21 15:07 jdm

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.

saox avatar Jul 26 '21 07:07 saox

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

ihhub avatar Jul 26 '21 15:07 ihhub

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

ihhub avatar Nov 26 '22 11:11 ihhub