AI Personality Essentials: Predicting Leader Behavior

Joined
Sep 4, 2008
Messages
619
Location
Seattle
***Work in progress***

Purpose of this guide:

As I have moved up in difficulty from Noble to Emperor, one of the most valuable things I have learned is how to predict the AI leaders' behavior. Knowing the personality of the various leaders gives you valuable insight into what they are likely to do, and how you should deal with them. THIS IS NOT A DIPLOMACY GUIDE. If you need information about how to improve diplomatic relations with the AI or how to win diplomatic victories, there are already excellent guides on those subjects. That being said, the game's diplomacy mechanics play an important role in certain aspects of AI leader behavior - especially their decisions about war - so to get the most out of the information in this guide a firm grasp of the diplomacy mechanics is essential.

Source of information:

The AI has many factors influencing their behavior and decision making, most of which are defined by an XML file called CIV4LeaderHeadInfos. Without a background in software development, XML files can be difficult to read even though they are technically considered a "human readable" information storage format. Even with knowledge of XML and how to read it, you can only glean useful information from this particular file if you know what certain elements mean in game terms, and it is not always clear from the name of the element. I've seen worse XML files in my career, but they can be much better. I often say, "Firaxis makes great games, but terrible software." I should not criticize them too harshly, though. There are much easier ways of storing and retrieving this sort of information than an XML file, and the fact that they used XML files for so much of this stuff is why the game has so many great mods!

The information presented about leaders in this guide is affected by 2 custom game settings. "Aggressive AI" modifies the AI's behavior but in a predictable way, so the information in this guide is still useful, though you will have to extrapolate from it. "Random Leader Personalities" causes the game to ignore the information that defines leader personality in this file, and build their personalities from scratch. This guide is useless if you select that game option. In fact, once you have learned to incorporate the information in this guide into your gameplay, "random personalities" will become one of the most challenging game settings you can select. The rest of the guide is written with the assumption you have not selected either of these game options.

Cry "havoc," and let slip the dogs of war:

The AI action that most profoundly affects the game is the decision to declare war on a rival, especially if that rival is a human player. Every turn after about 2000 BC (for an ancient era start) each AI leader evaluates his or her situation on considers a various factors to determine whether it would like to go to war with one of it's rivals. The likelihood that the AI will decide to go to war is most strongly influenced by their XML defined aggressiveness level. Even inexperienced players quickly learn that they should fear a declaration of war from Montezuma or Shaka, and know that Gandhi and Mansa Musa are pushovers. Most leaders fall somewhere between these extremes, however, and these nuances are harder to grasp without considerable experience or knowledge of the contents of the game files.

When deciding with whom to go to war, factors considered by the AI are whether the target is a neighbor or some distance away, whether they are on the same landmass, the potential victim's currently military power level relative to their own, any currently existing conflicts or defensive pacts and - perhaps most importantly - their current diplomatic relationship with the potential victim. For almost half of leaders in the game, if they are currently pleased or friendly with a rival they will not plan a war against them under any circumstances. No leader will plot a war against a leader they are friendly with. That is not to say they cannot declare war on someone they are pleased or friendly with; they can still be forced into war by the obligations of a defensive pact, permanent alliance, master/vassal relationship or a resolution passed by the Apostolic Palace or United Nations. They might also accede to a request or demand from another leader to declare war on a rival with whom they are pleased, though most leaders will automatically refuse such requests if they were not already willing to go to war with that rival - with a few notable exceptions. If they decide to go to war, they go into "War Preparation Mode" for several turns before actually declaring war. If diplomatic conditions change after they have decided to go to war but before they have declared, it will not change their mind. In this way a friendly leader might declare on you; they started planing the war while they were still only pleased with you.

Knowing which leaders are willing to plot against you even at pleased is probably the most important information about AI behavior in this guide. With reasonable diplomatic skills it is fairly easy to get an AI leader to the pleased level of relation and keep them there, so if a leader is not on this list, that is usually the easiest way to guarantee your safety from them. Here it is, the Untrustworthy 27 in ascending order of (extremely generalized) threat level:

Untrustworthy cowards:
Mansa Musa <- No threat at all
Roosevelt <- "A date which will live in infamy!"
Elizabeth
Qin Shi Huang
Pacal II <- Usually too busy building wonders

