ngppgn

Field Marshal
19 Badges
Jan 29, 2011
3.508
653
  • Crusader Kings III
  • Imperator: Rome
  • Imperator: Rome Deluxe Edition
  • Crusader Kings II: Jade Dragon
  • Europa Universalis IV
  • Crusader Kings II: Monks and Mystics
  • Hearts of Iron IV: Cadet
  • Stellaris Sign-up
  • Stellaris
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Res Publica
  • Crusader Kings II
  • Heir to the Throne
  • Europa Universalis IV: Call to arms event
  • Europa Universalis IV: Conquest of Paradise
  • Divine Wind
  • Europa Universalis III: Chronicles
  • Europa Universalis III
  • Crusader Kings II: The Old Gods
Culture is. Not 100% sure about culture_group, but I think it is too.
However, unlike religion it doesn't have a massive performance effect. It's better than putting it in the trigger, but not by a massive amount.

It's a shame that they don't filter. Would be a massive help for total conversions.
 

richvh

Preserver of the Light
63 Badges
Dec 1, 2001
14.691
1.999
Visit site
  • Stellaris: Leviathans Story Pack
  • Pillars of Eternity
  • Crusader Kings II: Horse Lords
  • Cities: Skylines - After Dark
  • Knights of Pen and Paper 2
  • Crusader Kings II: Conclave
  • Stellaris
  • Hearts of Iron IV Sign-up
  • Stellaris Sign-up
  • Crusader Kings II: Reapers Due
  • Tyranny: Archon Edition
  • Tyranny: Archon Edition
  • Tyranny: Gold Edition
  • Crusader Kings II: Way of Life
  • Crusader Kings II: Monks and Mystics
  • Stellaris - Path to Destruction bundle
  • Surviving Mars
  • Stellaris: Synthetic Dawn
  • Tyranny - Tales from the Tiers
  • Tyranny - Bastards Wound
  • Age of Wonders III
  • Age of Wonders: Shadow Magic
  • Age of Wonders
  • Age of Wonders II
  • Crusader Kings II: Jade Dragon
  • Crusader Kings III: Royal Edition
  • Europa Universalis IV: Call to arms event
  • 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
  • Europa Universalis IV
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • A Game of Dwarves
  • King Arthur II
  • Knights of Pen and Paper +1 Edition
  • Magicka
  • Majesty 2 Collection
  • Europa Universalis IV: Res Publica
  • Europa Universalis: Rome
  • Rome Gold
  • Rome: Vae Victis
  • 500k Club
  • Cities: Skylines
