r/heroes3 18h ago

How does AI decide where to move with flying creatures?

pic-1, before devil's turn
pic-2, after devil's turn

I am currently attempting a somewhat infamous fight of a crusader vs devil, and trying different options. However, devil's behavior in some of the situations perplexes me. I am not a novice in using more obscure tactics, but this is the first time I need to get a flying unit to step on a wall of fire. So, on the pic-1 we have the devil slowed, before it takes a turn. It has no reason going into the wall of fire - crusader will still reach it if it does, devil itself will still need extra 2 turns to get to the crusader if it does, AND the devil will still get damage - and normally AI tries to avoid standing in the wall of fire... except that's exactly what devil does on its turn on pic-2.
So, why does the devil do it? It has no benefit for AI, it doesn't get it in range to hit, it doesn't keep it out of crusader's range. I don't think knowing this will solve this battle for me, but it definitely would expand my knowledge on heroes 3 AI - which would be very welcome, as I found no information on it even in FizMig.

12 Upvotes

2 comments sorted by

8

u/doto_Kalloway 17h ago

So, the fact that he's slowed messes up with the ai.

I think what he's trying to do is to move closer to you so that you can't reach him next turn, but he can the following. But he always prefers straight horizontal lines. Combined with the fact that there are two terrain obstacles in front, he does prefer to hide behind (maybe does he account for the fact you might get morale).

Now why does he chose the firewalled tiles? I think that's because the game tells him to go X tiles west. He's slowed so he can't reach it due to obstacles, and so he just moves the max amount he can in this direction, ending up in the fw.

I might be totally wrong : I don't have any code knowledge to back this up.

5

u/Confident-Work-5532 17h ago

Problem is, the devil is still reachable by the crusader on that tile. I'd understand if the firewalled tile was out of reach for the crusader, but crusader can still reach the devil on that tile. Also, for what I know, slow doesn't affect the AI's behavior, it just considers itself a slower unit for the duration (and will have a higher priority of haste spell, if it knows it)