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

ItThatAltersSanity

First Lieutenant
69 Badges
Oct 26, 2017
270
745
  • Stellaris: Ancient Relics
  • Surviving Mars
  • Age of Wonders III
  • Europa Universalis IV: Cradle of Civilization
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Europa Universalis IV: Rule Britannia
  • Surviving Mars: Digital Deluxe Edition
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Distant Stars
  • Europa Universalis IV: Dharma
  • Surviving Mars: First Colony Edition
  • Crusader Kings II: Holy Fury
  • Europa Universalis IV: Golden Century
  • Prison Architect
  • Hearts of Iron IV: Death or Dishonor
  • Stellaris: Lithoids
  • Prison Architect: Psych Ward
  • Hearts of Iron IV: La Resistance
  • Stellaris: Federations
  • Crusader Kings III
  • Battle for Bosporus
  • Island Bound
  • Europa Universalis 4: Emperor
  • Empire of Sin
  • Stellaris: Necroids
  • Stellaris: Nemesis
  • Hearts of Iron IV: By Blood Alone
  • Hearts of Iron IV: No Step Back
  • Hearts of Iron 4: Arms Against Tyranny
  • BATTLETECH
  • Europa Universalis IV
  • Europa Universalis IV: El Dorado
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: Common Sense
  • Europa Universalis IV: Cossacks
  • Crusader Kings II: Conclave
  • Stellaris
  • Hearts of Iron IV: Cadet
  • 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
  • Europa Universalis IV: Mandate of Heaven
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Republic
Decided to do some actual science instead of relying on a pre-4.0 formula or tooltips.

= Method

Start a game as UNE (200 star, elliptical galaxy, Ensign difficulty). Never expand, just note down the total population of Earth every month then plot on scatter graph.
- Make a save at game start to revert to (so leaders are the same)
- Finish the initial happiness agenda from the council, don't start another agenda
- Don't pick any tradition

Bonus: if on Windows, open Task Manager and look at the Memory usage of stellaris.exe while doing this long experiment.

== Control Group

Don't build any districts, don't clear any blockers.

== More Housing Group