Am I correct in thinking that:
Code:
random_list = {
   70 = { }
   30 = { add_trait = x }
is less efficient than:
Code:
random = {
   chance = 30
   add_trait = x
}
 

JaceX

Major
17 Badges
Jan 4, 2010
550
308
  • Crusader Kings III: Royal Edition
  • Europa Universalis IV
  • Crusader Kings III
  • Crusader Kings II
  • Europa Universalis III: Chronicles
  • Europa Universalis IV: Call to arms event
  • Sengoku
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Sword of Islam
  • Mount & Blade: With Fire and Sword
  • Mount & Blade: Warband
  • Europa Universalis IV: Pre-order
  • 500k Club
  • Heir to the Throne
  • Divine Wind
  • Europa Universalis III
  • Cities in Motion
Has anything changed with localisations? My mod uses the 'zz_' format to override vanilla localisations and now when I start the game up, it solely uses vanilla localisations.
My provinces are all named with vanilla titles.

Please let me know if I can do anything to update localisations to 2.6.1. Thanks Meneth.
 
Last edited:

Meneth

Crusader Kings 3 Programmer
128 Badges
Feb 9, 2011
10.056
5.358
www.paradoxwikis.com
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Holy Knight (pre-order)
  • Crusader Kings II
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: The Republic
  • Teleglitch: Die More Edition
  • Crusader Kings II: Conclave
  • Hearts of Iron IV Sign-up
  • Surviving Mars
  • Stellaris: Galaxy Edition
  • 500k Club
  • Hearts of Iron IV: Colonel
  • Europa Universalis IV: El Dorado
  • Europa Universalis IV: Cradle of Civilization
  • Magicka: Wizard Wars Founder Wizard
  • Mount & Blade: Warband
  • Mount & Blade: With Fire and Sword
  • Crusader Kings II: Way of Life
  • Stellaris: Digital Anniversary Edition
  • Hearts of Iron IV: Death or Dishonor
  • Hearts of Iron IV: Field Marshal
  • Age of Wonders III
  • Europa Universalis III Complete
  • Crusader Kings II: The Old Gods
  • Hearts of Iron IV: Cadet
  • Steel Division: Normand 44 Sign-up
  • Crusader Kings Complete
  • Europa Universalis IV
  • Hearts of Iron IV: Expansion Pass
  • Hearts of Iron IV: Expansion Pass
  • Cities: Skylines - Parklife
  • Prison Architect
  • Stellaris: Leviathans Story Pack
  • Crusader Kings II: Reapers Due
  • Stellaris Sign-up
  • Europa Universalis III Complete
  • Europa Universalis IV: Mandate of Heaven
  • Europa Universalis IV: Rule Britannia
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: Charlemagne
  • Magicka 2 - Signup Campaign
  • Knights of Pen and Paper 2
  • Europa Universalis IV: Mare Nostrum
  • Knights of Honor
  • Deus Vult
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
Has anything changed with localisations? My mod uses the 'zz_' format to override vanilla localisations and now when I start the game up, it solely uses vanilla localisations.
My provinces are all named with vanilla titles.

Please let me know if I can do anything to update localisations to 2.6.1. Thanks Meneth.
I'm no longer on the project, so I can't check how it works any more.
Though I've heard other modders say that something has changed too.

You could try going with aa_ rather than zz_ and see if that works.
 

JaceX

Major
17 Badges
Jan 4, 2010
550
308
  • Crusader Kings III: Royal Edition
  • Europa Universalis IV
  • Crusader Kings III
  • Crusader Kings II
  • Europa Universalis III: Chronicles
  • Europa Universalis IV: Call to arms event
  • Sengoku
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Sword of Islam
  • Mount & Blade: With Fire and Sword
  • Mount & Blade: Warband
  • Europa Universalis IV: Pre-order
  • 500k Club
  • Heir to the Throne
  • Divine Wind
  • Europa Universalis III
  • Cities in Motion
I'm no longer on the project, so I can't check how it works any more.
Though I've heard other modders say that something has changed too.

You could try going with aa_ rather than zz_ and see if that works.

You were right. They flipped the override order. aa_ now works instead of zz_.

Kinda random...
 

Wagonlitz

Resident WW Foreigner
102 Badges
Jul 19, 2010
8.177
4.907
  • Crusader Kings III
  • Crusader Kings III: Royal Edition
  • Europa Universalis 4: Emperor
  • Europa Universalis IV
  • Hearts of Iron IV: Expansion Pass
  • Hearts of Iron IV: Cadet
  • Europa Universalis IV: Cradle of Civilization
  • Hearts of Iron IV: Death or Dishonor
  • Steel Division: Normand 44 Sign-up
  • Crusader Kings Complete
  • Europa Universalis IV: Mandate of Heaven
  • Stellaris: Digital Anniversary Edition
  • Europa Universalis III Complete
  • Crusader Kings II: Reapers Due
  • Europa Universalis: Rome
  • Hearts of Iron IV: Field Marshal
  • Hearts of Iron IV: Colonel
  • Europa Universalis III Complete
  • Crusader Kings II: Conclave
  • War of the Roses
  • 500k Club
  • Europa Universalis IV: El Dorado
  • Crusader Kings II: Way of Life
  • Humble Paradox Bundle
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Cossacks
  • Imperator: Rome Sign Up
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Imperator: Rome Deluxe Edition
  • Europa Universalis IV: Golden Century
  • Europa Universalis IV: Dharma
  • Europa Universalis IV: Rule Britannia
  • Hearts of Iron IV: Expansion Pass
  • Crusader Kings III Referal
  • Imperator: Rome - Magna Graecia
  • Europa Universalis IV: Dharma Pre-order
  • Stellaris: Distant Stars
  • Rome Gold
  • Deus Vult
  • Europa Universalis IV: Common Sense
  • Europa Universalis III
  • Europa Universalis III Complete
  • Europa Universalis III: Chronicles
  • Heir to the Throne
  • Divine Wind
  • Europa Universalis IV: Call to arms event
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Pre-order
  • Europa Universalis IV: Wealth of Nations
Kinda random...
There probably was a good reason behind it; but it definitely should have been stated that the change was made.
 

LeSingeAffame

Loyal ally to Durcorach the Black Drake
72 Badges
Sep 16, 2012
3.586
2.189
  • Crusader Kings II
  • Europa Universalis IV
  • Europa Universalis 4: Emperor
  • Crusader Kings III
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: The Republic
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: Conclave
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Way of Life
  • Crusader Kings II: Reapers Due
  • Crusader Kings II: Jade Dragon
  • Crusader Kings II: Monks and Mystics
  • Crusader Kings II: Holy Fury
  • Stellaris
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris: Synthetic Dawn
  • Stellaris: Leviathans Story Pack
  • Stellaris - Path to Destruction bundle
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Distant Stars
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Stellaris: Megacorp
  • Hearts of Iron IV: Expansion Pass
  • Imperator: Rome
  • Imperator: Rome Deluxe Edition
  • Imperator: Rome Sign Up
  • Imperator: Rome - Magna Graecia
What about scripted_triggers ? I use them a lot, and don't know how efficient it is. I was told that there should be no loss of performance, even maybe a slight boost, but I don't think it was an official answer.
 

Meneth

Crusader Kings 3 Programmer
128 Badges
Feb 9, 2011
10.056
5.358
www.paradoxwikis.com
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Holy Knight (pre-order)
  • Crusader Kings II
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: The Republic
  • Teleglitch: Die More Edition
  • Crusader Kings II: Conclave
  • Hearts of Iron IV Sign-up
  • Surviving Mars
  • Stellaris: Galaxy Edition
  • 500k Club
  • Hearts of Iron IV: Colonel
  • Europa Universalis IV: El Dorado
  • Europa Universalis IV: Cradle of Civilization
  • Magicka: Wizard Wars Founder Wizard
  • Mount & Blade: Warband
  • Mount & Blade: With Fire and Sword
  • Crusader Kings II: Way of Life
  • Stellaris: Digital Anniversary Edition
  • Hearts of Iron IV: Death or Dishonor
  • Hearts of Iron IV: Field Marshal
  • Age of Wonders III
  • Europa Universalis III Complete
  • Crusader Kings II: The Old Gods
  • Hearts of Iron IV: Cadet
  • Steel Division: Normand 44 Sign-up
  • Crusader Kings Complete
  • Europa Universalis IV
  • Hearts of Iron IV: Expansion Pass
  • Hearts of Iron IV: Expansion Pass
  • Cities: Skylines - Parklife
  • Prison Architect
  • Stellaris: Leviathans Story Pack
  • Crusader Kings II: Reapers Due
  • Stellaris Sign-up
  • Europa Universalis III Complete
  • Europa Universalis IV: Mandate of Heaven
  • Europa Universalis IV: Rule Britannia
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: Charlemagne
  • Magicka 2 - Signup Campaign
  • Knights of Pen and Paper 2
  • Europa Universalis IV: Mare Nostrum
  • Knights of Honor
  • Deus Vult
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
What about scripted_triggers ? I use them a lot, and don't know how efficient it is. I was told that there should be no loss of performance, even maybe a slight boost, but I don't think it was an official answer.
Not much overhead there I believe. Probably equivalent to wrapping the actual trigger in "AND".

Can't check the code though, so not 100% sure about that.
 
  • 2
Reactions:

LeSingeAffame

Loyal ally to Durcorach the Black Drake
72 Badges
Sep 16, 2012
3.586
2.189
  • Crusader Kings II
  • Europa Universalis IV
  • Europa Universalis 4: Emperor
  • Crusader Kings III
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: The Republic
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: Conclave
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Way of Life
  • Crusader Kings II: Reapers Due
  • Crusader Kings II: Jade Dragon
  • Crusader Kings II: Monks and Mystics
  • Crusader Kings II: Holy Fury
  • Stellaris
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris: Synthetic Dawn
  • Stellaris: Leviathans Story Pack
  • Stellaris - Path to Destruction bundle
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Distant Stars
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Stellaris: Megacorp
  • Hearts of Iron IV: Expansion Pass
  • Imperator: Rome
  • Imperator: Rome Deluxe Edition
  • Imperator: Rome Sign Up
  • Imperator: Rome - Magna Graecia
Not much overhead there I believe. Probably equivalent to wrapping the actual trigger in "AND".

Can't check the code though, so not 100% sure about that.
As long as it does not affect the game performances in a bad way, it's good enough for me. Thanks for the answer !
 

Zaltys

Major
84 Badges
Jun 5, 2009
718
157
  • Sword of the Stars II
  • King Arthur II
  • Lead and Gold
  • Magicka
  • Majesty 2
  • Magicka 2
  • Pirates of Black Cove
  • Europa Universalis IV: Res Publica
  • Victoria: Revolutions
  • Sword of the Stars
  • Knights of Pen and Paper +1 Edition
  • Supreme Ruler 2020
  • Starvoid
  • Teleglitch: Die More Edition
  • Pillars of Eternity
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • Stellaris Sign-up
  • Europa Universalis IV: Pre-order
  • Pride of Nations
  • Crusader Kings II: Sword of Islam
  • 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
  • Europa Universalis III Complete
  • Divine Wind
  • Europa Universalis IV
  • Cities in Motion
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • Hearts of Iron III
  • Heir to the Throne
  • Impire
  • Europa Universalis IV: Common Sense
  • Stellaris: Federations
  • Mount & Blade: With Fire and Sword
  • Mount & Blade: Warband
  • Crusader Kings II: Horse Lords
  • Magicka: Wizard Wars Founder Wizard
  • Europa Universalis IV: El Dorado
  • 500k Club
  • Warlock: Master of the Arcane
  • Victoria 2
  • Europa Universalis III Complete
  • Europa Universalis III Complete
Question about decision optimization:
I've noticed that some vanilla decisions use 'potential = { is_alive = yes }' for targetted decisions.

Which has always confused me. Are those actually needed?

...if the potential doesn't include 'is_alive = yes', then does it check all characters, both dead and alive? If so, I can imagine that being extremely CPU-intensive, especially later in the game. In which case most decisions should be modified to exclude the dead...
 
Last edited:

ngppgn

Field Marshal
19 Badges
Jan 29, 2011
3.508
653
  • Crusader Kings III
  • Imperator: Rome
  • Imperator: Rome Deluxe Edition
  • Crusader Kings II: Jade Dragon
  • Europa Universalis IV
  • Crusader Kings II: Monks and Mystics
  • Hearts of Iron IV: Cadet
  • Stellaris Sign-up
  • Stellaris
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Res Publica
  • Crusader Kings II
  • Heir to the Throne
  • Europa Universalis IV: Call to arms event
  • Europa Universalis IV: Conquest of Paradise
  • Divine Wind
  • Europa Universalis III: Chronicles
  • Europa Universalis III
  • Crusader Kings II: The Old Gods
@Meneth Now that you're back on the dev team, a question in case you can answer it: hoe often does the ai evaluate thehardcoded diploactions?
For example, if I want to replace the hardcoded request conversion woth a custom targeted decision, given that dexisions are evaluated monthly, will that be evaluated more or less often than the hardcoded version?
 

Meneth

Crusader Kings 3 Programmer
128 Badges
Feb 9, 2011
10.056
5.358
www.paradoxwikis.com
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Holy Knight (pre-order)
  • Crusader Kings II
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: The Republic
  • Teleglitch: Die More Edition
  • Crusader Kings II: Conclave
  • Hearts of Iron IV Sign-up
  • Surviving Mars
  • Stellaris: Galaxy Edition
  • 500k Club
  • Hearts of Iron IV: Colonel
  • Europa Universalis IV: El Dorado
  • Europa Universalis IV: Cradle of Civilization
  • Magicka: Wizard Wars Founder Wizard
  • Mount & Blade: Warband
  • Mount & Blade: With Fire and Sword
  • Crusader Kings II: Way of Life
  • Stellaris: Digital Anniversary Edition
  • Hearts of Iron IV: Death or Dishonor
  • Hearts of Iron IV: Field Marshal
  • Age of Wonders III
  • Europa Universalis III Complete
  • Crusader Kings II: The Old Gods
  • Hearts of Iron IV: Cadet
  • Steel Division: Normand 44 Sign-up
  • Crusader Kings Complete
  • Europa Universalis IV
  • Hearts of Iron IV: Expansion Pass
  • Hearts of Iron IV: Expansion Pass
  • Cities: Skylines - Parklife
  • Prison Architect
  • Stellaris: Leviathans Story Pack
  • Crusader Kings II: Reapers Due
  • Stellaris Sign-up
  • Europa Universalis III Complete
  • Europa Universalis IV: Mandate of Heaven
  • Europa Universalis IV: Rule Britannia
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: Charlemagne
  • Magicka 2 - Signup Campaign
  • Knights of Pen and Paper 2
  • Europa Universalis IV: Mare Nostrum
  • Knights of Honor
  • Deus Vult
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
@Meneth Now that you're back on the dev team, a question in case you can answer it: hoe often does the ai evaluate thehardcoded diploactions?
For example, if I want to replace the hardcoded request conversion woth a custom targeted decision, given that dexisions are evaluated monthly, will that be evaluated more or less often than the hardcoded version?
I think the frequency probably depends on what interaction it is. Not entirely sure. Might be daily.
 
  • 1
Reactions:

ngppgn

Field Marshal
19 Badges
Jan 29, 2011
3.508
653
  • Crusader Kings III
  • Imperator: Rome
  • Imperator: Rome Deluxe Edition
  • Crusader Kings II: Jade Dragon
  • Europa Universalis IV
  • Crusader Kings II: Monks and Mystics
  • Hearts of Iron IV: Cadet
  • Stellaris Sign-up
  • Stellaris
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Res Publica
  • Crusader Kings II
  • Heir to the Throne
  • Europa Universalis IV: Call to arms event
  • Europa Universalis IV: Conquest of Paradise
  • Divine Wind
  • Europa Universalis III: Chronicles
  • Europa Universalis III
  • Crusader Kings II: The Old Gods
Question: say my mod has to periodically check for all provinces or characters having a status from an array of mutually exclusive status. In this situations two wuestions come to mind:

1) Is there a difference CPU-wise between checking a midifier, a trait, and a flag? Which one is cheaper

