Why AI adopts new civics?

FriscoDanconia

Chieftain
Joined
Feb 11, 2006
Messages
44
I understand that each leader has a favorite civic, as defined in CIV4LeaderHeadInfos.xml. And I also realize that through diplomatic deals, UN votes, and Apostolic Palace votes, an AI can be forced to change civics.

But beyond that, why will they revolt to adopt a new civic?

Do they stay with their initial civics until one of the abovementioned conditions happens? Do they revolt somehow randomly? Do they just adopt the cheapest available to them?

Unlike buildings or units I don’t see any flavor for civics that may, for instance, lead an Aggressive leader to adopt the Police State.

I have searched the forum but have found nothing about this.
 
Nothing?
 
I understand that each leader has a favorite civic, as defined in CIV4LeaderHeadInfos.xml. And I also realize that through diplomatic deals, UN votes, and Apostolic Palace votes, an AI can be forced to change civics.

But beyond that, why will they revolt to adopt a new civic?

Do they stay with their initial civics until one of the abovementioned conditions happens? Do they revolt somehow randomly? Do they just adopt the cheapest available to them?

Unlike buildings or units I don’t see any flavor for civics that may, for instance, lead an Aggressive leader to adopt the Police State.

I have searched the forum but have found nothing about this.


I think a well-formed response to this would require one to look up the actual .xml files for the AI to see how it's programmed. I'm afraid that AI civic selection is still somewhat of a nebulous phenomenon. There are some clear trends though, like how AIs will go for Emancipation quicker than most human players, even though Caste System may actually be the "technically" better civ.

IMHO the AI definitely underuses Police State, State Property, and Nationhood, and overuses Environmentalism and Universal Suffrage (why do Uni. Suffrage if you don't build that many cottages??). These can all be powerful civics when used correctly, but expecting this level of play from the computer is hopeless.
 
xml has close to nothing to do w/ the civics.
to OP if you are interested in SOME particular civic, I will explain.
Otherwise if you need to know 'everything' you'd be better off w/ some C knowledge and just examining the code yourself.
 
There are calculations in the AI routines where it tries to assign values to the various options (modified by its current plans - upcoming war, closeness of culture victory, etc). It tries (not always successfully) to figure out what would be of the greatest value to it.

Much of the oddness can be atributed to the AI weighting things in a manner inconsistent with what a real player would do.

As a specific example, like qnl mentioned Emancipation is highly valued by the AI. Why? It places a relatively high value on the happiness effects - both the penalty applied to others and the defense against that effect on themselves.

What it does is it runs through all available civics and add up all the factors for that civic. Then, that number is modified based on if Anarchy would be required to chose that civic. Whatever ends up highest is what it goes with.

If you really want to know how it weights things, in CvPlayerAI.cpp, look at the function AI_CivicValue
 
Thank you very much, I'll that that file.
 
I think a well-formed response to this would require one to look up the actual .xml files for the AI to see how it's programmed. I'm afraid that AI civic selection is still somewhat of a nebulous phenomenon. There are some clear trends though, like how AIs will go for Emancipation quicker than most human players, even though Caste System may actually be the "technically" better civ.

I wouldn't be shocked if the AIs are specifically coded to go for Eman as soon as they get it, not because it's the best civic available, but to force happiness pressure on the player to get the player *out* of preferred civics.
 
^ They are not, however there is certain anti-human bias. That has been discussed already.
 
One thing I do find curious is the timing of AI civic changes. My current game as Sury, I launch a full blown assault on my good neighbor Catherine. This is serious life and death time for her (pretty much all death, actually), but she spends a good chunk of the war in anarchy switching out civics. :confused:

Pretty poor timing that.
 
I've played a few future starts recently. In terms of civics, these differ from ancients starts in the full range are available from the first turn (also, of course, they're of different utility; environmentalism and serfdom are much more attractive than they tend to be on ancient starts). With access to the full range of civics, the AI behave in a strange way: they all make their first civics switch on the same turn (and if I recall correctly, it's not the first turn). Thereafter, most/all non-spiritual AIs will make subsequent civics switches on the same turns, while spiritual civs will make their second switch one turn sooner, their third two turns sooner and so on, since they don't spend a turn in anarchy.

As best I can tell from this behaviour, the AI are programmed only to think about civics at certain intervals, and they only start that cycle once they have access to at least one non-top row civic. In ordinary games, they won't all be switching at the same time because they'll all have gained access to new civics at different times, since they have to be researched.
 
Well, for one, good luck getting a civ to switch out of its "favorite" civic... short of a UN vote, I'm pretty sure some civs stick with their fav civic the entire game after it is discovered, whether beneficial or not. Some even go as far as to defy UN civic resolutions, which I personally find hilarious in some cases.

Second, civs will oft change to wartime civics when they are either plotting a war or just had war declared on them. When I see "Monty has adopted Slavery" and "...Vassalage", I beef up my defenses on the border closest to him and keep an eye out for his scouts, because i know he is preparing for war. Other times, you sill see "X has declared war on Y!", followed promptly by "Y has adopted <insert wartimey civic>".

Lastly, I know they favor later civics as well. Emancipation is very annoying I agree but the AI loves it because it negates their own unhappiness caused by the other civs that have switched into it. At least its low upkeep :p
 
I've seen too often the AI build the Pyramids and immediately switch into US. Somewhere along the line of calculations something went wrong.
 
I've played a few future starts recently. In terms of civics, these differ from ancients starts in the full range are available from the first turn (also, of course, they're of different utility; environmentalism and serfdom are much more attractive than they tend to be on ancient starts). With access to the full range of civics, the AI behave in a strange way: they all make their first civics switch on the same turn (and if I recall correctly, it's not the first turn). Thereafter, most/all non-spiritual AIs will make subsequent civics switches on the same turns, while spiritual civs will make their second switch one turn sooner, their third two turns sooner and so on, since they don't spend a turn in anarchy.

As best I can tell from this behaviour, the AI are programmed only to think about civics at certain intervals, and they only start that cycle once they have access to at least one non-top row civic. In ordinary games, they won't all be switching at the same time because they'll all have gained access to new civics at different times, since they have to be researched.
The AI is coded to check if it is a good idea to change civics every turn. The fact that the Ai has all the civics open might actually have a effect though: all the civics are very similar in average value when you have low pop and little improved land , and given the fact that there is some RNG involved in the decisions, it is not unlikely to see the AI thinking everytime that is a good idea to change civics in that situation. Add the 5 turn period where you can't change civics after a previous change and you get the behaviour you are describing.
 
Second, civs will oft change to wartime civics when they are either plotting a war or just had war declared on them. When I see "Monty has adopted Slavery" and "...Vassalage", I beef up my defenses on the border closest to him and keep an eye out for his scouts, because i know he is preparing for war. Other times, you sill see "X has declared war on Y!", followed promptly by "Y has adopted <insert wartimey civic>".

Yep, I see this all the time, which made the following sequence extremely puzzling. Catherine declared on someone. Then she changed her civics and adopted... Pacifism.

Quality choice for a wartime civic, Cathy.

-Sinc
 
Top Bottom