2.2.3 Performance and Pop Jobs (Weights and Triggers)

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

MechaThumper

Captain Blacktail
87 Badges
Dec 14, 2010
227
255
  • Crusader Kings II
  • Europa Universalis IV: Rights of Man
  • Stellaris: Synthetic Dawn
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Europa Universalis IV: Mare Nostrum
  • Europa Universalis IV: Pre-order
  • Cities: Skylines Deluxe Edition
  • Europa Universalis IV: Third Rome
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Europa Universalis IV: Res Publica
  • Magicka
  • Heir to the Throne
  • Europa Universalis IV: Call to arms event
  • Europa Universalis IV: Wealth of Nations
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Europa Universalis III
  • Cities in Motion 2
  • Europa Universalis III: Chronicles
  • Europa Universalis III Complete
  • Divine Wind
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Art of War
  • Hearts of Iron IV: Together for Victory
  • Stellaris: Digital Anniversary Edition
  • Hearts of Iron IV: Colonel
  • Stellaris: Leviathans Story Pack
  • Hearts of Iron IV: Cadet
  • Stellaris Sign-up
  • Stellaris: Galaxy Edition
  • Stellaris
  • Crusader Kings II: Conclave
  • Europa Universalis 4: Emperor
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Way of Life
  • Mount & Blade: Warband
  • Europa Universalis IV: El Dorado
  • 500k Club
  • Victoria 2
  • Europa Universalis III Complete
  • Europa Universalis III Complete
Or don't even bother with calculating job weights or job switching until the last couple of days of the month (like a week before) since most jobs only really produce resources on the first day of the month.
 

icon41gimp

Colonel
41 Badges
Mar 9, 2008
933
20
  • Crusader Kings II
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Res Publica
  • Rome Gold
  • Stellaris - Path to Destruction bundle
  • Stellaris: Leviathans Story Pack
  • Tyranny - Bastards Wound
  • Stellaris: Nemesis
  • Age of Wonders III
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Stellaris: Distant Stars
  • Surviving Mars: First Colony Edition
  • Stellaris: Megacorp
  • Surviving Mars: First Colony Edition
  • Stellaris: Ancient Relics
  • Stellaris: Lithoids
  • Stellaris: Federations
  • Crusader Kings III
  • Crusader Kings III: Royal Edition
  • Stellaris: Necroids
  • Europa Universalis IV
  • Surviving Mars
  • Europa Universalis IV: Mandate of Heaven
  • Stellaris: Digital Anniversary Edition
  • Tyranny: Archon Edition
  • Europa Universalis IV: Rights of Man
  • Hearts of Iron IV: Cadet
  • Stellaris Sign-up
  • Rome: Vae Victis
  • Stellaris
  • Europa Universalis IV: Mare Nostrum
  • Europa Universalis IV: Cossacks
  • Europa Universalis IV: Common Sense
  • Europa Universalis IV: El Dorado
  • 500k Club
  • Imperator: Rome
  • Stellaris: Synthetic Dawn
  • Tyranny - Tales from the Tiers
Can you be confident that the checks are actually occurring every day for all jobs if nothing changes? Your experiment only shows that the system will recalculate some job assignments when a change in the population pool relevant to that job occurs.

Inferring the first is true from the second being true seems like a logical leap.
 

Mithkabob

Major
77 Badges
Oct 12, 2014
531
770
  • Victoria 2: Heart of Darkness
  • Hearts of Iron III: Their Finest Hour
  • Knights of Pen and Paper +1 Edition
  • Leviathan: Warships
  • Majesty 2
  • Europa Universalis IV: Res Publica
  • Victoria: Revolutions
  • Semper Fi
  • Victoria 2: A House Divided
  • Crusader Kings II
  • Cities: Skylines Deluxe Edition
  • Cities: Skylines - After Dark
  • Europa Universalis IV: Cossacks
  • Cities: Skylines - Snowfall
  • Stellaris
  • Stellaris: Leviathans Story Pack
  • Stellaris - Path to Destruction bundle
  • Crusader Kings II: Sons of Abraham
  • 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: Charlemagne
  • Cities in Motion
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Hearts of Iron III
  • 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 Motherland
  • Crusader Kings II: Monks and Mystics
  • Europa Universalis IV: Mandate of Heaven
  • Hearts of Iron IV: Together for Victory
  • Stellaris: Digital Anniversary Edition
  • Europa Universalis IV: Rights of Man
  • Crusader Kings II: Reapers Due
  • Hearts of Iron IV: Cadet
  • Stellaris Sign-up
  • Victoria 3 Sign Up
  • Crusader Kings II: Conclave
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Common Sense
  • Pillars of Eternity
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: El Dorado
  • Cities: Skylines
  • Warlock: Master of the Arcane