2) Is there a difference CPU-wise between checking the presence of a flag/trait modifier and checking the absence of @ flag/trait/modifier?

3)would it be more advisable to send an event to a unique entity and call any_province/any_character each time the maintenance is done, or would it be better to do this just once, then put the maintenance in a second event, and repeat that event with a delay?
 

Meneth

Crusader Kings 3 Programmer
128 Badges
Feb 9, 2011
10.056
5.358
www.paradoxwikis.com
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Holy Knight (pre-order)
  • Crusader Kings II
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: The Republic
  • Teleglitch: Die More Edition
  • Crusader Kings II: Conclave
  • Hearts of Iron IV Sign-up
  • Surviving Mars
  • Stellaris: Galaxy Edition
  • 500k Club
  • Hearts of Iron IV: Colonel
  • Europa Universalis IV: El Dorado
  • Europa Universalis IV: Cradle of Civilization
  • Magicka: Wizard Wars Founder Wizard
  • Mount & Blade: Warband
  • Mount & Blade: With Fire and Sword
  • Crusader Kings II: Way of Life
  • Stellaris: Digital Anniversary Edition
  • Hearts of Iron IV: Death or Dishonor
  • Hearts of Iron IV: Field Marshal
  • Age of Wonders III
  • Europa Universalis III Complete
  • Crusader Kings II: The Old Gods
  • Hearts of Iron IV: Cadet
  • Steel Division: Normand 44 Sign-up
  • Crusader Kings Complete
  • Europa Universalis IV
  • Hearts of Iron IV: Expansion Pass
  • Hearts of Iron IV: Expansion Pass
  • Cities: Skylines - Parklife
  • Prison Architect
  • Stellaris: Leviathans Story Pack
  • Crusader Kings II: Reapers Due
  • Stellaris Sign-up
  • Europa Universalis III Complete
  • Europa Universalis IV: Mandate of Heaven
  • Europa Universalis IV: Rule Britannia
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: Charlemagne
  • Magicka 2 - Signup Campaign
  • Knights of Pen and Paper 2
  • Europa Universalis IV: Mare Nostrum
  • Knights of Honor
  • Deus Vult
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
Question: say my mod has to periodically check for all provinces or characters having a status from an array of mutually exclusive status. In this situations two wuestions come to mind:

