Chance of non-historical AI chances

  • We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

sekelsenmat

Colonel
22 Badges
Aug 10, 2009
889
937
  • Europa Universalis IV: Rights of Man
  • Hearts of Iron IV: La Resistance
  • Hearts of Iron IV: Expansion Pass
  • Cities: Skylines Industries
  • Europa Universalis IV: Dharma
  • Europa Universalis IV: Rule Britannia
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Synthetic Dawn
  • Hearts of Iron IV: Death or Dishonor
  • Europa Universalis IV: Third Rome
  • Hearts of Iron IV: Together for Victory
  • Hearts of Iron IV: Cadet
  • Stellaris
  • Europa Universalis IV: Mare Nostrum
  • Europa Universalis IV: Cossacks
  • Cities: Skylines - After Dark
  • Europa Universalis IV: El Dorado
  • Cities: Skylines
  • Europa Universalis IV
  • Crusader Kings II
  • Europa Universalis IV: Art of War
  • Crusader Kings II: Sword of Islam
Before going through all files, I wonder if anyone knows the chances of majors going non historical with historical off?

I already learned that Germany almost never opposes Hitler ( like 1% or less due to 1 to 10 score). Similarly SOV never goes non-stalinist.

France seems a total wildcard, can go fascist or Communist.

Balkans devolves into regional factions and wars.

But what about USA? Any chance it won't join the allies and does something crazy or also less then 1% I haven't seen it deviate so far. What are your experiences with other majors?
 
  • 2
  • 1Like
Reactions:

Cpt.Cross

Colonel
53 Badges
Oct 19, 2019
960
3.273
  • Crusader Kings II
  • Europa Universalis IV: Rule Britannia
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Rights of Man
  • Cities: Skylines - Natural Disasters
  • Hearts of Iron IV: Together for Victory
  • Crusader Kings II: Monks and Mystics
  • Europa Universalis IV: Mandate of Heaven
  • Europa Universalis IV: Third Rome
  • Hearts of Iron IV: Death or Dishonor
  • Europa Universalis IV: Cradle of Civilization
  • Crusader Kings II: Jade Dragon
  • Hearts of Iron IV: Expansion Pass
  • Europa Universalis IV: Mare Nostrum
  • Cities: Skylines - Parklife
  • Europa Universalis IV: Dharma
  • Crusader Kings II: Holy Fury
  • Europa Universalis IV: Golden Century
  • Hearts of Iron IV: Expansion Pass
  • Hearts of Iron IV: La Resistance
  • Crusader Kings III
  • Battle for Bosporus
  • Europa Universalis 4: Emperor
  • Empire of Sin
  • Empire of Sin - Premium Edition
  • Victoria 3 Sign Up
  • Cities: Skylines - Snowfall
  • Hearts of Iron IV: No Step Back
  • Europa Universalis IV
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • Hearts of Iron IV: By Blood Alone
  • Europa Universalis IV: Res Publica
  • Supreme Ruler 2020
  • Cities: Skylines
  • Europa Universalis IV: El Dorado
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Cossacks
  • Crusader Kings II: Conclave
  • Hearts of Iron IV: Cadet
  • Cities: Skylines - After Dark
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
UK never goes communist. I mean it will pick the focuses but in such a lousy order that by 1941 it will still be democratic.

Germany doesnt pick alliance with the USSR or Danzig for slovakia.

Manchukuo is deliberately scripted to never take the focuses to annex Mengkukuo and 'The two Emperors' giving it cores on China. Which would be helpful in games where you beat China as japan and you could give the territory to Man.

Czechoslovakia doesn't go right or left properly because it wont get enough popular support.

Netherlands takes too long to cave to either side and will be conquered by AI Germany before it can do anything.

UK seems to Avoid picking the focus to boost the commonwealth country that you are playing as and in any cases will not boost the RAJ. (Maybe historical)

Those are just the ones off the top of my head.
 
  • 2Like
  • 2
  • 2
Reactions:

KubiG37

