pmotschmann / Evolve

An incremental game about evolving a civilization
Mozilla Public License 2.0
839 stars 361 forks source link

Set high population growth scaling to a smaller penalty #1082

Open yarukishi opened 7 months ago

yarukishi commented 7 months ago

The insect species have a long-standing population growth issue, where it isn't possible for them to meaningfully fill their population. It would be nice if they didn't have this enormous penalty to their rate of worker acquisition. I offer a potentially controversial patch as a solution.

The growth function for population is a random function whose difficulty is directly related to the current size of the population. Therefore, if a normal race has x population, then the insect race has kx population, and it needs to grow k^2 times as easily to fill its population at an equivalent speed to the normal population race, in terms of work performed.

Currently, high population is scaled such that the growth rate is scaled by k - 0.5, so r1 high population has 4x population and 3.5x growth, and r2 high population has 5x population with 4.5x growth. These figures mean that population growth in terms of work capacity is around 22% of normal at r1 and around 18% of normal at r2.

This patch scales each value from (k - 0.5) to (k^2 - 0.5k). This means that r1 will grow at 87.5% speed, and r2 will grow at 90% speed, when considering units of work capacity, rather than literal units of population. After this adjustment, the actual growth rate of insect species will usually be higher than normal prior to researching Fertility Clinics, due to the Fast Growth genus trait, and it will usually be slightly slower than normal after researching Fertility Clinics. This may be too fast, but I think it more closely represents the intended effect, where high population is mostly flavor.

Attached is an example save file at the end of an ascension reset, having made significant effort to maximize population growth. Population generally remained around 500 units below the cap for the entire run. Other races constantly hover around the population cap, falling below only when surveyors die. evolve-2024-02-19-16-27.txt

CondoSlime commented 7 months ago

An alternative solution to this is to add high population scaling to the code that handles citizen growth. The higher your population, the slower growth is. This value could be divided if you have high pop. I personally think that is a better solution than inflating the trait values of high pop.

yarukishi commented 7 months ago

I originally considered implementing this by taking the high pop growth adjustment in main.js and multiplying it by jobScale(1), the population size adjustment, which would keep the “apparent” growth adjustment intact.

The variable that controls population growth rate has no other purpose, so I changed to this method, instead. They’re equivalent in my change, because the scaling factor is currently the same, so I don’t have a strong opinion on it.

yarukishi commented 7 months ago

I noticed that soldier growth and healing rates also use the same growth variable, so it's better to directly adjust the difficulty of population growth, as Condo suggested.

It's equivalent to multiply the growth success threshold (lowerBound) or to divide the size of the population (base -> upperBound), but it seems more intuitive to the reader if we divide the size of the population. I updated the request to reflect this change.

yarukishi commented 1 month ago

Rebased from 1.4.0 to 1.3.13.