[1.3.2]conditional options broken for AI, or "ai_chance" malfunction?

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

Risa

Lt. General
92 Badges
Mar 2, 2005
1.242
278
  • Semper Fi
  • Europa Universalis III Complete
  • Knights of Pen and Paper +1 Edition
  • Lead and Gold
  • The Kings Crusade
  • Magicka
  • Majesty 2
  • Europa Universalis III Complete
  • Penumbra - Black Plague
  • Europa Universalis IV: Res Publica
  • Victoria: Revolutions
  • Europa Universalis: Rome
  • Rome Gold
  • Heir to the Throne
  • Sengoku
  • Ship Simulator Extremes
  • Sword of the Stars
  • Supreme Ruler 2020
  • Victoria 2
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • Rome: Vae Victis
  • Warlock: Master of the Arcane
  • 500k Club
  • Cities: Skylines
  • Surviving Mars: First Colony Edition
  • Europa Universalis III
  • Hearts of Iron II: Armageddon
  • Crusader Kings II
  • 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
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Commander: Conquest of the Americas
  • East India Company Collection
  • Arsenal of Democracy
  • Europa Universalis III Complete
  • Divine Wind
  • Europa Universalis IV
  • 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
  • For The Glory
  • For the Motherland
  • Hearts of Iron III
In event war_in_heaven.4 (Response to WiH declaration), all subject AI empires choose sides, despite them shouldn't get access to first three options (choosing sides). At first I thought the trigger "is_subject = yes/no" is broken. Then I realized that I the player controlling a non-subject empire did not get access to the fourth option, so the trigger works (for player, at least). I noticed that the fourth option does not have "ai_chance" component, presuming it's the only available option under its condition.

So the problem is likely
Conditional option triggers work on interface level only, AI does not respect them.

Or
"Ai_chance" component malfunctions when in events with conditional options.

If this bug does exist, it may affect lots of events.

Mitigation: Add
modifier = {
factor = 0
Not = { condition }
}

to ai_chance component of each option, create a basic one with factor = 100 if none exists.
 
  • 1
Reactions:
Upvote 0

Risa

Lt. General
92 Badges
Mar 2, 2005
1.242
278
  • Semper Fi
  • Europa Universalis III Complete
  • Knights of Pen and Paper +1 Edition
  • Lead and Gold
  • The Kings Crusade
  • Magicka
  • Majesty 2
  • Europa Universalis III Complete
  • Penumbra - Black Plague
  • Europa Universalis IV: Res Publica
  • Victoria: Revolutions
  • Europa Universalis: Rome
  • Rome Gold
  • Heir to the Throne
  • Sengoku
  • Ship Simulator Extremes
  • Sword of the Stars
  • Supreme Ruler 2020
  • Victoria 2
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • Rome: Vae Victis
  • Warlock: Master of the Arcane
  • 500k Club
  • Cities: Skylines
  • Surviving Mars: First Colony Edition
  • Europa Universalis III
  • Hearts of Iron II: Armageddon
  • Crusader Kings II
  • 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
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Commander: Conquest of the Americas
  • East India Company Collection
  • Arsenal of Democracy
  • Europa Universalis III Complete
  • Divine Wind
  • Europa Universalis IV
  • 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
  • For The Glory
  • For the Motherland
  • Hearts of Iron III
I think I can confirm this bug indeed exists.

I write following test events
Code:
namespace = test_risa
country_event = {
 id = test_risa.1
 title = OK
 desc = OK
 hide_window = yes
 is_triggered_only = yes
 immediate = {
  every_country = {
   limit = {
    is_country_type = default
   }
   country_event = { id = test_risa.2 }
  }
 }
}

country_event = {
 id = test_risa.2
 title = OK
 desc = OK
 is_triggered_only = yes
 option = {
  name = contact
  trigger = {
   is_subject = yes
  }
  ai_chance = {
   factor = 100
  }
  if = {
   limit = { NOT = { has_communications = from } }
   establish_communications_no_message = from
   save_event_target_as = contact_empire
   from = { country_event = { id = action.1 } } 
  }
 }
 option = {
  name = ok
  trigger = {
   is_subject = no
  }
  ai_chance = {
   factor = 200
  }
 }
}
and insert the first event into on_press_begin section of 00_on_actions.txt, so that the test event will fire as soon as one presses begin in a new game.

