How the AI cycles through government types

Nanuk

Warlord
Joined
Jan 12, 2017
Messages
267
Location
USA
I've noticed that sometimes the AI, for whatever reason, will make some poor government type choices when better ones are available to it. I know many factors come into play, and I wonder if the AI will confuse itself due to too many factors, and make a short-sighted choice. In my mod, I'm creating some historical types of governments, that I want to be something the AI rarely (if ever) picks. For example, giving Germany the option to become the Third Reich. Typically this would be reserved for historical scenarios, or player options. However, I've seen the AI sometimes choose Feudalism instead of much better government choices, especially a much better "favored government" choice. I have yet to see how the AI reacts to shunned government types, other than rarely picking them. So I'm wondering if AI Germany will sometimes pick "Third Reich" instead of a better dictatorship-type throughout the game.

So other than economic and military factors, and marking "favored" and "shunned" types, are there ways to limit government selections or even make them obsolete? I remember even in the vanilla game, sometimes civs would choose despotism instead of another type that would've been better for its situation. Is it just AI madness or are certain civs programmed beyond just "favorite" and "shunned"? I assume the aggression level has some hidden modifiers to the vanilla government types? If so, how would this be influenced on the editor level with custom governments?

I guess my biggest concern is finding a way to balance governments to be as realistically chosen by the AI as possible. For example, Russia choosing "Soviet Union" and keeping it until it falls behind economically (though finding a way for them to not constantly cycle between "Soviet Union" and say, "Federation" is another thing altogether), and America choosing "United States" until too much civil disorder plagues it when it wants to go full-on empire. The player can always make these choices, but getting the AI to do it is another task.

One way I've found of trying to keep the AI making fresh government choices instead of getting stuck in a cycle of A for 20 turns then B for 20 turns then repeat, is making several similar government types. But this sometimes has the effect of the AI going "maybe this one" every five turns, which becomes annoying to watch and leads to the AI handicapping itself. Or it would do a series of nonsensical choices that made me rethink the entire system, for example China consistently re-establishing the "Qing Dynasty" even into modern times. It would be cool if it was rare, but it happened too often. I tried to fix this by making that particular government less attractive of a choice, but then the AI would rarely pick it. I find myself wishing the devs implemented an obsolescence function for government types so you never see a particular form of government again after a certain era/tech.
 
Last edited:
So other than economic and military factors, and marking "favored" and "shunned" types, are there ways to limit government selections or even make them obsolete?

The way to make a government type obsolete is by introducing a better one.

"favored" and "shunned" seems to matter little to nothing ragarding the government choice. What does matter is how much money is saved by the better government.

For the sake of simplicity let us just discuss C3C 1.22 for now. If the AI can choose between despotism, monarchy and fascism, then it would likely always choose fascism due to better free unit support. If it has to choose between despotism and monarchy it is less clear. Albeit i never witnessed an AI favoring despotism over monarchy even if despotism is favoured and monarchy shunned.

War weariness is well suited to drive AI out of a government with WW into a government type without it. During peace and with ample content and happy faces however AI is eager to be a republic or democracy due to the commerce bonus. If however the sitation is unclear, then military police of the government type without commerce bonus can be weighted stronger by AI.
 
"favored" and "shunned" seems to matter little to nothing ragarding the government choice.
That is because the "favoured/shunned" settings are not used for this purpose.

Rather, they affect between-Civ diplomatic interactions and AI-(to-human-)attitude.

Basically, if CivA (whether AI- or human-controlled) is using (AI-controlled) CivB's "favoured" government, then CivB will be slightly friendlier to CivA (or maybe we should say, "less overtly hostile"! :lol: ) than if CivA was using a "neutral" government-type -- and much friendlier than if CivA was using CivB's "shunned" government.
 
Was this always the case? The vanilla editor says that the AI will avoid changing to shunned government type as much as possible.
 
So the only way to ensure (or at least decrease the chances of) the AI choosing an "obsolete" government type is the classic one-upmanship route, then. Just slowly introduce slightly better forms of government types? *Sigh* I wish the AI wasn't so chaotic. It's going to be hard finding a good balance so to limit the AI playing hopscotch with the same governments, endlessly.
 
So the only way to ensure (or at least decrease the chances of) the AI choosing an "obsolete" government type is the classic one-upmanship route, then. Just slowly introduce slightly better forms of government types? *Sigh* I wish the AI wasn't so chaotic. It's going to be hard finding a good balance so to limit the AI playing hopscotch with the same governments, endlessly.

The best I can offer is embryodead's post HERE.

... And alexman's thought HERE, especially "Point 12" -

The AI uses Communism instead of Monarchy as a Wartime Government. Communism is far worse than Monarchy in most cases. The problem is the high communal corruption. Option 1: Increase the free unit support under Communism. Option 2: Add free building maintenance for Communism. Option 3: Increase worker speed for Communism. The trick here is to help the AI when it switches to Communism, without giving such a boost to this government type that it will become a viable option for the human player.
 
Last edited:
Top Bottom