Population curves

For what's not in 'Top Priority Game Design'. Post your ideas, visions, suggestions for the game, rules, modifications, etc.

Moderator: Oberlus

Message
Author
wobbly
Cosmic Dragon
Posts: 1880
Joined: Thu Oct 10, 2013 6:48 pm

Re: Population curves

#16 Post by wobbly »

Ophiuchus wrote: Mon Dec 27, 2021 11:42 am Besides total empire population growth, distribution is still important. Especially there needs to be a way to go tall/use metropolis.
You want more population on those planets where you get more bonus per population - that are probably planets with specials and/or high stability.
I guess one way to do it is for adopting metropoles to create migration towards the large population centres, which fits fluffwise though I'm not sure of the mechanical repercussions. Anything that creates migration or growth based on stability has interesting repercussion for colonial bootstrapping. As you'd increase grow in the early stages of the stability bonus. There's also possibilities of making centralisation affect growth rate/migration based on distance from the capital/regional admins.

Ophiuchus
Programmer
Posts: 3433
Joined: Tue Sep 30, 2014 10:01 am
Location: Wall IV

Re: Population curves

#17 Post by Ophiuchus »

Grummel7 wrote: Mon Dec 27, 2021 1:59 pm Re: Parabolic Curve: The idea is okay and after pondering on it I found that the problem with the current calculation is that it grow quadratic with the target size. I.e. the first step (when you start from 1) is linear to the target size, but towards the middle, it becomes quadratic and that is why big planets fill quicker then small ones.
Ah, that explains the difference. Dividing by target pop should make that much more even. (Linear in the middle and constant-like near the edges).
Grummel7 wrote: Mon Dec 27, 2021 1:59 pm Re: Global growth: How would you implement that? How would you decide which planet gets how many settlers? And will it work independently of supply chain?
In FOCS calculate an average growth rate per species from the sum of all target meters vs sum of all meters. Use the average growth rate in the planet local formula. I can not think of a good way of targeting supply groups, so i would ignore those.
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

Look, ma... four combat bouts!

User avatar
LienRag
Cosmic Dragon
Posts: 2148
Joined: Fri May 17, 2019 5:03 pm

Re: Population curves

#18 Post by LienRag »

wobbly wrote: Mon Dec 27, 2021 2:11 pm I guess one way to do it is for adopting metropoles to create migration towards the large population centres, which fits fluffwise though I'm not sure of the mechanical repercussions. Anything that creates migration or growth based on stability has interesting repercussion for colonial bootstrapping. As you'd increase grow in the early stages of the stability bonus. There's also possibilities of making centralisation affect growth rate/migration based on distance from the capital/regional admins.
Interesting ideas...

User avatar
Grummel7
Space Dragon
Posts: 335
Joined: Mon Oct 09, 2017 3:44 pm

Re: Population curves

#19 Post by Grummel7 »

Ophiuchus wrote: Mon Dec 27, 2021 2:24 pm In FOCS calculate an average growth rate per species from the sum of all target meters vs sum of all meters. Use the average growth rate in the planet local formula. I can not think of a good way of targeting supply groups, so i would ignore those.
Ah, so you e.g. when you have 3 planets, with say 20/20, 5/10 and 1/10, you'll calculate the growth for (20+5+1)/(20+10+10) = 26/40, divide the result by 3 and then planets 2 and 3 with grow by that amount. Correct?

There are actually two reasons why I do not like it.
  1. The simple fact that it ignore supply chains.
  2. The fact that settlers "magically" travel faster than any space ship (but okay, that problem exists with Evacuation as well)
  3. The overall growth you'll get depends on the relation of full to empty planets. E.g. if you have 9 full planets and one that is half full, that planet will grow very slowly since it would get 1/10 of the overall growth, although a half full planets would grow rather fast on its own.
Of course we could divide only by the number of non-full planets, that would at least cancel the last argument.

Ophiuchus
Programmer
Posts: 3433
Joined: Tue Sep 30, 2014 10:01 am
Location: Wall IV

Re: Population curves

#20 Post by Ophiuchus »