As you can see, the first event triggers the second event for every normal empires (including one of player herself). The second event has two options. One for subject empire, which none of normal empires is at the game start, tells it to contact the player. The other for independent empire, which everyone is, tells it to do nothing.

In game, the player receives the second event with second option only, by design. However, player also receive several contacts from AI empires, where there should be none. As we modify ai_chance factor of the second option, we can see number of contacts is in proportion to two factors. If we remove ai_chance component from the second option, we will receive contacts from all AI empires, as if its ai_chance factor is just 1.

@ForzaA , I think this is a serious bug, and should be fixed as soon as possible.
 
Last edited:
  • 1
Reactions:

Risa

Lt. General
92 Badges
Mar 2, 2005
1.242
278
  • Semper Fi
  • Europa Universalis III Complete
  • Knights of Pen and Paper +1 Edition
  • Lead and Gold
  • The Kings Crusade
  • Magicka
  • Majesty 2
  • Europa Universalis III Complete
  • Penumbra - Black Plague
  • Europa Universalis IV: Res Publica
  • Victoria: Revolutions
  • Europa Universalis: Rome
  • Rome Gold
  • Heir to the Throne
  • Sengoku
  • Ship Simulator Extremes
  • Sword of the Stars
  • Supreme Ruler 2020
  • Victoria 2
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • Rome: Vae Victis
  • Warlock: Master of the Arcane
  • 500k Club
  • Cities: Skylines
  • Surviving Mars: First Colony Edition
  • Europa Universalis III
  • Hearts of Iron II: Armageddon
  • Crusader Kings II
  • 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
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Commander: Conquest of the Americas
  • East India Company Collection
  • Arsenal of Democracy
  • Europa Universalis III Complete
  • Divine Wind
  • Europa Universalis IV
  • 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
  • For The Glory
  • For the Motherland
  • Hearts of Iron III
Update:
trigger = ( condition } component works on UI only. There is another conditional component, allow = { condition } , which correctly disables option being executed when condition is unmet, but doesn't hide the option in UI in that case. So another mitigation method will be use them both together.
 

Risa

Lt. General
92 Badges
Mar 2, 2005
1.242
278
  • Semper Fi
  • Europa Universalis III Complete
  • Knights of Pen and Paper +1 Edition
  • Lead and Gold
  • The Kings Crusade
  • Magicka
  • Majesty 2
  • Europa Universalis III Complete
  • Penumbra - Black Plague
  • Europa Universalis IV: Res Publica
  • Victoria: Revolutions
  • Europa Universalis: Rome
  • Rome Gold
  • Heir to the Throne
  • Sengoku
  • Ship Simulator Extremes
  • Sword of the Stars
  • Supreme Ruler 2020
  • Victoria 2
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • Rome: Vae Victis
  • Warlock: Master of the Arcane
  • 500k Club
  • Cities: Skylines
  • Surviving Mars: First Colony Edition
  • Europa Universalis III
  • Hearts of Iron II: Armageddon
  • Crusader Kings II
  • 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
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Commander: Conquest of the Americas
  • East India Company Collection
  • Arsenal of Democracy
  • Europa Universalis III Complete
  • Divine Wind
  • Europa Universalis IV
  • 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
  • For The Glory
  • For the Motherland
  • Hearts of Iron III