Threatening:
Mao Zedong
Victoria
Isabella <- Her extreme religious tenancies complicate things
Zara Yaqob <- Also very religious
Bismarck
Louis XIV

Dangerous:
Huayna Capac <- his wonder spamming distracts him from building military
Kublai Khan
Catherine <- Only leader that can be bribed to declare war at friendly
Willem van Oranje <- aggressive, but not very military minded
Gilgamesh
Suryavarman II
Stalin
Peter
Tokugawa
Julius Caesar
Napoleon <- unit spammer

Sociopathic:
Genghis Khan
Ragnar <- unit spammer
Shaka <- unit spammer
Montezuma <- ornery SOB
Alexander <- technically more likely to declare than Monty, but easier to deal with diplomatically

The leaders are sorted by aggression level, then by the degree to which they consider diplomacy in war planning and finally by the amount of units they tend to build. Also, don't assume anyone not on this list is not dangerous; some of the other leaders are quite aggressive but they cannot plan a war against someone with whom they are pleased, so the threat from those leaders can be completely neutralized with diplomacy if you play your cards right.

***Still to come***

The portions of this guide that appear in green are areas I would like to expand upon. If you have useful information about these subjects, please let me know so I can incorporate it into the guide.

A list of all leaders with their XML defined tenancies explained or translated into 1-5 star ratings.

Detailed explanation of AI trading behavior.

Leaders with notably extreme tenancies in certain areas and tips on how to deal with them.

General guide to formulating an "AI Behavior Control and Prediction Plan."
 
You must be reading my mind, this is exactly what I needed.

Offtopic: In Soviet Russia back stabs YOU!! (oh wait-) :D
 
Good job :)

When it comes to "declare war on infidels", if I recall, there's an option "never". What are the chances AI would refuse to declare on human this way? What dot they depend on? Anybody knows?
 
interesting guide so far

Some mistakes I found:
"Every turn after about 2000 AD (for an ancient era start)"
Thats gotta be 2000 BC right :D

Some notes:
I thought that an AI first decides to go to war
and then with who based on distance, diplo etc.
 
You must be reading my mind, this is exactly what I needed.

LOL me too :crazyeye:

In my current game as Roosevelt of the Americans(large fractal monarch epic) we shared a peanut-shaped continent with Ragnar, Stalin and me on one side and Pacal on the other. Pacal founded Judaism and converted us so relations were initially good, but I didn't trust Ragnar nor Stalin who were aggressive to begin with; suspicions which were confirmed by this thread. Thankfully I had ax-rushed them so now we and Pacal have equal halves of the continent and still have friendly relations even though I declared war on his "friends."

I had originally planned to kill him right after finishing with Stalin; I don't yet know if he has some useful wonders but I sure want that Jewish shrine :drool: however after all those wars my economy isn't doing very well especially compared with Pacal's who's financial and is a bit higher on the power rankings, was near feudalism, and had built Chichen Itza. Looks like I'm going to have to wait until gunpowder while developing my economy and teching capability and hoping Pacal doesn't DoW on me first - that's when I thought of this thread's topic. Thanks, Izmir Stinger! :worship:

btw I've had Quin Shi Huang declare on me at Pleased during late game when we were all shooting for space race victory
 
Nice work! :)

I always struggle with the XML... I don't really get what half the things mean anyway so it's good to see the information put down in a format that even I can understand.

Looking forward to the rest of the article.

Cheers.
 
Some mistakes I found:
"Every turn after about 2000 AD (for an ancient era start)"
Thats gotta be 2000 BC right :D

Nice catch. Not sure about the accuracy of that date anyway. I'm researching AI war decision making.

I thought that an AI first decides to go to war
and then with who based on distance, diplo etc.

The "on whom to declare war" part is something I'm researching in more depth, and will include more details in the final guide.

btw I've had Quin Shi Huang declare on me at Pleased during late game when we were all shooting for space race victory

He is not very aggressive, but all AIs get more aggressive if you are approaching a victory condition. More on that in the final guide.

Nice work! :)

I always struggle with the XML... I don't really get what half the things mean anyway so it's good to see the information put down in a format that even I can understand.

Looking forward to the rest of the article.

Thanks :goodjob:
 