Grummel7 wrote: Tue Dec 28, 2021 10:38 am
Ophiuchus wrote: Mon Dec 27, 2021 2:24 pm In FOCS calculate an average growth rate per species from the sum of all target meters vs sum of all meters. Use the average growth rate in the planet local formula. I can not think of a good way of targeting supply groups, so i would ignore those.
Ah, so you e.g. when you have 3 planets, with say 20/20, 5/10 and 1/10, you'll calculate the growth for (20+5+1)/(20+10+10) = 26/40, divide the result by 3 and then planets 2 and 3 with grow by that amount. Correct?
No, my basic Idea was to take that average 0.217 (26/40/3) and apply it in the-yet-to-be-specified local formula. I guess you suggested there local SetPop(pop + pop * GROWTH_AVG). I thought rather something like SetPop(pop + f(pop, target_pop, GROWTH_POP)). One could factor in difference of population from the median of global population to address empty-vs-full planets. Anyway thinking about it, all those formulas would probably not reach the goal of a location-independent growth total.
So lets rather take the amount of population available for reproduction (empire total population of species, 20+5+1) and restrict it by free space for colonization (total sum (target_pop - pop) over that species' colonies, 0+5+9). Maybe similar formula to what Oberlus suggested/some logistic function giving a growth of A*pop * (1-pop/K). We would start with exponential growth, going over fast into linear growth, then . If using something like logistic function, GOOD_GROWTH species could have different parameter, A is maximum per-capita rate of change, K determines the carrying capacity of the population. The carrying capacity of the population is probably a function of the available free space, it should be 0 if the total capacity is reached, so K is actually the (sum of) target population. In the example the total population should grow by e.g. (0.2 * 26* (1- (26/40)) == 1.82. The strongest growth is 2.00 at 20.0 population. First idea for distribution: take the average growth per free population (1.82/14) and multiply locally with free population. That makes sure empty planets get settled most and more importantly full planets do not get any growth.
Grummel7 wrote: Tue Dec 28, 2021 10:38 am
  1. The simple fact that it ignore supply chains.
  2. The fact that settlers "magically" travel faster than any space ship (but okay, that problem exists with Evacuation as well)
  3. The overall growth you'll get depends on the relation of full to empty planets. E.g. if you have 9 full planets and one that is half full, that planet will grow very slowly since it would get 1/10 of the overall growth, although a half full planets would grow rather fast on its own.
Of course we could divide only by the number of non-full planets, that would at least cancel the last argument.
i guess one could also calculate it per supply network if that is superimportant. distributed empires would be back at handling each planet individually as now. OTOH evac is supply-network based, so you do not have the opportunity to do anything without first connecting some planets via supply.

distributing PP is also faster than any ship that could bring produce to another planet (using supply network). just very few effects take distance into account for when to trigger first. the one i can think of is colony buildings build time.

yes, you are right. using directly the average empire-wide is probably not the best global formula (see above suggestion).
Last edited by Ophiuchus on Tue Dec 28, 2021 1:16 pm, edited 1 time in total.
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

Look, ma... four combat bouts!

User avatar
Oberlus
Cosmic Dragon
Posts: 5715
Joined: Mon Apr 10, 2017 4:25 pm

Re: Population curves

#21 Post by Oberlus »

I don't think location independence is superimportant as long as it does not motivate micromanaging.

If we get:
- a building to empty a planet by moving its population to supply-connected, allied, same-species, not-full, randomly-chosen planets,
- a policy about migration-from-old-to-young-worlds to increase pop growth of planets with much free space, or to distribute among them some population taken from supply-connected, nearly-full planets, and
- a policy about migration-from-provinces-to-capitals to reduce pop growth of outer/young/low-current-pop/low-target-pop planets and increase pop growth of central/old/high-current-pop/high-target-pop planets (probably coupled with bigger populations, in a new policy or as an extra effect for a relevant policy like Metropoles).

Then I think player can control quite well their populations whithout having to micromanage based on locations.
And from there, just having a simple formula for base pop growth is best IMO.

The one suggested by Grummel7 is the one I like the most:

Code: Select all

min(TARGET, CURRENT + CURRENT*FACTOR*(TARGET-CURRENT+1)/TARGET)
(complicated with the factors from policies to increase or decrease growth rate.)

Ophiuchus
Programmer
Posts: 3433
Joined: Tue Sep 30, 2014 10:01 am
Location: Wall IV

Re: Population curves

#22 Post by Ophiuchus »

Oberlus wrote: Tue Dec 28, 2021 1:15 pm The one suggested by Grummel7 is the one I like the most:

Code: Select all

min(TARGET, CURRENT + CURRENT*FACTOR*(TARGET-CURRENT+1)/TARGET)
I compared some values from that formula with the total pop logistics formula and for factors 1,0 (grummel7 formula) and factor 1,1 (logistic formula) the resulting growth totals were surprisingly comparable.

In the spreadsheet the total pop formula is of course much simpler as you do not have to consider different distribution scenarios. And of course to me as a micromanager it is a big relief if I dont have to care where the population is in order to maximize growth.

In FOCS the calculation of the local (grummel7) formula is of course simpler; the totals are doable. The main trouble with the total formula is the distribution part.
With the local formula, that is no question (you just calculated growth for the local planet), but scripting spread-this-float-value-over-a-number-of-planets-in-some-weighted-manner is above my head for the moment.
Distribution depending on free space: total_free_space = sum(target_pop - pop), total_growth, local_growth_factor = total_growth / total_free_space ; local_growth = (target_pop - pop) * local_growth_factor. It solves the corner cases of a full planet. It minimizes emptiness, which is probably not always what we want. I think it will tend to make the (pop/target_pop) ratio more uniform.
If distribution would be easy to implement I would prefer the total calculation by a big margin.

From the values i have seen, migration tricks would have a lot less of payoff with grummel formula than we currently have (more uniform growth values on a single planet, lower relative growth difference also with varying target population), so i think it could be good enough.
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

Look, ma... four combat bouts!

Ophiuchus
Programmer
Posts: 3433
Joined: Tue Sep 30, 2014 10:01 am
Location: Wall IV

Re: Population curves

#23 Post by Ophiuchus »

For scaling - with grummel formula, a pop-1 colony with target pop 5 takes 14 turns to reach pop 3, 21 turns to reach pop 4 and is full after 28 turns.

For larger target this pop is slightly faster but not much (and the difference gets less and less). E.g. on a 80 target pop planet, it takes 12 turns to reach pop3, 15 turns to reach pop 4, and 18 turns to reach pop5.

So growth is definitly more wide than tall. But I would intuitively expect that.
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

Look, ma... four combat bouts!

User avatar
Oberlus
Cosmic Dragon
Posts: 5715
Joined: Mon Apr 10, 2017 4:25 pm

Re: Population curves

#24 Post by Oberlus »

Ophiuchus wrote: Tue Feb 08, 2022 9:17 am For scaling - with grummel formula, a pop-1 colony with target pop 5 takes 14 turns to reach pop 3, 21 turns to reach pop 4 and is full after 28 turns.

For larger target this pop is slightly faster but not much (and the difference gets less and less). E.g. on a 80 target pop planet, it takes 12 turns to reach pop3, 15 turns to reach pop 4, and 18 turns to reach pop5.

So growth is definitly more wide than tall. But I would intuitively expect that.
I don't see it wide or tall.
It just favours larger planets growth less than before.
What I see is that it is more balanced regarding randomnes of planet sizes and environment tolerances in the galaxy: if at start you only have low-target-pop planets to colonize, with current formula it takes ages to get those to pop 3 but other empires with better target pops will grow much faster. With suggested formulas the bad luck only hits you after your tiny planets' pop grow to max and the other empires keep growing. But how many turns to be able to build colony ships becomes mostly equalized. I really like that characteristic for multiplayer. Players complaining how they could never win with the start they got is not uncommon.

A side note: I've been struggling with the wide vs tall stuff and that comment by Krikkitone's is so to the point: the lack of individualized building queues as in MoO2, Civ saga, etc. makes creating a real tall vs wide differentiation quite hard to achieve. The no-spammable-buildings directive is also a limiting factor, and there are others.
And so I've been pondering to completely drop the idea tall vs wide and look from another angle: lucky vs unlucky start. Strategies for unlucky starts would be similar in appearance to tall strategies, but designed with FO design principles in mind. Maybe this is another dead end that others have discarded.

User avatar
Grummel7
Space Dragon
Posts: 335
Joined: Mon Oct 09, 2017 3:44 pm

Re: Population curves

#25 Post by Grummel7 »

Sorry, that was nonsense, should have pondered some more before replying.
Preparing a better reply...

User avatar
Grummel7
Space Dragon
Posts: 335
Joined: Mon Oct 09, 2017 3:44 pm

Re: Population curves

#26 Post by Grummel7 »

Ophiuchus wrote: Mon Feb 07, 2022 9:41 pm Distribution depending on free space: total_free_space = sum(target_pop - pop), total_growth, local_growth_factor = total_growth / total_free_space ; local_growth = (target_pop - pop) * local_growth_factor. It solves the corner cases of a full planet. It minimizes emptiness, which is probably not always what we want. I think it will tend to make the (pop/target_pop) ratio more uniform.
If distribution would be easy to implement I would prefer the total calculation by a big margin.
I don't see a problem with distribution, but there are others. Let's see. As far as I see, your idea is to treat a cluster of planets as one big planet, calculate the growth and then distribute it in proportion to the empty space on each planet.

Okay, let's use "my" formula for the overall growth. That would be:

Code: Select all

FACTOR * Sum(CURRENT) * (Sum(TARGET) - Sum(CURRENT) + Count(PLANETS)) / Sum(TARGET)
Note that we have to replace +1 with +(number of planets), otherwise a group of identical planets would grow slower than a single one.

Some planets can be overpopulated (in fact it's possible that Sum(CURRENT) > Sum(TARGET)), but that should not slow the growth on underpopulated planets, so we better re-write the formula to:

Code: Select all

FACTOR * Sum(CURRENT) * (Sum(EMPTY) + Count(PLANETS)) / Sum(TARGET)
For a given planet, the complete formula would then be:

Code: Select all

min(TARGET,
    CURRENT +
    FACTOR * Sum(CURRENT) * (Sum(EMPTY) + Count(PLANETS)) / Sum(TARGET) *
    EMPTY / Sum(EMPTY))
The remaining question is, which planets should be grouped into a cluster. I think it should be obvious that they must have the same species. Supply chain could be taken into account as well.

Now how will this affect the game?

Suppose you found a colony and in the same turn conquer a small colony with a different species. In this case the own colony will grow a lot faster. In fact, unless the factor is chosen very small, empires in general will grow a lot faster. And if it is chosen very small, single species planets will grow very slowly.

If supply chain is taken into account, we'll have to find a compensation for Sly / Confederation, or I think they will become unplayable.

If supply chain is ignored, we can have a weird situation where a conqueror blockades a system with a small colony and delays the invasion while watching settlers arrive.

Perhaps ignoring supply chains, but not blockades could be a way to go, i.e. blockaded planets will be handled individually, otherwise all same species planets of an empire are handled as one cluster.

User avatar
Oberlus
Cosmic Dragon
Posts: 5715
Joined: Mon Apr 10, 2017 4:25 pm

Re: Population curves

#27 Post by Oberlus »

I'd like to stay away from this complex formulations. I mean, lets consider each planet independently (simpler, plus more realistic).

Considering clusters of planets as a single population is a manifold issue:
- It's less KISS, some players will find it not interesting or harder to understand without no reason.
- Player estimations are more complex (UI could help with this).
- Implementation of mechanic is more complex and probably harder to understand by new players/contributors and harder to debug or maintain.
- It somewhat equalizes the differences between planets sizes, removing at least one spatial variable to consider during colonization.

Plus I don't see any good thing from such a formulation, when compared to what we have now or what have been suggested before in this thread.

After we debate this to see if we are on the same page, I'd like to re-suggest a solution that accomplishes allowing players to control migrations between planets without repetitive or attention-demanding mechanics and without removing any importance to the choices of planet size during expansion.

Ophiuchus
Programmer
Posts: 3433
Joined: Tue Sep 30, 2014 10:01 am
Location: Wall IV

Re: Population curves

#28 Post by Ophiuchus »

Oberlus wrote: Tue Feb 08, 2022 9:51 am
Ophiuchus wrote: Tue Feb 08, 2022 9:17 am So growth is definitly more wide than tall. But I would intuitively expect that.
I don't see it wide or tall.
I meant that you get more growth if you have 5 pop + 5 pop on two 10 target-pop planets than you get with 10 pop on a 20 target-pop planet.
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

Look, ma... four combat bouts!

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Population curves

#29 Post by Geoff the Medio »

Oberlus wrote: Wed Feb 09, 2022 10:11 amI'd like to stay away from this complex formulations. I mean, lets consider each planet independently (simpler, plus more realistic).
I would have population change on a planet be a combination of:

1) local population growth that creates new population, pretty much as now, which is determined from the local situation (species, current population, target population, stability, environment, accessible specials, overlapping fields, focus, buildings, bombardment) and some additional imperial factors like techs and adopted policies

2) migration that moves population between planets but doesn't create any more, which would be determined from populations and stability levels and distances to other planets of the same species, within an empire and potentially to other empires, and affected by whether there is a supply connection and be large-scale controllable by players primarily by using imperial policies, and to a lesser degree locally with via focus settings