In case of any modder / dev is interested, here is the complete list of all events that use conditional options:
Probably used by AI:
anomaly.40 (option 1 & 2 & 3)
anomaly.5003 (option 4 & 5)
anomaly.95 (option 1 & 2)
anomaly.105 (option 1 & 2)
anomaly.120 (option 2)
anomaly.121 (option 1 & 2)
anomaly.140 (option 1 & 2)
anomaly.168 (option 4)
anomaly.180 (option 1 to 4)
anomaly.230 (option 1 & 2 & 3)
anomaly.235 (option 1 & 2)
anomaly.257 (option 1 to 4)
anomaly.275 (option 1 & 2)
anomaly.290 (option 2)
anomaly.3010 (option 1)
anomaly.3015 (option 1 & 2)
anomaly.3030 (option 1 & 2)
anomaly.3035 (option 1 & 2)
anomaly.3040 (option 1 & 2 & 3)
anomaly.3050 (option 1)
anomaly.3060 (option 1 & 2)
anomaly.3086 (option 2 & 3)
anomaly.3091 (option 2)
anomaly.3112 (option 1 & 2 & 3)
anomaly.3120 (option 1 & 2)
anomaly.4015 (option 2 & 3)
anomaly.4017 (option 1 to 4)
anomaly.4038 (option 1 to 6)
anomaly.4045 (option 1 & 2)
anomaly.4051 (option 1 to 4)
anomaly.4060 (option 2 & 3)
anomaly.4066 (option 1 & 2 & 3)
anomaly.4075 (option 2)
anomaly.4077 (option 1 to 4)
anomaly.4080 (option 2 & 3 & 4)
anomaly.4081 (option 1 & 2)
anomaly.4090 (option 1 to 7)
anomaly.4093 (option 1 to 4)
anomaly.4094 (option 1 & 2 & 3)
anomaly.4100 (option 1 & 2 & 3)
anomaly.4105 (option 1 & 2)
anomaly.4110 (option 1 & 2)
anomaly.4125 (option 1 & 2)
anomaly.4155 (option 2)
anomaly.4157 (option 1 & 3)
anomaly.4158 (option 2 to 10)
anomaly.4159 (option 2 to 10)
anomaly.4170 (option 2)
anomaly.4172 (option 1 & 2)
anomaly_failure.4157 (option 1 to 4)
colony.64 (option 2)
colony.69 (option 1)
colony.71 (option 1)
colony.103 (option 2)
colony.152 (option 1 & 2 & 3)
country.999 (option 1 to 9)
diplomatic.2 (option 1 & 2)
diplomatic.12 (option 3)
faction.50 (option 1 to 4)
fallen_empires_tasks.4 (option 2 to 5)
fallen_empires_tasks.22 (option 2 to 5)
guardian.670 (option 1 to 4)
guardian.1016 (option 2)
guardian.1018 (option 1 & 2)
guardian.1040 (option 2 to 5)
guardian.1051 (option 2 & 3 & 4)
guardian.1052 (option 1 & 2 & 3)
guardian.1061 (option 1 to 4)
guardian.2113 (option 1)
akx.9010 (option 1 to 4)
akx.9101 (option 1 & 2)
akx.9201 (option 1)
akx.9211 (option 2)
akx.9221 (option 2)
akx.9300 (option 1 & 2)
akx.9310 (option 4 & 5 & 7 to 10)
akx.9500 (option 1)
akx.9540 (option 2)
nomad.41 (option 2 & 3 & 4)
nomad.511 (option 1 & 3 & 4)
nomad.512 (option 1 & 2 & 3)
nomad.513 (option 1 & 2 & 3)
nomad.523 (option 1 & 3)
observation.3135 (option 1 to 4)
observation.3136 (option 1 to 3)
pirate.20 (option 1 to 4)
precursor.1101 (option 1 & 2)
precursor.2101 (option 1 & 2 & 3)
primitive.40 (option 2 & 3)
primitive.43 (option 1 & 2 & 3)
primitive.174 (option 1)
story.333 (option 1 & 2)
war_in_heaven.4 (option 1 to 4) (most severe)