1) Is there a difference CPU-wise between checking a midifier, a trait, and a flag? Which one is cheaper

2) Is there a difference CPU-wise between checking the presence of a flag/trait modifier and checking the absence of @ flag/trait/modifier?

3)would it be more advisable to send an event to a unique entity and call any_province/any_character each time the maintenance is done, or would it be better to do this just once, then put the maintenance in a second event, and repeat that event with a delay?
1) They are all checked linearly, so it should be basically the same.
2) To determine it isn't there it has to go through all the flags/traits/modifiers, while to figure out that it is there on average only goes through half of them. In practice though it is unlikely to ever matter
3) Probably doesn't make much of a difference.
 
  • 4
Reactions:

ngppgn

Field Marshal
19 Badges
Jan 29, 2011
3.508
653
  • Crusader Kings III
  • Imperator: Rome
  • Imperator: Rome Deluxe Edition
  • Crusader Kings II: Jade Dragon
  • Europa Universalis IV
  • Crusader Kings II: Monks and Mystics
  • Hearts of Iron IV: Cadet
  • Stellaris Sign-up
  • Stellaris
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Res Publica
  • Crusader Kings II
  • Heir to the Throne
  • Europa Universalis IV: Call to arms event
  • Europa Universalis IV: Conquest of Paradise
  • Divine Wind
  • Europa Universalis III: Chronicles
  • Europa Universalis III
  • Crusader Kings II: The Old Gods