Colonel
42 Badges
Apr 11, 2016
984
1.752
  • Europa Universalis IV: Rule Britannia
  • Stellaris: Leviathans Story Pack
  • Europa Universalis IV
  • Europa Universalis IV: Mandate of Heaven
  • Hearts of Iron IV: Death or Dishonor
  • Europa Universalis IV: Cradle of Civilization
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Hearts of Iron IV: Together for Victory
  • Stellaris: Distant Stars
  • Prison Architect
  • Stellaris: Ancient Relics
  • Stellaris: Lithoids
  • Hearts of Iron IV: La Resistance
  • Stellaris: Federations
  • Battle for Bosporus
  • Stellaris: Nemesis
  • Europa Universalis IV: Rights of Man
  • Victoria 2
  • Europa Universalis IV: El Dorado
  • Europa Universalis IV: Common Sense
  • Europa Universalis IV: Cossacks
  • Europa Universalis IV: Mare Nostrum
  • Stellaris
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV: Colonel
  • Stellaris: Digital Anniversary Edition
  • Europa Universalis IV: Third Rome
  • Victoria 2: A House Divided
  • Europa Universalis IV: Res Publica
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Call to arms event
  • Stellaris: Megacorp
  • Victoria 2: Heart of Darkness
  • Stellaris: Synthetic Dawn
Some are actually set to follow a different path almost exclusively if you turn the historical focus off - like Japan will almost always avoid the Phillipines and not attack USA. Romania will almost always start trouble in the balkans. Poland will almost always form it's own faction with Romania and baltic states. It's not really random.

To clear one thing up: Those numbers in the AI_will_do don't work like random chance. So if one focus is 10 and the other 1, it ISN'T 1:10 chance. It is 0% chance for the lesser number.
The AI simply evaluates all the numbers from ALL focuses (including modifiers), and randomly picks from the top 2 or 3 at most. So if there's a lot of focuses and one of them has value of 1, chance is they won't ever pick it before they do everything else.
 
  • 1
Reactions:

Tsavong

First Lieutenant
59 Badges
Nov 24, 2010
288
375
  • Europa Universalis III: Chronicles
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • Hearts of Iron III
  • Hearts of Iron III: Their Finest Hour
  • Europa Universalis IV: Res Publica
  • Semper Fi
  • Victoria 2: A House Divided
  • Stellaris - Path to Destruction bundle
  • Cities: Skylines - After Dark
  • Stellaris: Distant Stars
  • Hearts of Iron IV: Death or Dishonor
  • Hearts of Iron IV: Expansion Pass
  • Europa Universalis IV: Rule Britannia
  • Stellaris: Apocalypse
  • Stellaris: Humanoids Species Pack
  • Hearts of Iron IV: Expansion Pass
  • Europa Universalis IV: Cradle of Civilization
  • Stellaris: Nemesis
  • Imperator: Rome - Magna Graecia
  • Europa Universalis IV: Dharma
  • Crusader Kings III: Royal Edition
  • Europa Universalis IV: Golden Century
  • Imperator: Rome
  • Crusader Kings III
  • Stellaris: Ancient Relics
  • Stellaris: Lithoids
  • Hearts of Iron IV: La Resistance
  • Stellaris: Federations
  • Crusader Kings II
  • Battle for Bosporus
  • Europa Universalis IV
  • Victoria 2
  • 500k Club
  • Stellaris: Necroids
  • Europa Universalis IV: El Dorado
  • Europa Universalis IV: Common Sense
  • Hearts of Iron IV: By Blood Alone
  • Europa Universalis 4: Emperor
  • Europa Universalis IV: Mare Nostrum
  • Hearts of Iron IV: No Step Back
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Hearts of Iron IV: Cadet
  • Europa Universalis IV: Rights of Man
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Hearts of Iron IV: Together for Victory
  • Cities: Skylines - Mass Transit
If you want that some really strange stuff happens you should set every country to random with custom-rules. Or just set the focus you would like for each country. Anyway the problem is still there that the focus trees dont interact well which each other and all evolves into a crazy multi-sided war mess. That than makes every country an easy target.
For example if you want to play democratic france and fight a complete fascist world , setting every country to fascit focus, those fascist will fight each other instead of allying against you. And dont forget those numerous civil wars that wreck them. Usa and GB are a non threat after there devastating civil war ...
hoi4 is a sandbox and a lot of the alternative foci are fun to do, but it fails to simulate some fun alternative war scenarios in world wide view.
 
  • 1
Reactions:

squid_hills

