• 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.
Isn't what I got out of it. What I got out of it is ideally you limit the amount of decisions pops can make, thus lowering the amount of processing necessary. Phrased differently, If pops have nowhere to go because every job is filled and all pops are happy where they are at there isn't much to calculate. At least, not anywhere near as much to calculate.

You do this by wiping out all AI empires and putting all POPs under your control. Then you get to make sure there are not too many vacant jobs or POPs. Any genocidal empire would be able to do this faster thanks to Total War from the start.
 
Hang on. I don't get this.

The game is constantly checking whether it should juggling pops around in existing jobs based on traits. Like, if you give some pops a new trait that makes them good at mining then all the ones of right stratum become miners pretty much that day.

This doesn't seem that disastrous to performance or else the OP (yes, I know the thread has been merged but whatever) would not have discovered such a strong correlation between bad performance and vacant jobs.

But what is it that makes vacant jobs so special? They are doing basically the same checks filled jobs are doing when they decide if pops need to be swapped around. Are those calculations (for existing jobs) not being done on a tick but rather only triggered when the game says they need to be done? Like, when you modify pops the game just goes 'you need to check the jobs on all the planets now'.

But if that's the architecture, then why on earth are vacant jobs doing checks on ticks, when the game can just go "vacant jobs, check the entire population when you're created, or when jobs checked trigger fires, otherwise check new pops as they're created"? Like this is very basic optimist-this-resource-heavy-bit-of-code-by-only-running-it-when-you-need-to stuff here, I find it hard to believe a bunch of professional game devs would miss it. And if it's not the architecture, then why are vacant jobs such a problem?

I think there is probably something more going on that we can't figure out without access to the source code.

That, or I'm missing some reason why vacant jobs need to constantly check the entire population of the planet for applicants, like those recruitment agencies that constantly spam your inbox.
 
Nice analogy with recruitment agencies. On the other hand, Stellaris 2.2 was released with #TODO in place of crisis purging occupied planets code, so...
 
It's a shame that @GnoSIS's findings were moved to this megathread. I highly doubt it will be seen by any devs now.
 
Unless I'm missing something, the jobs on a planet only need to be checked if:
  • there's a new pop or there are now fewer pops
  • there's a new job or a job got removed
  • some pops changed their traits
  • the player favorited a job or otherwise tinkered with how jobs are weighted
  • the month ticked over and now there's some excess/shortfall of a resource
If none of these things changed since the last calculation, the result of any job calculation should be the same as it was the last time it was calculated. You would still have the same group of pops, with the same trait distribution, with the same set of possible jobs. The first two conditions only trigger every few months or even years per planet, the third and fourth only occur due to player input, which tends to be uncommon, and the final one is arguably unnecessary for most human players, who can just shuffle around jobs manually. Notably, the last one is the most frequent, and it triggers a maximum of once per month.

So going out on a limb and assuming that's all true, then jobs don't need to be re-evaluated on a regular basis. If that is the case, it would make sense to have assigning jobs be a triggered calculation, rather than a constant one.
 
Hang on. I don't get this.

The game is constantly checking whether it should juggling pops around in existing jobs based on traits. Like, if you give some pops a new trait that makes them good at mining then all the ones of right stratum become miners pretty much that day.

This doesn't seem that disastrous to performance or else the OP (yes, I know the thread has been merged but whatever) would not have discovered such a strong correlation between bad performance and vacant jobs.

But what is it that makes vacant jobs so special? They are doing basically the same checks filled jobs are doing when they decide if pops need to be swapped around. Are those calculations (for existing jobs) not being done on a tick but rather only triggered when the game says they need to be done? Like, when you modify pops the game just goes 'you need to check the jobs on all the planets now'.

But if that's the architecture, then why on earth are vacant jobs doing checks on ticks, when the game can just go "vacant jobs, check the entire population when you're created, or when jobs checked trigger fires, otherwise check new pops as they're created"? Like this is very basic optimist-this-resource-heavy-bit-of-code-by-only-running-it-when-you-need-to stuff here, I find it hard to believe a bunch of professional game devs would miss it. And if it's not the architecture, then why are vacant jobs such a problem?