Well with my devouring swarm game I can confirm that the game still ticks slow every day after eating the entire galaxy, with no ships moving, no ai doing anything, no sector ai turned on, and no trade happening, so this is a plausible explanation for the game running slow as time progresses since more jobs and pops are filling up the galaxy.

I'm not sure how helpful this speculation is, since the devs have much better tools available for checking exactly how long each part of the engine is running for each game day and I'm sure they are already working on solutions to the problem.
 

RoverStorm

Curator's Pet Faerie Dragon, Kin of Ether Drake
74 Badges
Jul 27, 2016
1.653
816
  • Europa Universalis IV: Mandate of Heaven
  • Stellaris
  • Stellaris: Galaxy Edition
  • Hearts of Iron IV: No Step Back
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV: Colonel
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Rights of Man
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Hearts of Iron IV: Together for Victory
  • Crusader Kings II: Monks and Mystics
  • Stellaris: Distant Stars
  • Victoria 3 Sign Up
  • Surviving Mars
  • Hearts of Iron IV: Death or Dishonor
  • Europa Universalis IV: Dharma
  • Age of Wonders III
  • Europa Universalis IV: Cradle of Civilization
  • Surviving Mars: First Colony Edition
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Europa Universalis IV: Rule Britannia
  • Surviving Mars: Digital Deluxe Edition
  • Crusader Kings II: Holy Fury
  • Crusader Kings II: Charlemagne
  • Crusader Kings III: Royal Edition
  • Stellaris: Federations
  • Hearts of Iron IV: La Resistance
  • Prison Architect: Psych Ward
  • Stellaris: Lithoids
  • Stellaris: Ancient Relics
  • Surviving Mars: First Colony Edition
  • Europa Universalis IV
  • Prison Architect
  • Europa Universalis IV: Golden Century
  • Island Bound
  • Crusader Kings III
  • Europa Universalis 4: Emperor
  • Victoria 2
  • Stellaris: Necroids
  • Stellaris: Nemesis
  • 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
  • Europa Universalis IV: Third Rome
