(Newbie) Limited production options at start.

Describe your experience with the latest version of FreeOrion to help us improve it.

Moderator: Oberlus

Forum rules
Always mention the exact version of FreeOrion you are testing.

When reporting an issue regarding the AI, if possible provide the relevant AI log file and a save game file that demonstrates the issue.
Message
Author
wobbly
Cosmic Dragon
Posts: 1880
Joined: Thu Oct 10, 2013 6:48 pm

Re: (Newbie) Limited production options at start.

#16 Post by wobbly »

chomwitt wrote: Thu Jun 03, 2021 9:25 am So 1.0 equals the max pop capacity of one my colony ships , so it can be changed ?
One of the techs in the growth tree opens cryogenic pods which are pop 3.

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

Re: (Newbie) Limited production options at start.

#17 Post by Oberlus »

defaultuser wrote: Thu Jun 03, 2021 6:39 pm Under the new rules, that planet would be -3.0? I suspect that my suggestion for Planetary Ecology wouldn't help unless that's changed too.
It has that special with a malus to pop, that's why.

chomwitt
Space Floater
Posts: 24
Joined: Thu Oct 17, 2019 9:19 am

Re: (Newbie) Limited production options at start.

#18 Post by chomwitt »

LienRag wrote: Thu Jun 03, 2021 3:38 pm Of course population will never reach -3.
When it reaches 0, the settlement will revert to an outpost.
If you set your homeworld to growth, it should add a population bonus to same-species planet population, so it may bring this -3 to a positive level (which won't happen if initial target population is -9).
That's why negative numbers have a value rather than just "zero" : it tells you how much population bonus you need to be able to colonize.
Ok, thanks now i understand the logic. More negative means harser enviroment so it gives you the info that you need to do more things to make that habitable.
I wonder if that reflects also the rate by which the colony ship's population will start to diminish from the moment they land.. (-2 double diminish rate that -1).

But i think that using that variable like that its not a pop counter. Its sth different. Think negative account , speed , but negative heigth or weigth?

maybe a complex game mechanics is in play here but not expressed clearly?

What about : current pop , rate. So a harsh planet has eg: 1 pop (colony) , and -10%/Turn growth rate. Growth rate semantically can go both directions. And now maybe you dont need max. The groth rate getting near zero would mean that in current conditions you cant increase. So in theory now you have a question. How big could a pop grow?

Or maybe Target population is current pop(p0) + adding all changes from a hidden rate..
------------------------------------------------
FreeOrion version : v0.4.10.1 HEAD
OS: Debian Stable
CPU: Quad Core Intel Core i7-4790
GPU: Radeon RX 570 Series

defaultuser
Juggernaut
Posts: 854
Joined: Wed Aug 26, 2015 6:15 pm

Re: (Newbie) Limited production options at start.

#19 Post by defaultuser »

Oberlus wrote: Thu Jun 03, 2021 6:51 pm It has that special with a malus to pop, that's why.
Oh yeah, sorry.

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

Re: (Newbie) Limited production options at start.

#20 Post by Oberlus »

chomwitt wrote: Thu Jun 03, 2021 8:30 pm I wonder if that reflects also the rate by which the colony ship's population will start to diminish from the moment they land.. (-2 double diminish rate that -1).
Yes, something like that, change rate depends on distance between current and target population so a 1/-9 will die much faster than 1/-1.
But i think that using that variable like that its not a pop counter. Its sth different. Think negative account , speed , but negative heigth or weigth?
I don't really understand what you mean here, but TargetPopulation isn't exactly a population counter. The counter is Population. TargetPopulation is the maximum value the counter can reach if given enough time to adjust, if that TargetPopulation is positive, and it is an indicator of how bad the environment is for the species and how fast they will perish, if it is negative.

In this game, target population of a planet is calculated as HabitableSize * population modifiers.
HabitableSize is 1 to 5 for small to huge planets. Then you have a base 3 multiplier if the environment is good, 0 if it is adequate, -2 if it is poor, and -4 if it is hostile. From there on, you can get techs, specials and others that improve target population by increasing (or decreasing) that multiplier. E.g. Subterranean Habitation gives a +1, so the base multipliers become 4, 1, -1 and -3. So, for a medium planet (HabitableSize=3), you have target populations of 12 for good, 3 for adequate, -3 for poor (i.e. 0, and that will decrease slowly) and -9 for hostile (i.e. 0 that will decrease relatively fast).
Knowing this, it makes sense to track negative numbers too, as LienRag commented.
What about : current pop , rate. So a harsh planet has eg: 1 pop (colony) , and -10%/Turn growth rate. Growth rate semantically can go both directions. And now maybe you dont need max.
Not as useful. What you really care here is what population will have the planet when it is stable (so that you can estimate how much production or research it will contribute to the empire), not the rate growth.
However, you can know the growth rate of a planet for current turn in the tooltip of the colony's population, like the one you attached before. The number it gives you, "change", divided by the current population value would be the change rate. BTW, it will be something between 0.5% and 10%, depending on current and target values (growth rate is not constant).
In any case, you need maxtarget for sure, it's the most important value.
The groth rate getting near zero would mean that in current conditions you cant increase. So in theory now you have a question. How big could a pop grow?
Hahaha, yeah. And that questions is answered by Target Population.

chomwitt
Space Floater
Posts: 24
Joined: Thu Oct 17, 2019 9:19 am

Re: (Newbie) Limited production options at start.

#21 Post by chomwitt »

Oberlus wrote: Fri Jun 04, 2021 4:33 am In this game, target population of a planet is calculated as HabitableSize * population modifiers.
HabitableSize is 1 to 5 for small to huge planets. Then you have a base 3 multiplier if the environment is good, 0 if it is adequate, -2 if it is poor, and -4 if it is hostile. From there on, you can get techs, specials and others that improve target population by increasing (or decreasing) that multiplier. E.g. Subterranean Habitation gives a +1, so the base multipliers become 4, 1, -1 and -3. So, for a medium planet (HabitableSize=3), you have target populations of 12 for good, 3 for adequate, -3 for poor (i.e. 0, and that will decrease slowly) and -9 for hostile (i.e. 0 that will decrease relatively fast).
Knowing this, it makes sense to track negative numbers too, as LienRag commented.
HabSize Env Mod TargetPop
1 3,0,-2,-4 +1 (SubHab) -> 4,1,-1,-3 4,1,-1,-3
2 3,0,-2,-4
3 3,0,-2,-4 +1 (SubHab) -> 4,1,-1,-3 12,3,-3,-9
4 3,0,-2,-4
5 3,0,-2,-4

If i understand ,TargetPopulation is calculated first
The games says 'from what i see.. from where you are now you can get to there(in the future).
And TargetPopulation doesnt have current population value as an input . Is that right?
------------------------------------------------
FreeOrion version : v0.4.10.1 HEAD
OS: Debian Stable
CPU: Quad Core Intel Core i7-4790
GPU: Radeon RX 570 Series

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

Re: (Newbie) Limited production options at start.

#22 Post by Oberlus »

chomwitt wrote: Fri Jun 04, 2021 7:34 am If i understand ,TargetPopulation is calculated first
The games says 'from what i see.. from where you are now you can get to there(in the future).
And TargetPopulation doesnt have current population value as an input . Is that right?
I'll try to give you a more thorough answer, I hope it helps.

When an unpopulated planet is populated, it will start at 1 Population (or 3 with certain tech, someone commented above).
Then Population will gradually change towards TargetPopulation as per this equation:

Code: Select all

If Population<TargetPopulation
    Population = min( TargetPopulation, Population + Population * 0.005 * (TargetPopulation + 1 - Population) )
if Population>=TargetPopulation
    Population = max( TargetPopulation, Population - Population * 0.01 * (Population - TargetPopulation) )
That 0.005 would be 0.0075 if a certain policy is adopted (Augmentation), or just 0 if another certain policy is adopted instead (No Growth).

TargetPopulation is equal to HabSize * (EnvironmentModifier + TechModifiers + SpecialModifiers...) plus some other modifiers that doesn't depend on the HabSize (for example technology Planetary Ecology gives an absolute +1 bonus to size, regardless of planet size).

Some links you can find useful for your curiosity (search for the SetTargetPopulation keyword):

Environment modifiers:
https://github.com/freeorion/freeorion/ ... s#L75-L118
In that file there are also
- the Good/Bad Population modifiers, a species trait, that give a +/-25% bonus to some of the other modifiers of TargetPopulation (depending on which ones apply first, check out priority),
- the Self-sustaining, Gaseous and Phototropic modifiers, also species traits,
- the homeworld growth focus modifier (already commented in a previous post).

Organic growth special modifiers:
https://github.com/freeorion/freeorion/ ... os#L33-L57
In that file you'll find also the other metabolisms' growth specials.

The file for one of the techs that affect TargetPopulation, Xenologic Genetics:
https://github.com/freeorion/freeorion/ ... S.focs.txt
That one gives a +2*HabitableSize on adequate or poor environments, and a +1*HabitableSize on hostile environments (and nothing for good environments).
Check out the other techs in that folder default/scripting/techs/growth.

The file for one of the few buildings that affect population:
https://github.com/freeorion/freeorion/ ... M.focs.txt
This one give -1*HabitableSize to all colonies.

BTW, when you find in the code something like this

Code: Select all

(NamedReal name = "BLD_HYPER_DAM_TARGET_POPULATION_PERSIZE" value = -1)
it just means the value, -1 in this case.

chomwitt
Space Floater
Posts: 24
Joined: Thu Oct 17, 2019 9:19 am

Re: (Newbie) Limited production options at start.

#23 Post by chomwitt »

If we assume Target population = 1 and initial Population = 3 and put (in pieces) in my librecalc sheet the formula:
Population next turn = Population * 0.005 * (TargetPopulation + 1 - Population)
i get these values. The negative progress seems too slow.
https://i.postimg.cc/xC8jYG4n/pop-calc1.png (errored calculation)
Last edited by chomwitt on Sun Jun 06, 2021 9:04 pm, edited 1 time in total.
------------------------------------------------
FreeOrion version : v0.4.10.1 HEAD
OS: Debian Stable
CPU: Quad Core Intel Core i7-4790
GPU: Radeon RX 570 Series

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

Re: (Newbie) Limited production options at start.

#24 Post by Oberlus »

chomwitt wrote: Fri Jun 04, 2021 10:59 pm If we assume Target population = 1 and initial Population = 3 and put (in pieces) in my librecalc sheet the formula:
Population next turn = Population * 0.005 * (TargetPopulation + 1 - Population)
i get these values. The negative progress seems too slow.
You put the formula for Population<TargetPopulation and used values with Population>TargetPopulation (check out again in my previoys post, there are two equations depending on that).
The change factor for decreasing populations is 0.1, 20x faster than 0.005.

chomwitt
Space Floater
Posts: 24
Joined: Thu Oct 17, 2019 9:19 am

Re: (Newbie) Limited production options at start.

#25 Post by chomwitt »

Thanks. I post a screenshot of an example with:
Initial Population = 10
Target Populatio = 1
I think i understand better now the formula. The rate is getting smaller as the we are approaching the target.
(also i removed the errored one from the previous post, as i dont thinks it's needed)
But still i am not sure if the numbers are correct because the decrease seems to becoming asymptotical as we
approach the target..
Image
------------------------------------------------
FreeOrion version : v0.4.10.1 HEAD
OS: Debian Stable
CPU: Quad Core Intel Core i7-4790
GPU: Radeon RX 570 Series

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

Re: (Newbie) Limited production options at start.

#26 Post by Oberlus »

chomwitt wrote: Sun Jun 06, 2021 9:03 pm But still i am not sure if the numbers are correct because the decrease seems to becoming asymptotical as we
approach the target..
I think you are right, as per that equation population would never reach 0, even if target was smaller than zero (although there is something somewhere in the code base that zeroes lingering populations when small enough).

chomwitt
Space Floater
Posts: 24
Joined: Thu Oct 17, 2019 9:19 am

Re: (Newbie) Limited production options at start.

#27 Post by chomwitt »

Oberlus wrote: Mon Jun 07, 2021 8:53 am
chomwitt wrote: Sun Jun 06, 2021 9:03 pm But still i am not sure if the numbers are correct because the decrease seems to becoming asymptotical as we
approach the target..
I think you are right, as per that equation population would never reach 0, even if target was smaller than zero (although there is something somewhere in the code base that zeroes lingering populations when small enough).
It's not that it wont reach zero. It seem practically it wont reach target either . I've tested 200 turns forward and from 2 to 1 and it will reach 1,07 .
But then the related max function how will it be triggered?

Also i correcter another mistake . So here is the table:
Initial Pop=10 Target=1
Image

I will thy to find a libreoffice online webapp to post my calc sheet.
------------------------------------------------
FreeOrion version : v0.4.10.1 HEAD
OS: Debian Stable
CPU: Quad Core Intel Core i7-4790
GPU: Radeon RX 570 Series

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

Re: (Newbie) Limited production options at start.

#28 Post by Oberlus »

chomwitt wrote: Mon Jun 07, 2021 9:42 am It's not that it wont reach zero. It seem practically it wont reach target either
Yeah.

When growing, it can reach target because of that +1 in the last term.
The formula for decreasing pop lacks something similar. However, as commented in my previous post, AFAIK there is some mechanic somewhere that ensures that populations too close to zero become zero, and so the system works nevertheless. A proof of that is that you colonized a planet that got depopulated after some time, right?

Is there anything in particular to fix here apart from that?
I will thy to find a libreoffice online webapp to post my calc sheet.
No need.

Post Reply