Build 2 mining districts, 1 city district, clear 1 blocker (which won't give more pops), build 1 more city district. This creates a lot more housing.

= Results

== Diff per Month

diff_plot.png


== Total Population


pop_plot.png


= Analysis

The pop growth is random. Even loading the same save to go back a few months to watch makes the population numbers different.

From a performance perspective, it makes sense that 4.0 uses RNG to decide when pops grow. Remembering partial growth progress means storing more data, which in turn needs to be retrieved to do the calculation. To get into developer-speak, if that data is in the RAM, that's 100 times slower to fetch than if it was in the CPU's L1 cache. So making pop growth be "stateless" (nothing to remember, just calculate) is good for performance. This is probably why really tiny colonies don't seem to grow: you'd likely need great RNG rolls to get more pops.

The RNG means these graphs are too noisy to draw conclusions from. I still believe having more unused housing is better for growth. Not feeling up to doing full statistical rigour to calculate the correct error bars on these data points.

= Evaluation

I'd like someone to try replicating this experiment to see how RNG the real growth is. Maybe also play with `fast_forward` console command.

Edit: another experiment down below.
 
Last edited:
  • 16
  • 4Like
  • 1Love
Reactions:
“Yeah…Science, bleep!” meme intensifies

Appreciate your hard work! Nice to see how the engine works under the hood. Suggestions for various controls/variables for when you feel like doing more science:

1. Mono species empire Vs a rainbow (single world would be sufficient for this purpose to then extrapolate to the below):

2. Single world vs arbitrary number of low pop worlds being fed by auto migrate

3. Single world vs arbitrary number of minimum 10k pop worlds

Curious if end game pop numbers would be drastically different or not. Will eventually see for myself thru my various runs but as Adam Savage said, “The difference between screwing around and science is writing it down.”
 
Good job! I'd be curious to see a similar attempt but with +growth rate modifiers added, like from rapid breeders. Also, isn't extra housing meant to INCREASE pop growth? Her it seems to have done the opposite...
 
  • 1
Reactions:
1. Mono species empire Vs a rainbow (single world would be sufficient for this purpose to then extrapolate to the below):
If the starting deficits have been resolved, Broken Shackles might be an easy way to test this out. It is a different start type than UNE, but at least it gives you multiple species on your starting world so you can start the test right away, instead of needing to acquire other species first.

The starting differences however might take some work to translate into a fair comparison against a mono-species UNE. Depends on how big a deal those starting techs are for pop growth purposes, rather than just economy purposes.
 
  • 2
Reactions:
The amount of 0 growth months for the "more housing" set is strange to me. The way I see it, they both want to trend to 3 at first and then more housing bumps up to 4 at around months 50. It's just the 0 growth months that's bringing down the curve.
 
  • 3
Reactions:
= Analysis

The pop growth is random. Even loading the same save to go back a few months to watch makes the population numbers different.

From a performance perspective, it makes sense that 4.0 uses RNG to decide when pops grow. Remembering partial growth progress means storing more data, which in turn needs to be retrieved to do the calculation. To get into developer-speak, if that data is in the RAM, that's 100 times slower to fetch than if it was in the CPU's L1 cache. So making pop growth be "stateless" (nothing to remember, just calculate) is good for performance. This is probably why really tiny colonies don't seem to grow: you'd likely need great RNG rolls to get more pops.

The RNG means these graphs are too noisy to draw conclusions from. I still believe having more unused housing is better for growth. Not feeling up to doing full statistical rigour to calculate the correct error bars on these data points.

= Evaluation


I'd like someone to try replicating this experiment to see how RNG the real growth is. Maybe also play with `fast_forward` console command.
The data doesn't support this particular conclusion though. As someone else noted, it would be roughly equal if the strange trend of having 0 growth for months on end was removed. But it's still not any better, at least not appreciably.

I think that zero growth thing needs to be investigated though- I wonder if there's any correlation there to how often the game was loaded and the RNG draw getting stuck/resetting?

Anyways, I'd really like to see a test done of the colonize lots of planets versus colonize nothing. It's still not clear to me if there's an optimal growth strategy. Pop growth really should not be tied to your global population, but the local population. The current system makes zero sense.
 
  • 1Like
Reactions:
Are you instant-building your districts, or building them over time? If you're building them over time and it's like 3.x, then building the mining districts actually reduces carrying capacity - if we assume the capacity formula is effectively 100x the 3.x formula (i.e. housing + 400 * available unbuilt districts), then building the 2 mining districts reduces the capacity by 200 each, building each city district adds 200 capacity (+600 for housing, -400 for reducing available unbuilt districts), and clearing the blocker adds 400 capacity. From the time the first mining district is built until the time the blocker gets cleared, the "more housing" version should have less room to grow:
EventMining District 1 BuiltMining District 2 BuiltCity District 1 BuiltBlocker ClearedCity District 2 Built
Time (Months)816323652
Capacity Difference-200-400-200+200+400
So we would expect the pop growth of the "more housing" test to start to slow down at month 8, become increasingly slow at month 16, and speed up a bit at months 32, 36, and 52 (and the pop difference from the months at reduced growth should make it take some more time for growth to catch up once the capacity surpasses the control version). Just eyeballing it, this roughly matches the curves you've drawn on the pops/time graph.
 
  • 5
Reactions:
So I ran the experiment. I modified it slightly through not launching the agenda and just building 2 city districts. This way I don't have any interactions after the start.

Change.png

Total.png

Blue is the control without additional housing district.
This collection does seem to indicate that having the additional housing does indeed increase average pop growth. However total pop growth is mostly affected by a few random events of massive flux, that being a +103 and a -33 for the control group, plus the +100/-100 for both runs on the first 2 months.
This however does only take into consideration the noted pop change numbers on the management tab, which are erroroneus. Adding all the changes onto the base 5.2k we would come out at 5616 and 5626 for the control and experiment group respectively. The actual values determine on the pop number however are 5508 and 5575. I am ready to admit that there may have been a handful of mistakes in transcribing, but I do not believe them to have been enough to explain for such a significant difference.
 
  • 2Like
  • 2
Reactions:
Are you instant-building your districts, or building them over time? If you're building them over time and it's like 3.x, then building the mining districts actually reduces carrying capacity
EventMining District 1 BuiltMining District 2 BuiltCity District 1 BuiltBlocker ClearedCity District 2 Built
Time (Months)816323652
Capacity Difference-200-400-200+200+400
So we would expect the pop growth of the "more housing" test to start to slow down at month 8, become increasingly slow at month 16, and speed up a bit at months 32, 36, and 52 (and the pop difference from the months at reduced growth should make it take some more time for growth to catch up once the capacity surpasses the control version). Just eyeballing it, this roughly matches the curves you've drawn on the pops/time graph.
Built naturally over time. Hmm, so if undeveloped districts affects planet capacity... Next experiment is to convert the starting Archives into the extra housing zone. I should use console commands this time.

If someone else hasn't done it, I'll look at this in... at least 12 hours from now.
 
Built naturally over time. Hmm, so if undeveloped districts affects planet capacity... Next experiment is to convert the starting Archives into the extra housing zone. I should use console commands this time.

If someone else hasn't done it, I'll look at this in... at least 12 hours from now.
Not sure if it answer your needs but here is the latest formula/graph courtesy of xenex in discord.
1.

www desmos com/calculator/ylbzrt7wgf

The graph is for minimum housing needed for a given pop to get full base growth bonus.
Base growth bonus, then is modified by growth bonuses,migration and other factors.

2.
Base logistic growth formula is:
"
`growth = pops / 400 * (capacity - pops) / capacity`, capped between 0.1 as minimum, and your logistic growth setting as maximum (5 by default)

where `pops` = number of pops in the planet
and `capacity = free_housing + planet_mult*free_districts + pops` (NOT what the game shows you as the capacity)
here, `planet_mult` is 400 for normal worlds, 300 for tomb worlds, 600 for gaia worlds
"

-from synaptic drone in stellaris discord.

3.
As mentioned in the patch notes, fractional/decimal/partial pop growth is now rng instead saved up. So growth will not be exactly identical/it is rng.


Feel free to join us in stellaris discord > guides > ideal pop growth method
If you have more questions
 
Last edited:
  • 1
Reactions:
synaptic posted his findings on reddit, so you can read it there also.
It does directly address your RNG, but at least it can answer your base growth numbers.. minus the migration part.

www reddit com/r/Stellaris/comments/1kifurt/population_growth_in_40_how_it_works_and_how_it/
 
  • 1
Reactions:
== Instant City Group

Load game start save, toggle `instant_build` in console, also do `minerals 5000`, then:
- replace The Archives with Urban Expansion district specialisation
- build Admin Office
- build 3 city districts
- unpause for a few days

Turn off `instant_build`

= Results

pop_plot2.png

diff_plot2.png


= Analysis

Much more convincing results. The previous plots had me skeptical but now that I took in "unused districts" into the equation, the results are clear cut. If a district isn't adding a lot of housing, it's reducing pop growth.

Destroying all your science isn't normal gameplay behaviour but this was a useful experiment. Sometimes I have to see things on a scatter plot to comprehend what's going on.
 
  • 2
Reactions:
== Instant City Group

Load game start save, toggle `instant_build` in console, also do `minerals 5000`, then:
- replace The Archives with Urban Expansion district specialisation
- build Admin Office
- build 3 city districts
- unpause for a few days

Turn off `instant_build`

= Results

View attachment 1294476
View attachment 1294477

= Analysis

Much more convincing results. The previous plots had me skeptical but now that I took in "unused districts" into the equation, the results are clear cut. If a district isn't adding a lot of housing, it's reducing pop growth.

Destroying all your science isn't normal gameplay behaviour but this was a useful experiment. Sometimes I have to see things on a scatter plot to comprehend what's going on.
You could just build a luxury apartment building instead and it would cover your housing need for optimal growth for some time.
 
If an abstract Pop growth mechanism speeds turn processing then I am all for it. This is similar to the former trade route calculations. I liked trade routes, but the abstraction is an improvement.
 
Not sure if it answer your needs but here is the latest formula/graph courtesy of xenex in discord.
1.

www desmos com/calculator/ylbzrt7wgf

The graph is for minimum housing needed for a given pop to get full base growth bonus.
Base growth bonus, then is modified by growth bonuses,migration and other factors.

2.
Base logistic growth formula is:
"
`growth = pops / 400 * (capacity - pops) / capacity`, capped between 0.1 as minimum, and your logistic growth setting as maximum (5 by default)

where `pops` = number of pops in the planet
and `capacity = free_housing + planet_mult*free_districts + pops` (NOT what the game shows you as the capacity)
here, `planet_mult` is 400 for normal worlds, 300 for tomb worlds, 600 for gaia worlds
"

-from synaptic drone in stellaris discord.

3.
As mentioned in the patch notes, fractional/decimal/partial pop growth is now rng instead saved up. So growth will not be exactly identical/it is rng.


Feel free to join us in stellaris discord > guides > ideal pop growth method
If you have more questions
Worth noting that this the same formula it's used for a long, long time, but with the constants changed for 3.0 and 0.125 to 1.0 and 0.0025.

Aside from the 100x rescaling, it's just 2/3 what it was before.

That formula is just a standard logistic growth formula i.e. R*p*(1-p/K), where K is the maximum population (capacity) and R is some arbitrary scaling constant.

'Twas always thus.
 
Last edited:
  • 1
Reactions: