How does AI choose who to attack?

NickyH

Bismarck with lipstick…
Joined
Aug 23, 2007
Messages
354
Location
A Goody Hut in Sweden
When an AI player is at war with me and some other AI civs, I've sometimes noticed that they seem to prefer to attack AI units rather than my units, if they have the choice. Imagine I'm at war with Inca, and I'm allied with the Mongols and Russia against them. When it's Inca's turn, and they have booth my units and Mongol and Russian units within range, they often seem to go for the other AI players even though it doesn't seem to make sense strategically. For example, they may choose to attack a Mongol spearman two tiles away from an Inca city, although I have an archer next to the city. My archer is more of a threat and is easier to kill.

So what makes them choose when they have the option to attack enemy units of different opponents? Is it possible that they are programmed to attack the opponent which they perceive as the generally most powerful threat, rather than to choose the best target among particular units? That is: do they choose to attack that Mongol spearman because Mongols have a stronger military force than I do?

According to my perception, this often happens early in the game on emperor levels and above, when I'm not very powerful. When I have a strong military, they may act in a different way.

My reason for asking about this is that I haven't observed this behavior often enough to know for sure. But it's often important to be able to guess how your enemy will choose, if there's a war involving more than one AI.
 
I've noticed the AI seems to attack a combination of what's easier to kill, and what's closer. For example, rather than attacking a war chariot that will take their capital next turn if they don't kill it, they'll instead enslave two workers which are only going to be recaptured next turn anyway. The AI is completely incapable of strategic thinking.
 
Ai almost always goes and attacks undefended units(workers, settlers) or areas(towns, colonies). You can actually run AI around with a worker walking in circles.

Ai does not know what is danger and what is not, AI just hits weakest spot (undefended city).

Yet, I find game AI to be better than in many other games.
 
Above answers seem to contradict what NickyH was noticing. Why did the Inca target the Mongol spear instead of NickyH's archer?
I don't know the answer to that either, and have to say I usually see the AI go for the easiest target, like what Sharwood and Northen Wolf were noticing.
 
The nearest I can figure is that the unit doing the attacking was actually further away from the city NickyH was approaching than the spearmen being attacked. That's the only thing I can think of that would explain it.
 
Heretofore I've been operating under the assumption that AIs will look for the weakest unit within reach to attack. By weakest I refer to the calculated odds of AI attacking unit winning against the defending unit. To put it simply, an AI archer would attack an unfortified warrior on grass instead of similarly placed spear because it would have 2 vs 1.1 odds of winning instead of 2 vs 2.2 odds against the spear.

If AIs can snag a worker instead of attacking a warrior, they'll do that. If they have to choose between a warrior on grass and a spear on grass, they'll attack the warrior first. Similarly, they'll go after injured units before full-health ones. Which ones they prefer seems to be governed by the odds calculation. I think the BomberEscort's Combat Calculator can help prove/disprove this with some testing, but someone else should do it ;)
 
I have noticed that same thing happening in my wussy warlord games. I am standing at their gate and they run off to kill some other unit.

I have wondered if they are heading to take on Reg units instead of my vets? My AI foes seem to have a lot of Reg units around so that was my best guess. However it is very funny to watch them depart the city leaving me an easy kill. :rotfl:
 
Back
Top Bottom