1) They are all checked linearly, so it should be basically the same.
2) To determine it isn't there it has to go through all the flags/traits/modifiers, while to figure out that it is there on average only goes through half of them. In practice though it is unlikely to ever matter
3) Probably doesn't make much of a difference.

Thanks. BTW, how is the memory usage of storing flags vs. modifiers vs. traits? Should I for example use flags whenever possible?
 

Meneth

Crusader Kings 3 Programmer
128 Badges
Feb 9, 2011
10.056
5.358
www.paradoxwikis.com
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Holy Knight (pre-order)
  • Crusader Kings II
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: The Republic
  • Teleglitch: Die More Edition
  • Crusader Kings II: Conclave
  • Hearts of Iron IV Sign-up
  • Surviving Mars
  • Stellaris: Galaxy Edition
  • 500k Club
  • Hearts of Iron IV: Colonel
  • Europa Universalis IV: El Dorado
  • Europa Universalis IV: Cradle of Civilization
  • Magicka: Wizard Wars Founder Wizard
  • Mount & Blade: Warband
  • Mount & Blade: With Fire and Sword
  • Crusader Kings II: Way of Life
  • Stellaris: Digital Anniversary Edition
  • Hearts of Iron IV: Death or Dishonor
  • Hearts of Iron IV: Field Marshal
  • Age of Wonders III
  • Europa Universalis III Complete
  • Crusader Kings II: The Old Gods
  • Hearts of Iron IV: Cadet
  • Steel Division: Normand 44 Sign-up
  • Crusader Kings Complete
  • Europa Universalis IV
  • Hearts of Iron IV: Expansion Pass
  • Hearts of Iron IV: Expansion Pass
  • Cities: Skylines - Parklife
  • Prison Architect
  • Stellaris: Leviathans Story Pack
  • Crusader Kings II: Reapers Due
  • Stellaris Sign-up
  • Europa Universalis III Complete
  • Europa Universalis IV: Mandate of Heaven
  • Europa Universalis IV: Rule Britannia
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: Charlemagne
  • Magicka 2 - Signup Campaign
  • Knights of Pen and Paper 2
  • Europa Universalis IV: Mare Nostrum
  • Knights of Honor
  • Deus Vult
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
Thanks. BTW, how is the memory usage of storing flags vs. modifiers vs. traits? Should I for example use flags whenever possible?
A modifier takes 16B as far as I can tell.
A flag takes 2B.
A variable takes 32B or so as far as I can tell.

Note that I'm not 100% sure about those counts, as the modifier and variable types are somewhat complex and thus not easy to tell the size of at a glance.

But flags are definitely your best bet when it comes to memory use.
 
  • 3
Reactions:

ngppgn

Field Marshal
19 Badges
Jan 29, 2011
3.508
653
  • Crusader Kings III
  • Imperator: Rome
  • Imperator: Rome Deluxe Edition
  • Crusader Kings II: Jade Dragon
  • Europa Universalis IV
  • Crusader Kings II: Monks and Mystics
  • Hearts of Iron IV: Cadet
  • Stellaris Sign-up
  • Stellaris
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Res Publica
  • Crusader Kings II
  • Heir to the Throne
  • Europa Universalis IV: Call to arms event
  • Europa Universalis IV: Conquest of Paradise
  • Divine Wind
  • Europa Universalis III: Chronicles
  • Europa Universalis III
  • Crusader Kings II: The Old Gods
A modifier takes 16B as far as I can tell.
A flag takes 2B.
A variable takes 32B or so as far as I can tell.

Note that I'm not 100% sure about those counts, as the modifier and variable types are somewhat complex and thus not easy to tell the size of at a glance.

But flags are definitely your best bet when it comes to memory use.
I didn't expect the difference to be that big! Thanks for the info.