Ideally there would be viable strategies involving offensive migration policies to either drain the population of another empire or to destabilize another empire by encouraging migration to them that (perhaps?) puts some of their planet populations above target, which results in a stability penalty.

User avatar
Grummel7
Space Dragon
Posts: 335
Joined: Mon Oct 09, 2017 3:44 pm

Re: Population curves

#30 Post by Grummel7 »

Geoff the Medio wrote: Fri Feb 11, 2022 12:51 pm
Oberlus wrote: Wed Feb 09, 2022 10:11 amI'd like to stay away from this complex formulations. I mean, lets consider each planet independently (simpler, plus more realistic).
I would have population change on a planet be a combination of:

1) local population growth that creates new population, pretty much as now, which is determined from the local situation (species, current population, target population, stability, environment, accessible specials, overlapping fields, focus, buildings, bombardment) and some additional imperial factors like techs and adopted policies

2) migration that moves population between planets but doesn't create any more, which would be determined from populations and stability levels and distances to other planets of the same species, within an empire and potentially to other empires, and affected by whether there is a supply connection and be large-scale controllable by players primarily by using imperial policies, and to a lesser degree locally with via focus settings

Ideally there would be viable strategies involving offensive migration policies to either drain the population of another empire or to destabilize another empire by encouraging migration to them that (perhaps?) puts some of their planet populations above target, which results in a stability penalty.
Great, Oberlus opts for simple and Geoff wants the formula to be more complicated :roll:

Perhaps we should start by adapting the formula. I think we all agree that it doesn't make sense that a big planet fills faster than a small one and division by target size is a good fix. The only remaining question is which base factor to use. My suggestion is 0.08, i.e. 16 x the old factor, so a planet of size 16 will grow with the same speed as before. Perhaps this factor could even become a game parameter.

Other attributes could be added later on as a multipliers, e.g. half growth if stability is negative or no growth at all when planet had been attacked.

Regarding point 2, this needs further discussions. Some ideas:
  • We remove Evacuation as a building and add a focus Emigration. Emigration does not zero all production and it only removes population if they have a place to settle (SitRep, if no place). Destination should always be the emptiest (absolute or relative) planet in supply group (or empire wide) that can take 1 pop.
  • A policy could change the growth formula to the one I suggested or possible some other automatic distribution of settlers amongst same species planets in a supply group (or empire wide)
  • A policy that tries to get population from opponents with same species, determined by the difference in stability, the distance in jumps. I think some late version of civ had something like that, but I think it fits better in a game where there is only one species. Plus, I think this only works well if growth is very low.

Post Reply