Nice guide Izmir Stinger, 2 leaders you forgot to put in the untrustworthy cowards section: Ghandi and Sitting Bull, both should be at the top of the list. Also where's Asoka, Justinian, de gualle, the other americans? Quite a few names missing here...

Also i think you really need to emphasize the it depends factor here. In a recent game I saw Ghandi DOW monty in the BC's
 
Nice guide Izmir Stinger, 2 leaders you forgot to put in the untrustworthy cowards section: Ghandi and Sitting Bull, both should be at the top of the list. Also where's Asoka, Justinian, de gualle, the other americans? Quite a few names missing here...

Also i think you really need to emphasize the it depends factor here. In a recent game I saw Ghandi DOW monty in the BC's

None of the leaders you mention can plot war against a rival with whom they are pleased. Being able to do so is the defining characteristic of the leaders on the list.
 
The AI capital must be able to build >= 2 attack units(that's units better than archers). I recommend reading this post by DanF on war decisions.

So they can do it as soon as they hook up copper to their capital and research hunting (or do spearman count as an attack unit)? It can certainly be much sooner than 2000 BC on high difficulty levels, then.

I am aware of that thread and am distilling it for information relevant to this topic. Thank you.
 
None of the leaders you mention can plot war against a rival with whom they are pleased. Being able to do so is the defining characteristic of the leaders on the list.
Recommend a section that discusses the won't-declare-at-pleased-leaders. It can take a while to get them to pleased and/or you may need to decide who to please and who to have as an enemy.
(esp.) Which are dangerous? Which are military pushovers?
(also) Nuances like Mansa Musa can be a great trading partner (so, keep him around) but can get a tech lead and be a threat to win (so, conquer him; asap or by xxx). If you vassalize Gandhi, he might get a cultural victory. etc

Great project, wonderful idea, thanks.
 
I was wondering if you could also do the stats on how capitulation changes from civ to civ. I did a conquest game a couple days back and noticed that some civs will capitulate if you just destroy their SoD and take a city. Does taking their capital factor into the equation?
 
Suggest a section on the religious zealots.

Also suggest a look at fave civics, grouping AIs into those that are easy to please (like a good early civic), hard to please (like a civic thats not so good, or comes a little late) or impossible to please (likes a useless civic thats only available late and he won't be in it anyway)....

One of these sections will need more work than the other :D :D
 
Well... the tread starter has run out of steam... That's sad. It was a very useful and interesting beginning...

Agreed. Izmir, it's very helpful now. I do hope this doesn't completely run out of steam. It's very useful for those of us who don't read XML. Thanks very much, this is just the list I needed. Who declares at pleased and who doesn't.
 
***Work in progress***

Purpose of this guide:

As I have moved up in difficulty from Noble to Emperor, one of the most valuable things I have learned is how to predict the AI leaders' behavior. Knowing the personality of the various leaders gives you valuable insight into what they are likely to do, and how you should deal with them. THIS IS NOT A DIPLOMACY GUIDE. If you need information about how to improve diplomatic relations with the AI or how to win diplomatic victories, there are already excellent guides on those subjects. That being said, the game's diplomacy mechanics play an important role in certain aspects of AI leader behavior - especially their decisions about war - so to get the most out of the information in this guide a firm grasp of the diplomacy mechanics is essential.

Source of information:

The AI has many factors influencing their behavior and decision making, most of which are defined by an XML file called CIV4LeaderHeadInfos. Without a background in software development, XML files can be difficult to read even though they are technically considered a "human readable" information storage format. Even with knowledge of XML and how to read it, you can only glean useful information from this particular file if you know what certain elements mean in game terms, and it is not always clear from the name of the element. I've seen worse XML files in my career, but they can be much better. I often say, "Firaxis makes great games, but terrible software." I should not criticize them too harshly, though. There are much easier ways of storing and retrieving this sort of information than an XML file, and the fact that they used XML files for so much of this stuff is why the game has so many great mods!

The information presented about leaders in this guide is affected by 2 custom game settings. "Aggressive AI" modifies the AI's behavior but in a predictable way, so the information in this guide is still useful, though you will have to extrapolate from it. "Random Leader Personalities" causes the game to ignore the information that defines leader personality in this file, and build their personalities from scratch. This guide is useless if you select that game option. In fact, once you have learned to incorporate the information in this guide into your gameplay, "random personalities" will become one of the most challenging game settings you can select. The rest of the guide is written with the assumption you have not selected either of these game options.

Cry "havoc," and let slip the dogs of war:

The AI action that most profoundly affects the game is the decision to declare war on a rival, especially if that rival is a human player. Every turn after about 2000 BC (for an ancient era start) each AI leader evaluates his or her situation on considers a various factors to determine whether it would like to go to war with one of it's rivals. The likelihood that the AI will decide to go to war is most strongly influenced by their XML defined aggressiveness level. Even inexperienced players quickly learn that they should fear a declaration of war from Montezuma or Shaka, and know that Gandhi and Mansa Musa are pushovers. Most leaders fall somewhere between these extremes, however, and these nuances are harder to grasp without considerable experience or knowledge of the contents of the game files.

When deciding with whom to go to war, factors considered by the AI are whether the target is a neighbor or some distance away, whether they are on the same landmass, the potential victim's currently military power level relative to their own, any currently existing conflicts or defensive pacts and - perhaps most importantly - their current diplomatic relationship with the potential victim. For almost half of leaders in the game, if they are currently pleased or friendly with a rival they will not plan a war against them under any circumstances. No leader will plot a war against a leader they are friendly with. That is not to say they cannot declare war on someone they are pleased or friendly with; they can still be forced into war by the obligations of a defensive pact, permanent alliance, master/vassal relationship or a resolution passed by the Apostolic Palace or United Nations. They might also accede to a request or demand from another leader to declare war on a rival with whom they are pleased, though most leaders will automatically refuse such requests if they were not already willing to go to war with that rival - with a few notable exceptions. If they decide to go to war, they go into "War Preparation Mode" for several turns before actually declaring war. If diplomatic conditions change after they have decided to go to war but before they have declared, it will not change their mind. In this way a friendly leader might declare on you; they started planing the war while they were still only pleased with you.

Knowing which leaders are willing to plot against you even at pleased is probably the most important information about AI behavior in this guide. With reasonable diplomatic skills it is fairly easy to get an AI leader to the pleased level of relation and keep them there, so if a leader is not on this list, that is usually the easiest way to guarantee your safety from them. Here it is, the Untrustworthy 27 in ascending order of (extremely generalized) threat level:

Untrustworthy cowards:
Mansa Musa <- No threat at all
Roosevelt <- "A date which will live in infamy!"
Elizabeth
Qin Shi Huang
Pacal II <- Usually too busy building wonders

Threatening:
Mao Zedong
Victoria
Isabella <- Her extreme religious tenancies complicate things
Zara Yaqob <- Also very religious
Bismarck
Louis XIV

Dangerous:
Huayna Capac <- his wonder spamming distracts him from building military
Kublai Khan
Catherine <- Only leader that can be bribed to declare war at friendly
Willem van Oranje <- aggressive, but not very military minded
Gilgamesh
Suryavarman II
Stalin
Peter
Tokugawa
Julius Caesar
Napoleon <- unit spammer

Sociopathic:
Genghis Khan
Ragnar <- unit spammer
Shaka <- unit spammer
Montezuma <- ornery SOB
Alexander <- technically more likely to declare than Monty, but easier to deal with diplomatically

The leaders are sorted by aggression level, then by the degree to which they consider diplomacy in war planning and finally by the amount of units they tend to build. Also, don't assume anyone not on this list is not dangerous; some of the other leaders are quite aggressive but they cannot plan a war against someone with whom they are pleased, so the threat from those leaders can be completely neutralized with diplomacy if you play your cards right.

***Still to come***

The portions of this guide that appear in green are areas I would like to expand upon. If you have useful information about these subjects, please let me know so I can incorporate it into the guide.

A list of all leaders with their XML defined tenancies explained or translated into 1-5 star ratings.

Detailed explanation of AI trading behavior.

Leaders with notably extreme tenancies in certain areas and tips on how to deal with them.

General guide to formulating an "AI Behavior Control and Prediction Plan."

To be honest, Shaka, Ragnar and Monty are always like, epic to me. I rarely get wars (I guess Ragnar does hold a few, but I'm just playing RFC a lot).

But, for some odd reason, Qin Shi Huang is a bloodthirsty guy, even more so than Genghis Khan. Luckily I always cheat and make him go to peace... I don't really appreciate the sudden war at the Pleased stage.
 
Top Bottom