Probably not used by AI, or those with no ill consequences (so no need to fix):
advisor.1 (option 3 & 4) (tutorial)
anomaly.96 (option 1 & 2 & 3)
anomaly.106 (option 1 & 2 & 3)
anomaly.256 (option 2) (option 1 should also be conditional)
#anomaly.280
anomaly.3125 (option 1 & 2 & 3) (explicitly flagged for non-AI)
anomaly.3127 (option 1 & 2 & 3) (follow up of above. Also, this event adds d_betharian_deposit to orbital_deposit_tile, which needs fixed)
anomaly.3130 {option 1 & 2 & 3}
anomaly.4020 (option 1 & 2)
anomaly.4062 (option 1 & 2)
anomaly.4106 (option 2 & 3) (this event can't happen)
anomaly.4145 (option 1 & 2)
anomaly.4161 (option 2)
anomaly.4163 (option 1 & 2)
anomaly.4166 (option 1 & 2)
anomaly_failure.4086 (option 2)
anomaly_failure.4090 (option 2)
anomaly_failure.4170 (option 1 to 4)
colony.164 (option 1 & 2 & 3)
colony.1521 (option 2 & 3) (explicitly flagged for non-AI)
colony_mod.2 (option 3 & 4) (explicitly flagged for non-AI)
colony_mod.101 (option 1 & 2) (follow up of above)
colony.2001 (option 1 to 4) (explicitly flagged for non-AI)
colony.2005 (option 1 to 6) (explicitly flagged for non-AI)
colony.2006 (option 1 & 2 & 3) (follow up of above)
colony.2007 (option 1 & 2 & 3) (follow up of above)
colony.2008 (option 1 & 2 & 3) (follow up of above)
colony.2010 (option 1 to 5) (explicitly flagged for non-AI)
colony.2011 (option 1 to 4) (follow up of above)
colony.2012 (option 1 & 2) (follow up of above)
colony.2025 (option 1 to 5) (explicitly flagged for non-AI)
colony.2030 (option 1 & 3 & 4) (explicitly flagged for non-AI)
colony.2035 (option 1 to 6) (explicitly flagged for non-AI)
colony.2035 (option 1 to 6) (follow up of above)
colony.2047 (option 1 & 2) (follow up of above)
colony.2050 (option 2 & 3 & 4) (explicitly flagged for non-AI)
country.7 (option 2) (follow up of an explicit non-AI event)
country.260 (option 1 & 2) (follow up of an explicit non-AI event)
country.1040 (option 1 & 2) (follow up of an explicit non-AI event)
country.1041 (option 1 & 2 & 3) (follow up of above)
country.1105 (option 1 & 2) (follow up of an explicit non-AI event)
country.1110 (option 1 & 2) (follow up of an explicit non-AI event)
country.1115 (option 1 & 2) (follow up of an explicit non-AI event)
country.1120 (option 1 & 2) (follow up of an explicit non-AI event)
country.1125 (option 1 & 2) (follow up of an explicit non-AI event)
country.1130 (option 1 & 2) (follow up of an explicit non-AI event)
country.1135 (option 1 & 2) (follow up of an explicit non-AI event)
country.1140 (option 1 & 2) (follow up of an explicit non-AI event)
country.1145 (option 1 & 2) (follow up of an explicit non-AI event)
country.1150 (option 1 & 2) (follow up of an explicit non-AI event)
crisis.18 (option 1 to 10)
crisis.30 (option 2 to 6) (player diplomacy event)
crisis.55 (option 2 & 3 & 4) (player diplomacy event)
crisis.211 (option 1 to 8)
crisis.1007 (option 1 to 10)
crisis.1009 (option 1 to 10)
crisis.1050 (option 2 to 6) (player diplomacy event)
crisis.1271 (option 1 to 8)
crisis.2010 (option 1 to 4)
galactic_features.361 (option 1 to 6)
guardian.142 (option 1 & 2) (enclave event)
guardian.143 (option 1 & 2) (enclave event)
guardian.144 (option 1 & 2) (enclave event)
guardian.150 (option 1 & 2 & 3) (enclave event)
guardian.151 (option 1 & 2 & 3) (enclave event)
guardian.151 (option 1 & 2 & 3) (enclave event)
guardian.300 (option 1 to 6) (enclave event, player diplomacy event)
guardian.302 (option 2 & 3) (enclave event)
guardian.303 (option 2 & 3) (enclave event)
guardian.313 (option 1 & 2) (enclave event)
guardian.322 (option 2 & 3) (enclave event)
guardian.332 (option 1 & 2) (enclave event)
guardian.333 (option 1 & 2) (enclave event)
guardian.500 (option 1) (enclave event, player diplomacy event)
guardian.501 (option 1) (enclave event, player diplomacy event)
guardian.507 (option 1 to 5) (enclave event)
guardian.508 (option 1 to 9) (enclave event)
guardian.510 (option 2) (enclave event)
guardian.515 (option 2 to 7) (enclave event)
guardian.520 (option 2) (enclave event)
guardian.525 (option 2) (enclave event)
guardian.530 (option 2) (enclave event)
guardian.535 (option 2) (enclave event)
guardian.540 (option 2) (enclave event)
guardian.545 (option 2 to 7) (enclave event)
guardian.594 (option 1 & 2) (enclave event)
guardian.1041 (option 1 & 2)
guardian.1056 (option 3)
akx.9005 (option 1 & 2 & 3)
akx.9100 (option 1 & 2)
akx.9600 (option 1 & 2) (explicitly flagged for non-AI)
akx.9601 (option 1 & 2) (follow up of above)
akx.9602 (option 1 & 2) (follow up of above)
leader.21 (option 1 & 2)
leader.22 (option 1 & 2)
leader.23 (option 1 & 2)
leader.24 (option 1 & 2)
leader.25 (option 1 & 2)
nomad.9 (option 1 & 2 & 3)
nomad.10 (option 1 to 46)
nomad.30 (option 1 to 5) (player diplomacy event)
nomad.100 (option 1 & 2 & 3)
nomad.105 (option 1 & 2 & 3)
observation.46 (option 1 & 2) (explicitly flagged for non-AI)
action.1 (option 1 to 46) (explicitly flagged for non-AI)
action.100 (option 1 to 46) (explicitly flagged for non-AI)
action.11 (option 1 & 2 & 3)
action.13 (option 1 & 2 & 3)
action.140 (option 1 to 5)
pirate.1 (option 1 to 7)
pirate.10 (option 1 & 2)
progress.4 (option 1 & 2 & 3) (explicitly flagged for non-AI)
progress.5 (option 1 & 2 & 3) (explicitly flagged for non-AI)
progress.6 (option 1 & 2 & 3) (explicitly flagged for non-AI)
story.8 (option 1 & 2 & 3)
story.101 (option 2) (follow up of an explicit non-AI event)
story.110 (option 1 & 2 & 3) (follow up of an explicit non-AI event)
story.201 (option 2) (follow up of an explicit non-AI event)
story.205 (option 1) (follow up of an explicit non-AI event)
story.215 (option 1 & 2 & 3) (follow up of an explicit non-AI event)
story.219 (option 1 & 2 & 3) (follow up of an explicit non-AI event)
story.220 (option 1 & 2) (follow up of an explicit non-AI event)
story.301 (option 2) (follow up of an explicit non-AI event)
story.305 (option 1) (follow up of an explicit non-AI event)
story.401 (option 1 & 2 & 3) (follow up of an explicit non-AI event)
story.405 (option 1 & 2) (follow up of an explicit non-AI event)
story.410 (option 1 & 2) (follow up of an explicit non-AI event)
story.501 (option 1 & 2 & 3) (follow up of an explicit non-AI event)
tutorial.52 (option 1 & 2) (tutorial)
tutorial.53 (option 1 & 2 & 3) (tutorial)
tutorial.54 (option 1 & 2 & 3) (tutorial)
uplift.6000 (option 1 & 2)
uplift.6010 (option 1 & 2)
uplift.6015 (option 1 & 2)
uplift.6020 (option 1 & 2)
uplift.6025 (option 1 & 2)
uplift.6030 (option 1 & 2)
uplift.6035 (option 1 & 2)
uplift.6040 (option 1 & 2)
uplift.6045 (option 1 & 2)
uplift.6050 (option 1 & 2)
uplift.6055 (option 1 & 2)
uplift.6060 (option 1 & 2)
uplift.6065 (option 1 & 2)
uplift.6070 (option 1 & 2)
uplift.6075 (option 1 & 2)
uplift.6080 (option 1 & 2)
uplift.6090 (option 1 & 2)
uplift.7500 (option 1 & 2) (explicitly flagged for non-AI)
uplift.7510 (option 2 & 3) (explicitly flagged for non-AI)
uplift.7520 (option 1 & 2 & 3) (explicitly flagged for non-AI)
It takes me three days to apply mitigation method to all those need to fix. So I wholeheartly recommend dev fix the problem from hard code.