I think there is probably something more going on that we can't figure out without access to the source code.

That, or I'm missing some reason why vacant jobs need to constantly check the entire population of the planet for applicants, like those recruitment agencies that constantly spam your inbox.
My best guess is that vacant jobs do indeed only cause a recalculation once created. But since the job juggling causes a change in the produced goods and therefore a reprioritization of jobs the vacant jobs find workers and therefore their former workplaces become new vacant jobs. Thus starting an inifinite loop.
Alternatively it could be a resource deficit triggering the reshuffling to the same effect.
 
Some remarks on quick comparison of save games (ironman.sav (left) and 2459.02.02_whysoslow.sav (right)).

comp.png


First remark: the galaxies are not of the same size. The huge galaxy will not only have more pops (employed or not) and planets, but more empires (thus more AI time will be spent), more systems (thus more expensive path-finding), basically more of all kind of things that will negatively affect performance.

Second remark: the tiny galaxy has all the AI empires eliminated, thus most of the points from remark above are not present and not affecting performance.

This means you have highly optimized not only pops\jobs, but about every single thing possible. Comparing such an optimized case with somewhat worst case scenario (huge galaxy) might lead you to overestimation of pops\jobs impact on performance.
 
Some remarks on quick comparison of save games (ironman.sav (left) and 2459.02.02_whysoslow.sav (right)).

View attachment 523132

First remark: the galaxies are not of the same size. The huge galaxy will not only have more pops (employed or not) and planets, but more empires (thus more AI time will be spent), more systems (thus more expensive path-finding), basically more of all kind of things that will negatively affect performance.

Second remark: the tiny galaxy has all the AI empires eliminated, thus most of the points from remark above are not present and not affecting performance.

This means you have highly optimized not only pops\jobs, but about every single thing possible. Comparing such an optimized case with somewhat worst case scenario (huge galaxy) might lead you to overestimation of pops\jobs impact on performance.

You are comparing the wrong saves. There are 3 saves for the federationn of planets, not 1.
 
You are comparing the wrong saves. There are 3 saves for the federationn of planets, not 1.
I haven't looked into these, yes, so no remarks on numbers you got after optimization.

Mainly highlighted that one cannot compare bots to federation cases. They are listed one after the other and may lead to confusion.

Addition.
It seems that in federation save there are no wars/hostilities going on. It might be interesting to manually start some and check overall performance in reference and optimized save.
 
Last edited:
Yet another ‘Elephant in the Room’ was always the fact that pop growth was not based on existing population. In a full planet, we should be getting x% of the total pops per year they saying goes. So if Pop growth was 5% that would be 10 pops in a 200 pop world. For this to work we need long term pop sinks. Perhaps megastructures could have unique infinite jobs that provide some benefit? Game score? But you can see that once you fill a planet up, you can fill the entire galaxy with pops in 5-10 years. Such change requires the galaxy to be much more hostile to pop life in general – or expect pop growth speed to vary greatly from time to time or even entirely stop.

Probably an irrelevant note from me, but: Thrall Worlds have something like this, where any slaves who aren't working a normal job get stuffed into an infinite "Toiler" job instead.
 
Science has proven what I have long suspected; that this game is only play-tested with genocidal empires.
 
Stellaris Immortal is a cool new mod that tried scaling down the pop numbers, jobs and growth rates. Processing is easier because there are less vacant jobs and the planets have less pops to check when they do so. You can combine the new play style with this mod and play even huge galaxies!

I did it in a mod of mine. It's a big effort to rebalance everything according to this, but I can attest it works to chop down the lag a good bit.
 
If only we could simply select what species do what jobs instead of the game calculating what job is better filled by what pop every day (and always failing to give the best output, specially with robots). A request that has been made since day one of 2.2