Can you be confident that the checks are actually occurring every day for all jobs if nothing changes? Your experiment only shows that the system will recalculate some job assignments when a change in the population pool relevant to that job occurs.
I believe I can help answer this: yes. I was modding in a custom job, and I forgot to give it a weight modifier increase if the job was already held (e.g. 5 times weight to Admin if a pop is already an admin). This resulted in a lower pop (we'll call it Pop1) being promoted and replacing the current pop (Pop2) working that job. Then the next day, Pop2 (who was still higher than lower pops despite being unemployed) took back their job and kicked out Pop1. Pop1 then took back their job the next day, and this went on indefinitely. Every single day of the year, they replaced each other and kept taking the same job every single day.
 

Ryika

Field Marshal
52 Badges
Apr 16, 2018
2.845
8.471
I believe I can help answer this: yes. I was modding in a custom job, and I forgot to give it a weight modifier increase if the job was already held (e.g. 5 times weight to Admin if a pop is already an admin). This resulted in a lower pop (we'll call it Pop1) being promoted and replacing the current pop (Pop2) working that job. Then the next day, Pop2 (who was still higher than lower pops despite being unemployed) took back their job and kicked out Pop1. Pop1 then took back their job the next day, and this went on indefinitely. Every single day of the year, they replaced each other and kept taking the same job every single day.
I also tested this intentionally a while ago (after seeing a post on reddit about how Glavius AI made pops jump around like crazy), with a very simple, modded setup:

Just by adding...
Code:
modifier = {
    factor = 0.1
    has_job = miner
}
...to the worker jobs, in this case the miner job (to make it so once a pop takes the job, it thinks it's ill-fitted for the job).

If this is done for all worker jobs and some worker jobs are available, the result is that worker pops jump in and out of their jobs every day even if nothing happens in the empire.

Unless I'm missing something, this should be direct and conclusive evidence that weights are recalculated on every day.
 

Pointyearedgit

General
66 Badges
Apr 23, 2017
1.956
1.257
  • BATTLETECH: Season pass
  • Stellaris: Ancient Relics
  • Hearts of Iron IV: Expansion Pass
  • Imperator: Rome
  • Surviving Mars: Digital Deluxe Edition
  • Hearts of Iron IV: Expansion Pass
  • Crusader Kings II: Monks and Mystics
  • Hearts of Iron IV: La Resistance
  • BATTLETECH
  • Surviving Mars
  • Hearts of Iron IV: Death or Dishonor
  • Stellaris: Federations
  • Crusader Kings II: Jade Dragon
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Imperator: Rome Sign Up
  • BATTLETECH - Digital Deluxe Edition
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Distant Stars
  • Surviving Mars: First Colony Edition
  • Crusader Kings II: Holy Fury
  • Imperator: Rome Deluxe Edition
  • VtM - Bloodlines 2 Blood Moon Edition
  • Surviving Mars: First Colony Edition
  • Stellaris: Digital Anniversary Edition
  • Crusader Kings III
  • Crusader Kings III: Royal Edition
  • Empire of Sin
  • Stellaris: Necroids
  • Stellaris: Nemesis
  • Europa Universalis IV
  • Crusader Kings II: Way of Life
  • Pillars of Eternity
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Conclave
  • Stellaris
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Age of Wonders: Planetfall Sign Up
  • Stellaris: Lithoids
  • BATTLETECH: Heavy Metal
  • Crusader Kings II: Reapers Due
  • Stellaris: Leviathans Story Pack
  • BATTLETECH: Flashpoint
  • Stellaris: Distant Stars Pre-Order
  • Europa Universalis IV: Res Publica
  • Knights of Pen and Paper +1 Edition
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Sunset Invasion
Can you be confident that the checks are actually occurring every day for all jobs if nothing changes? Your experiment only shows that the system will recalculate some job assignments when a change in the population pool relevant to that job occurs.

Inferring the first is true from the second being true seems like a logical leap.

We know 2.2.2 reduced daily job calculations:

###################
# Performance
###################

* Fixed performance drop in the resettlement view
* Fixed one source of lag on daily ticks
* Reduced needless daily job related calculations

It seems reasonable to assume, even if we can't be certain. I have suspected this is the problem for some time, as lag seems to increase as the number of pops in the galaxy increases in quantity and variety, and is particularly bad with xenocompatibility, but seemingly unavoidable even with single species hive minds.

It's hard to say what a proper fix should be, the AI seems to have similar planets across the board, but a human player is far more likely to specialize planets (at least during initial development), so a change on one planet may mean that shifting jobs on another is necessary (i've done this manually in SP plenty of times)
 

icon41gimp

Colonel
41 Badges
Mar 9, 2008
933
20
  • Crusader Kings II
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Res Publica
  • Rome Gold
  • Stellaris - Path to Destruction bundle
  • Stellaris: Leviathans Story Pack
  • Tyranny - Bastards Wound
  • Stellaris: Nemesis
  • Age of Wonders III
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Stellaris: Distant Stars
  • Surviving Mars: First Colony Edition
  • Stellaris: Megacorp
  • Surviving Mars: First Colony Edition
  • Stellaris: Ancient Relics
  • Stellaris: Lithoids
  • Stellaris: Federations
  • Crusader Kings III
  • Crusader Kings III: Royal Edition
  • Stellaris: Necroids
  • Europa Universalis IV
  • Surviving Mars
  • Europa Universalis IV: Mandate of Heaven
  • Stellaris: Digital Anniversary Edition
  • Tyranny: Archon Edition
  • Europa Universalis IV: Rights of Man
  • Hearts of Iron IV: Cadet
  • Stellaris Sign-up
  • Rome: Vae Victis
  • Stellaris
  • Europa Universalis IV: Mare Nostrum
  • Europa Universalis IV: Cossacks
  • Europa Universalis IV: Common Sense
  • Europa Universalis IV: El Dorado
  • 500k Club
  • Imperator: Rome
  • Stellaris: Synthetic Dawn
  • Tyranny - Tales from the Tiers
I believe I can help answer this: yes. I was modding in a custom job, and I forgot to give it a weight modifier increase if the job was already held (e.g. 5 times weight to Admin if a pop is already an admin). This resulted in a lower pop (we'll call it Pop1) being promoted and replacing the current pop (Pop2) working that job. Then the next day, Pop2 (who was still higher than lower pops despite being unemployed) took back their job and kicked out Pop1. Pop1 then took back their job the next day, and this went on indefinitely. Every single day of the year, they replaced each other and kept taking the same job every single day.

I'm not disputing that the process can get into loops like this. What I am saying is that in this scenario each day the job "environment" on a planet changes so the job calculation is likely forced to run again. In most in-game circumstances that environment only changes at specific times - new jobs are created, new pop is grown, resettlement, refugees arrive, etc. It's not necessarily clear that all the job calculations are being run each day when the system is in steady state.