How does the AI decide to declare war against you?

In nearly all of my games at king difficulty, all AIs (even Ghandi!) declare war against me at some point, even if they're technologically far behind me and have fewer cities.

Sometimes it is probably because I have a lot fewer units (even though they're usually more advanced than the AI's) and the AI decides that I'm a weak target. Settling near the AI also does seem to trigger war sometimes. But there seem to be quite some more factors that I don't understand yet.

Is there any hard information about the factors that cause the AI to declare war?


In late game, when you are superiour to any one of the competing civs they will feel that you're getting close to winning the game while at the same point realizing they're not going to win themselves. At that point, they will do anything to stop you from winning, even though that may mean the complete and utter destruction of their own empire. They're not actively ganging up against you, but this decision is made by each of your competitors individually. It seems that an AI player rather helps a competing AI to win the game at the cost of its own life than to allow a human player to win.

I don't have any numbers or other facts from within the engine to prove my thesis, but consider this:

  • The AIs will get very forgiving towards each other and will even settle long-running wars between each other in order to more effectively battle you
  • They will crawl across the whole map, leave their own cities dangerously low defended, engage in battles with ridiculously low chances of success, and sometimes declare war upon you without even having a marching route into your territory
  • In multiplayer matches The AIs will stay their armies until you are the last human player standing

If these aren't strong signs for an AI conspiration against humanity I don't know which are…


Civilization V is wonky in this regard. The game seems to keep track of the size/power of your army. If your nation is weaker militarily, the AI will often use this as an excuse to invade. Though the AI also seems reluctant to do so unless it can actually see your units. Furthermore, there is an unspecified variable that tracks your "relationship" with AI nations. Civ 4 listed all the modifiers making it easy to see your relationship with others. Civ V does not. Still, things like having a Pact of Cooperation improves the relationship, but having close borders with another nation will worsen the relationship. Their also seems to be universal penalties that will lower your relationship with all nations, like breaking your word.

Finally, enemy AIs seem to be opportunists. If somebody else goes to war against you, they are more likely to join in.


Mad Scientist, are you signing open borders treaties? They do not work like they did in Civ IV. Open Borders treaties are bad now, and they are primarily how an enemy empire captures that data Damon was referencing. Without open borders, enemies will be more hesitant (mind you, as you go up in difficulty enemies get less hesitant as a base rule) to attack.

It can be a good idea to periodically parade units at your borders. You do not want to allow the AIs unfettered border access, but you do want the AI to know that you are no lamb.