• 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.

Verdiss

Private
66 Badges
May 24, 2016
13
1
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Jade Dragon
  • Stellaris: Synthetic Dawn
  • Europa Universalis IV: Third Rome
  • Stellaris - Path to Destruction bundle
  • Europa Universalis IV: Mare Nostrum
  • Europa Universalis IV: Pre-order
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Europa Universalis IV: Res Publica
  • Europa Universalis IV: Wealth of Nations
  • Crusader Kings II: The Old Gods
  • Crusader Kings II
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Rajas of India
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Mandate of Heaven
  • Stellaris: Leviathans Story Pack
  • Crusader Kings II: Monks and Mystics
  • Hearts of Iron IV: Together for Victory
  • Hearts of Iron IV: Death or Dishonor
  • Europa Universalis 4: Emperor
  • Europa Universalis IV: Cradle of Civilization
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Apocalypse
  • Europa Universalis IV: Rule Britannia
  • Stellaris: Distant Stars
  • Europa Universalis IV: Dharma
  • Crusader Kings II: Holy Fury
  • Imperator: Rome
  • Stellaris: Ancient Relics
  • Stellaris: Lithoids
  • Hearts of Iron IV: La Resistance
  • Stellaris: Federations
  • Crusader Kings III
  • Tyranny: Archon Edition
  • Magicka
  • Europa Universalis IV
  • Victoria 2
  • Cities: Skylines
  • Europa Universalis IV: El Dorado
  • Mount & Blade: Warband
  • Mount & Blade: With Fire and Sword
  • Crusader Kings II: Way of Life
  • Magicka 2
Let me preface this by saying that this bug is difficult to track down for certain, as it is not perfectly obvious when it is occurring and not. I have attached three mod files to this post that helped me confirm that this bug is real, and I will discuss those mod files at the end of the post. I have gone to great lengths to double and triple check my work to make sure that this is a real bug and not simply a confusing block of code.

Summary: In the current unmodified version of the game, catholic rulers which are either too low a tier or too young to be coronated are 10 times less likely to use a large number of casus belli.

There exists a bug within the scripting for a large number of casus belli in the 00_cb_types.txt and 01_cb_types.txt files. The following block of code appears in a number of the casus belli's ai_will_do blocks:

modifier = { #Focus on Coronation first.
factor = 0.1
has_dlc = "Holy Fury"
ROOT = {
is_feudal = yes
OR = {
religion = catholic
religion = fraticelli
}
NOR = {
trait = crowned_by_priest
trait = crowned_by_bishop
trait = crowned_by_pope
trait = crowned_by_myself
}
}
}

This code appears to be intended to make catholic kings who are waiting to be coronated 10 times less likely to declare war using these casus belli. However, it fails to exclude catholic and fraticelli rulers who cannot be crowned, because they are (A) not of king or emperor tier, or (B) because they are children. This means catholic rulers who aren't kings/emperors, or who are children who cannot yet be crowned, are also 10 times less likely to declare war using the affected CBs.

A roughly put together correction for this code would be as follows:

modifier = { #Focus on Coronation first.
factor = 0.1
has_dlc = "Holy Fury"
ROOT = {
is_feudal = yes
OR = {
religion = catholic
religion = fraticelli
}
NOR = {
trait = crowned_by_priest
trait = crowned_by_bishop
trait = crowned_by_pope
trait = crowned_by_myself
}
primary_title = {
higher_tier_than = DUKE
}
is_adult = yes
}
}

This fixed logic only applies the ai modifier if the character is eligible for crowning but has not done so: they are a king or emperor, and not a child.

The bug appears in a large number of casus belli, a non-exhaustive list of which I have compiled below:

Inside the primary 00_cb_types.txt file:
invasion
tribal_invasion
religious (i.e. religious holy war)
embargo_cb
sieze_trade_post
pagan_subjugation
dejure_county_claim
manifest_destiny_invasion
tributary_cb
free_tributary_cb
nomad_dispute
cb_liberate_nomad_duchy

Inside the 01_cb_types.txt file:
dejure_duchy_claim
force_vassalization
great_realm_conflict
ducal_county_conquest
liberate_religion
unjust_conquest
tributary_permanent_cb
pepin_religious
flower_war_cb
matriarchal_deposition_war
patriarchal_deposition_war



On to my testing mods and what they demonstrated. There are three mods attached. In all three, I disabled every casus belli in the game by overwriting the files with empty ones. I then made a new casus belli (a modified version of the holy war casus belli, which contains the bugged logic in vanilla).

Important note: In all three versions of the mod, I also made it so rulers which are not catholic or fraticelli would not declare war. This does not interact with the bugged logic in any way whatsoever – the only purpose of this inclusion was to make the war ledger in game empty except for rulers which could be affected by the logic, making the testing process easier and less prone to errors.

All testing was done on the 1066 start date using observer mode.

In the first version of the mod “CB Test Bugged Logic”, the logic is applied such that, instead of making the ai 10 times less likely to use the CB, the ai would instead never use the CB, if the logic applied to them. When running tests using this mod, the only wars ever declared were by crowned kings, indicating that dukes and children were being incorrectly affected by the modifier. In one instance, I gave a duke a number of bonuses via console commands, and waited several years for him to holy war his weak muslim neighbor. After several years of inaction, I used a console command to give him a kingdom tier title, and within days of his coronation finishing, he declared the war he was unable to as a duke.

In the second version of the mod “CB Test No Logic”, the offending block of code is simply removed. In testing, catholic rulers of all tiers were declaring holy wars within months of the start of the game, which did not occur a single time in 15 years of testing with the first version of the mod.

In the third version of the mod “CB Fixed Logic”, I have adjusted the code as per the code I listed above with checks for age and title tier. Tests with this mod showed the same thing as with the second version: catholic rulers of all tiers were declaring holy wars within months of the start of the game.

You can freely use the three mods in your own tests. They can be extracted directly into your /mod directory for installation.
 

Attachments

  • CB Test Bugged Logic.rar
    3,5 KB · Views: 0
  • CB Test No Logic.rar
    3,4 KB · Views: 0
  • CB Fixed Logic.rar
    3,5 KB · Views: 0
  • 1Like
Reactions:
Upvote 0
Very nice find! I think it's easier to simply use 'is_decision_potential = prepare_coronation_ceremony'. Regardless, thanks! I'll make sure this ends up in CleanSlate.