Edit: Another question.

Say I want to recurse through all province with an event to randomise a stat. I cannot use while because of a bug with random seeds, thus I'll use

Code:
        remove_flag = pending_setup
        <do my stuff>
        random_province = {
            limit = {
                has_province_flag = pending_setup
            }
            province_event = { id = my_event.1 }
        }
Will I speed things up if I repeat the random province = {...} clause several times instead of just one?
 
Last edited:

ngppgn

Field Marshal
19 Badges
Jan 29, 2011
3.508
653
  • Crusader Kings III
  • Imperator: Rome
  • Imperator: Rome Deluxe Edition
  • Crusader Kings II: Jade Dragon
  • Europa Universalis IV
  • Crusader Kings II: Monks and Mystics
  • Hearts of Iron IV: Cadet
  • Stellaris Sign-up
  • Stellaris
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Res Publica
  • Crusader Kings II
  • Heir to the Throne
  • Europa Universalis IV: Call to arms event
  • Europa Universalis IV: Conquest of Paradise
  • Divine Wind
  • Europa Universalis III: Chronicles
  • Europa Universalis III
  • Crusader Kings II: The Old Gods
If you start getting stack overflows, you'll want to repeat it. Otherwise it probably won't matter.


Is this reported?
I reported it a while back. Divine said he'd consult Gars, and I never heard again of it. I've just reported it again since it also affects the use of random_list within while loops.