Second Lieutenant
32 Badges
Oct 1, 2019
179
359
  • Stellaris - Path to Destruction bundle
  • Hearts of Iron IV: Expansion Pass
  • Battle for Bosporus
  • Crusader Kings III
  • Hearts of Iron IV: La Resistance
  • BATTLETECH: Heavy Metal
  • BATTLETECH: Season pass
  • Stellaris: Ancient Relics
  • BATTLETECH: Flashpoint
  • Shadowrun: Hong Kong
  • Shadowrun: Dragonfall
  • Shadowrun Returns
  • BATTLETECH - Digital Deluxe Edition
  • Europa Universalis IV: Rule Britannia
  • Stellaris: Apocalypse
  • Stellaris: Humanoids Species Pack
  • Hearts of Iron IV: Death or Dishonor
  • BATTLETECH
  • Hearts of Iron IV: Together for Victory
  • Europa Universalis IV: Rights of Man
  • Hearts of Iron IV: Colonel
  • Hearts of Iron IV: Cadet
  • Stellaris
  • Europa Universalis IV: Common Sense
  • Europa Universalis IV: El Dorado
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Victoria 2
  • Europa Universalis IV: Art of War
  • Europa Universalis IV
  • Crusader Kings II
  • Hearts of Iron IV: Expansion Pass
The alt-path focuses are a bit janky, because how the AI implements them seems to be affected by what country you are playing as. For example, I did a "pacifist" Monarchist Germany run (get the Kaiser back and then only engage in defensive wars and make no territorial claims) and the UK AI never picked whether or not to do "Steady as She Goes" or "A Change in Course". Because I, as Germany, did not do either of the main Monarchist focus paths ("Focus on the True Enemy" or "Expatriate the Communists") the AI couldn't chose where to go on it's tree, because the AI is coded to respond to German player actions. France went communist (they usually do prior to 1.9 because of how the AI handles the early-game labor strikes) but the UK was paralyzed. They didn't even choose to Reinforce or Dismantle the Empire because I was ignoring 75% of my focus tree. On any other playthrough, the UK has decided which way to go on it's tree by the latter half of 1937 at the latest.

When the UK does go alt-history, I find it does a better job of it than it used to. I remember in 1.7 (I'm playing in 1.8 currently) the UK never once managed to go fascist without a civil war. Now I can't remember the last time I saw a British civil war. It still has issues going communist, where it will concede to the unions, decolonize by 1940, then hover at 45% communist support until 1948 and never seal the deal. I've seen them complete the communist focus path before, but it's still a rare occurrence. I think it may have something to do with whether or not the USSR is still in existence, because the two times I've seen it happen, the Russians were sitting pretty with nobody going to war with them. Most every other game, the UK stops adding communist political support to it's politics pie as soon as the USSR gets annexed.

As for other countries, I've only seen the US do any of it's alt-history paths when I have specifically told the AI to do them, or one time when they went communist on their own (though I think Trotsky was boosting communism there for a while). I've never seen the AI US do alt-history without being told to, or without having the player force the issue through political manipulation.

Hungary tends to do Rome Protocols (which is technically alt-history, even though it is still fascist) fairly often, especially if Germany goes monarchist. Second most popular is the restoration of Austria-Hungary. I've only seen them go down the communist path if I've made the AI do it, but I've never seen Hungary actually flip governments. The communist tree does not provide any actual communist political support, which means Hungary has to appoint a communist advisor to get any. The AI seems to be coded to never take the communist advisor, so the country never progresses past the first communist focus. Which is good, because the Hungarian communist branch is terrible and nobody should ever take it.

I usually run mods for Poland and Russia, but when achievement farming I've seen Russia go for Trotsky all of once. Poland will try to form it's own faction if Germany takes long enough on it's tree to get around to making territorial demands. Sometimes it will even go fascist, though I've seen it go communist once (and then get eaten by Germany immediately after, so no real change to the gameplay experience there).

France's actions are dependent on the UK, mostly. If the UK does "A Change in Course", France goes for "Little Entente" around 90% of the time. Even if they don't, Czechoslovakia usually does, and I've only seen France refuse to join the faction once (and then get eaten by Germany immediately after, so no real change to the gameplay experience there, either). France, even if it selects democratic options from its tree, can wind up communist because of how it handles the various strikes. It's not surprising to me to see France join the Allies in 1939 and be the French Commune by 1942. I don't have the new tree in LaR, so I can't speak to how often it may or may not go Monarchist.

I've never seen Czechoslovakia effectively switch governments. I've seen it try a few times, but considering how difficult it is to change ideologies as a Czech player, the AI has no hope of flipping before Germany eats it. The only time I've seen fascist Czechoslovakia is when fascist Poland puppetted them.

Italy, surprisingly enough, goes fascist no matter what happens. I wonder why that is. You never see them go democratic or communist. Can't figure out why, for the life of me...

Romania is such a wild card I can't predict them. If you aren't playing Germany (and thus can't ensure their politics through the "Align Romania" focus) Romania will tend to start neutral, go Monarchist, and then has an even chance of ending up as a democracy, a fascist dictatorship, or staying monarchist. I've only seen them go communist after the USSR puppetted them.

Japan seems to go Monarchist fairly often. I'm not sure of the exact % chances for the various branches of it's tree (I'm not code-literate enough to figure it out) but it feels like 40% fascist, 40% monarchist, 10% communist, 10% democracy, with a strong weight on fascist if you are playing China or Manchukuo.

The Commonwealth nations seem to be dependent on the UK as well. If the UK goes historical, they tend to do the same. India sometimes throws a wrench into it by trying to break free via civil war, but generally everybody plays ball if the UK stays the course. If the Dominions break with the UK, Canada often changes ideology (fascist seems more common for them than communist, probably because the Devs like that memey picture of fascist Canada's leader) but if the UK decolonizes, Canada tends to stay a democracy (as the new leader of the Allies its kind of expected). I've never seen India succeed in an independence war, though. They try to break away, but they time it terribly and end up having to fight the whole of the Allies, instead of just the Raj (WT monitoring as India is super important if you want to break away and the AI is bad at it) and so they end up getting stepped on pretty hard.

Yugoslavia tends to follow the historical path more or less. I rarely see them go communist on their own initiative, and their fascist branch and their historical branch have so much overlap that unless their political pie turns yellow, it's hard to tell if they've gone alt-history or not.

China determines it's actions based on what Japan does, if it knows what's good for it. If it sees Japan go monarchist (or any not-fascist path) it tends to get the knives out and go after Comm China and the warlords. Usually at the same time. The only times China switches ideology is, again, when someone turns them into a puppet. China doesn't have much of an alt-history path to begin with... its basically "make friends and punch Japan" or "ignore Japan and punch everyone else". I've seen China pick the "punch everyone else" path while Japan went fascist once or twice. Predictably, it results in Japan owning everything. Usually, though, the AI is smart enough to tie it's actions to Japan's decision to stay fascist or not.

Did I miss anyone?

Also: playing in 1.8 with no LaR, so YMMV.
 

bitmode

1st Reverse Engineer Battalion
Nov 10, 2016
3.824
7.024
To clear one thing up: Those numbers in the AI_will_do don't work like random chance. So if one focus is 10 and the other 1, it ISN'T 1:10 chance. It is 0% chance for the lesser number.
The AI simply evaluates all the numbers from ALL focuses (including modifiers), and randomly picks from the top 2 or 3 at most. So if there's a lot of focuses and one of them has value of 1, chance is they won't ever pick it before they do everything else.
That's not how it works, but very close for some countries like Germany. Some people have seen weight 1 focuses picked first (1, 2) as well as Oppose Hitler. It just happens so rarely that it is almost a zero probability. Here's an older post where I reverse engineered the selection and one where I applied it to AI Japan's starting situation, as well as a graph illustrating how much Japan differs from Germany with regards to ahistorical choices.

What are your experiences with other majors?
Some of the probabilities are so low that you can't rely on anecdotal evidence anymore. For example with a roughly 1-in-500 chance for Oppose Hitler, very few people will have played enough non-modded, non-historical games to get a statistical estimate.

UK seems to Avoid picking the focus to boost the commonwealth country that you are playing as and in any cases will not boost the RAJ.
Those focuses are all equally likely (ai_will_do 1) and not influenced by human players.
 
  • 3
Reactions:

sekelsenmat

Colonel
22 Badges
Aug 10, 2009
889
937
  • Europa Universalis IV: Rights of Man
  • Hearts of Iron IV: La Resistance
  • Hearts of Iron IV: Expansion Pass
  • Cities: Skylines Industries
  • Europa Universalis IV: Dharma
  • Europa Universalis IV: Rule Britannia
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Synthetic Dawn
  • Hearts of Iron IV: Death or Dishonor
  • Europa Universalis IV: Third Rome
  • Hearts of Iron IV: Together for Victory
  • Hearts of Iron IV: Cadet
  • Stellaris
  • Europa Universalis IV: Mare Nostrum
  • Europa Universalis IV: Cossacks
  • Cities: Skylines - After Dark
  • Europa Universalis IV: El Dorado
  • Cities: Skylines
  • Europa Universalis IV
  • Crusader Kings II
  • Europa Universalis IV: Art of War
  • Crusader Kings II: Sword of Islam
That's not how it works, but very close for some countries like Germany. Some people have seen weight 1 focuses picked first (1, 2) as well as Oppose Hitler. It just happens so rarely that it is almost a zero probability. Here's an older post where I reverse engineered the selection and one where I applied it to AI Japan's starting situation, as well as a graph illustrating how much Japan differs from Germany with regards to ahistorical choices.

Thanks bitmode, outstanding as always!

Sad that in the "ahistorical" we'll virtually never see Germany, USA or Soviets going ahistorical ... I was looking forward for some dramatic changes during achievement runs in ahistorical. And all just because someone stupid complained loudly...

When the UK does go alt-history, I find it does a better job of it than it used to. I remember in 1.7 (I'm playing in 1.8 currently) the UK never once managed to go fascist without a civil war. Now I can't remember the last time I saw a British civil war. It still has issues going communist, where it will concede to the unions, decolonize by 1940, then hover at 45% communist support until 1948 and never seal the deal. I've seen them complete the communist focus path before, but it's still a rare occurrence. I think it may have something to do with whether or not the USSR is still in existence, because the two times I've seen it happen, the Russians were sitting pretty with nobody going to war with them. Most every other game, the UK stops adding communist political support to it's politics pie as soon as the USSR gets annexed.

Just like bitmode said, in the files there is no such thing. "Stead as she goes" disappear as an option for AI if something wierd happens with the king events for the UK, I guess that's what happened. I think this is probably random and unrelated to Germany. "A change in course" is always available at factor=1 so that it didn't happen was just luck.

file common/national_focus/uk.txt:


### DEMOCRATIC BRANCH - STEADY AS SHE GOES ###

focus = {
id = ENG_steady_as_she_goes
.....
available = {
if = {
limit = {
NOT = { has_country_flag = ENG_abdication_crisis_changed_mind }
}
NOT = { has_country_flag = edward_viii_refused_to_abdicate_flag }
}
}

ai_will_do = {
factor = 1
modifier = {
factor = 0
OR = {
has_country_flag = ENG_abdication_crisis_normal_marriage
has_country_flag = ENG_abdication_crisis_morganatic_marriage
}
}
}



### A CHANGE IN COURSE BRANCH ###

focus = {
id = ENG_a_change_in_course
mutually_exclusive = { focus = ENG_steady_as_she_goes }
....
available = {

}

ai_will_do = {
factor = 1
}
 
  • 1
Reactions:

kettyo

General
11 Badges
Feb 11, 2017
2.429
1.260
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV: Colonel
  • Hearts of Iron IV: Expansion Pass
  • Hearts of Iron IV: Death or Dishonor
  • Hearts of Iron IV: Expansion Pass
  • Hearts of Iron IV: Expansion Pass
  • Hearts of Iron IV: Expansion Pass
  • Hearts of Iron IV: La Resistance
  • Battle for Bosporus
  • Hearts of Iron IV: By Blood Alone
  • Hearts of Iron IV: No Step Back
@sekelsenmat Adjusting the probability of Germany's hitlerist and ahistorical paths is very easy as it's simply a choice between two focuses. Germany might be forced to choose only between these two at some point so the other focuses won't mess the probabilities up.

Adjusting USA is very difficult though as going communist or fascist is quite complicated there. Might need to investigate the AI strategy plans how they are forced to do it.

It's also strange that UK has a flat chance for any political options and just a few sanity checks. I have adjusted that a bit at my side. Steady as she goes now has a 3:2 chance vs a change in course and home defense has a 2:1 vs global defense. Moreover i have set the empire/decolonization choice to come after the main political choice and have set global defense, king's party, and organize the blackshirts to always do empire, concessions to the trade unions to always do decolonization, and home defense to do empire in a 3:1 chance vs decolonization.

Edit: I've done the calcs and it looks like the USA will go gold standard in a default non-historical game once in about 350 games and adjusting that isn't really possible in any elegant way with minor changes or without harming the USA in the process. It comes from gold standard only possible with Landon and mutually exclusive with new deal while these main political focuses have a much higher weight for the AI to choose than others (also new deal path is much more beneficial). So adjusting USA to sometimes go fascist in a simple way is not possible. It would be much easier to do this with the communist path though.
 
Last edited:
  • 1Like
Reactions: