Heath & Food & Starvation

Creation, discussion, and balancing of game content such as techs, buildings, ship parts.

Moderators: Oberlus, Committer

Message
Author
User avatar
eleazar
Design & Graphics Lead Emeritus
Posts: 3858
Joined: Sat Sep 23, 2006 7:09 pm
Location: USA — midwest

Heath & Food & Starvation

#1 Post by eleazar »

Geoff the Medio wrote:...but the new starvation system has only been added to one species (Human) and needs some testing to determine if it's working well, and needs to be added to all species if it is working. (Presently most species don't actually need food...)
Cool, i'll give that a look.

User avatar
eleazar
Design & Graphics Lead Emeritus
Posts: 3858
Joined: Sat Sep 23, 2006 7:09 pm
Location: USA — midwest

Re: Heath & Food & Starvation

#2 Post by eleazar »

I thought i had posted about this, but i can't find it.

Anyway, i'm a little confused as to how the effects are working, or supposed to be working, but this is what i've observed in-game:

While reporting "Famine struck %planet%." Population may grow for quite a few more turns. For instance when current-health hasn't yet climbed up to target-health.

Once famine lowers heath enough that population starts decreasing, and end of the food shortage doesn't necessarily stop starvation. It may take a lot of turns for heath to climb back up to 20 (i'm assuming that's the magic number), and during that time population will continue to decline even to the point of ending the colony in spite of an adequate food supply. It took me some time to figure out what was happening.

I'm not sure the effects can do this, but i'd like to see food shortages produce a gradually increasing malus on health. But once food supplies are adequate that malus should totally disappear. Otherwise it's just frustrating if you've done whatever it takes to get food to the colony, and they still keep dying.

So i don't think one message is sufficient.
We need one message for a food shortage without population decline. Something like: "%planet% doesn't have enough food."
Then another message for when people are actually dying. "Famine struck %planet%. Population dropped by X."

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

Re: Heath & Food & Starvation

#3 Post by Geoff the Medio »

eleazar wrote:Anyway, i'm a little confused as to how the effects are working, or supposed to be working
Every turn that a planet has less food than it needs, it loses the difference in health. If health drops below 20, population starts to decrease. If there is sufficient food, health can increase again, towards its target value, over several turns.
While reporting "Famine struck %planet%." Population may grow for quite a few more turns.
Yes; if the health hasn't fallen below 20 yet, population will still grow, even if there is less food than required to maintain health.
For instance when current-health hasn't yet climbed up to target-health.
I assume this is a typo or mis-edit, or refers to the continued losses after food is restored.
Once famine lowers heath enough that population starts decreasing, and end of the food shortage doesn't necessarily stop starvation. It may take a lot of turns for heath to climb back up to 20 (i'm assuming that's the magic number)
Yes. Above 20 health, population grows. Below 20 health, population decreases.
I'm not sure the effects can do this, but i'd like to see food shortages produce a gradually increasing malus on health. But once food supplies are adequate that malus should totally disappear.
There are potential micro / balance issues with being able to avoid any population loss by having food supplied only once per several turns with instant health-recovery from any malus. However, there could be a modified rule for health meter growth, so that instead of always going +1 or -1 towards the target health, the health could instead instantly recover to the lesser of 20 (stable population) and target health, when the planet is fully fed. That way, having adequate food will instantly stop population loss due to temporary changes to health, but changes to target health can still force the population to decrease even if fully fed.
Edit: I modified the source code so that should happen now. It could probably have been done with effects, though.../Edit
We need one message for a food shortage without population decline. Something like: "%planet% doesn't have enough food."
Then another message for when people are actually dying. "Famine struck %planet%. Population dropped by X."
The bit of code that makes planes lose population doesn't know anything about why the health meter is below 20, so at best it could say "Famine struck %planet%! Health is decreasing!" and "Population decreasing on %planet% due to poor health" as two separate messages, which can appear independently or together.

User avatar
eleazar
Design & Graphics Lead Emeritus
Posts: 3858
Joined: Sat Sep 23, 2006 7:09 pm
Location: USA — midwest

Re: Heath & Food & Starvation

#4 Post by eleazar »

Geoff the Medio wrote:
eleazar wrote:For instance when current-health hasn't yet climbed up to target-health.
I assume this is a typo or mis-edit, or refers to the continued losses after food is restored.
No, that's what i meant, i observed it a couple times. If starvation starts when health is below it's current possible maximum, health and population will increase for numerous turns before any decline sets in.
Geoff the Medio wrote:... the health could instead instantly recover to the lesser of 20 (stable population) and target health, when the planet is fully fed. That way, having adequate food will instantly stop population loss due to temporary changes to health, but changes to target health can still force the population to decrease even if fully fed.
Edit: I modified the source code so that should happen now. It could probably have been done with effects, though.../Edit.
That should work. Good thinking.

Daniel Santos
Space Floater
Posts: 30
Joined: Sun Nov 15, 2009 8:15 am

Re: Heath & Food & Starvation

#5 Post by Daniel Santos »

Yeah, I experienced this a few days ago as well. I had a planet blockaded and they plunged into famine. I think I got to it after 3 turns, but they continued to decline until they died about 10 turns after the famine ended -- that definitely doesn't reflect the reality of a population as we know it.

However, depending upon how accurate you want it, there are always "more vulnerable" population, the elderly, children and sick -- they tend to die first. So I don't think it's unrealistic to begin having some people die very shortly after the beginning of a famine. Of course, there is the "survival of the fittest phenomena" that tends to say that those who survived were probably more fit to survive due to genetics, lifestyle, or just ordinary circumstances. So please be encouraged to tune this further! =)

One of the great things about technology / modern society is how handily things all fall apart once the supply chain is interrupted.

User avatar
eleazar
Design & Graphics Lead Emeritus
Posts: 3858
Joined: Sat Sep 23, 2006 7:09 pm
Location: USA — midwest

Re: Heath & Food & Starvation

#6 Post by eleazar »

Daniel Santos wrote:However, depending upon how accurate you want it, there are always "more vulnerable" population, the elderly, children and sick -- they tend to die first. So I don't think it's unrealistic to begin having some people die very shortly after the beginning of a famine.
We don't want to get into demographics. Currently the amount of time between the start of food shortages and the time people start dying is:
A) the size of the food shortage
B) How healthy the planet is. Health is strongly determined by how habitable the planet is.

Imagine a human colony on an earth-like world. If food supplies were cut off they could start eating squirrels and dandelions and other make-shift sources for a while. On a moon-like world there's no extra biomass, so people start dying quicker.



:arrow: That got me thinking. The amount that health goes down is currently highly dependent of the size of the population. Imagine to worlds with the same health that suddenly have all their food supply cut off. One of these worlds is new and has a population of 1. The other has a population of 25. If i'm reading it right, the health of the populated world will go down 25X faster than the other world.

Do we want that, or should the health decline be based on what percentage of Target-Food-Consuption isn't met? --so that heath would decline at the same rate when the shortfall is the same percentage-- no matter the size of the population.

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

Re: Heath & Food & Starvation

#7 Post by Geoff the Medio »

eleazar wrote:Do we want that, or should the health decline be based on what percentage of Target-Food-Consuption isn't met? --so that heath would decline at the same rate when the shortfall is the same percentage-- no matter the size of the population.
I'm hesitant to use percentages for things like this because they can lead to unexpectedly large or small numbers when the maximum value on which the percentage is based is itself small or large. It's also a lot harder to understand what causes changes in health than shortage = health loss.

Presumably maintaining food supply to older, more established-colonies should be easier than at the frontiers, and perhaps larger colonies would have a few options from content to give them a bit of food output of their own even if not focused on farming, so they won't starve quite so fast...

User avatar
eleazar
Design & Graphics Lead Emeritus
Posts: 3858
Joined: Sat Sep 23, 2006 7:09 pm
Location: USA — midwest

Re: Heath & Food & Starvation

#8 Post by eleazar »

Geoff the Medio wrote:
eleazar wrote:Do we want that, or should the health decline be based on what percentage of Target-Food-Consuption isn't met? --so that heath would decline at the same rate when the shortfall is the same percentage-- no matter the size of the population.
I'm hesitant to use percentages for things like this because they can lead to unexpectedly large or small numbers when the maximum value on which the percentage is based is itself small or large. It's also a lot harder to understand what causes changes in health than shortage = health loss.
Maybe if i explain a bit more-- i don't see how those criticism would apply to what i have in mind.

Let's suppose a planet with absolutely no food should have a health decrease of -2 per turn. ("-2" is just an example). So such a planet with a health of 25 would take 3 turns to get to a health of 19, and thus start loosing population. It wouldn't matter if the population was large or small -- i think that makes it easier to understand.

A planet that's only receiving half (that's where the percentage, or ratio, comes in) of the needed food would take half of that standard health decrease, i.e. -1 per turn.

A planet with only slightly less food than it needs would take only a slight decrease to health per turn, no matter the size of the population.
Geoff the Medio wrote:Presumably maintaining food supply to older, more established-colonies should be easier than at the frontiers, and perhaps larger colonies would have a few options from content to give them a bit of food output of their own even if not focused on farming, so they won't starve quite so fast...
Age only has a loose correlation to population size. I can easily get a new, unimproved, fully populated planet on the frontier, by invading a minor-species planet.


:arrow: In order to make things intuitive, and to make sure food shortages even in the early stages are significant, perhaps all population growth should be cut off (no matter where health is) when there is even a small food shortfall.

Daniel Santos
Space Floater
Posts: 30
Joined: Sun Nov 15, 2009 8:15 am

Re: Heath & Food & Starvation

#9 Post by Daniel Santos »

eleazar wrote: :arrow: In order to make things intuitive, and to make sure food shortages even in the early stages are significant, perhaps all population growth should be cut off (no matter where health is) when there is even a small food shortfall.
That makes sense to me, but I don't think it should terminate growth entirely once supply is at 99.99% of demand, but perhaps when it reaches, say 80% of demand. And, please forgive that I'm not yet intimately familiar with the health/growth/food formulas, but in practice, large empires to small towns typically create emergency food supplies for such situations. In FO, the "health" stat seems to play this roll to a degree creating a buffer between food shortages and starvation.

I suppose there are a lot of different approaches that can be taken. For instance, population growth rate (positive or negative) doesn't have to be based solely upon health. There can be a three-way inter-relationship between health, growth and food supply. Food supply vs demand can affect both health and the current turn's growth rate. Example:

Code: Select all

float maxFood = pop; // maybe 120% to allow for greater growth?
float pctFed = min(pop, food) / pop; // the percentage of food demand is filled
// factor in habitat to offset pctFed shortage., like maybe:
// if pctFed < 1.f && habitat is good, pctFed = min(pctFed + .20, 1.f)
// if pct Fed < 1.f && habitat is average, pctFed = min(pctFed + .10, 1.f)

float healthBonus = some_formula;
// health = 0, bonus = -20% growth
// health = 20, bonus = 0%
// health = 40, bonus = +10% (diminishing returns for higher health?)

foodBonus = some_other_formula;
// pctFed = 100%, bonus = 5%?
// pctFed = 80%, bonus = 0%
// pctFed = 50%, bonus = -10%
// pctFed = 0%, bonus = -20%

float growth = 1.0f + healthBonus + foodBonus;
// now change health if food supply is low
Now, I'm not proposing this particular formula, it's not really well thought out. I'm just trying to suggest a new way to calculate it. So health and food are high, growth is high. Health is 80 but food is at 50% demand, then population should shrink slightly while health takes a sharp drop. However, once health is at 20 and food is still at 50%, growth should fall much more. Then, if health is at 5 and food is at 100%, you can have health regenerate fairly normally and population only shrinks slightly until health reaches 20 again and, of course, factor in habitat as well. However, I think food supply should be the largest determining factor on growth and shortfalls (in either food or health) should have a greater negative effect than their their positive counterparts has positive effects (i.e., "diminishing returns").

EDIT: typo

User avatar
eleazar
Design & Graphics Lead Emeritus
Posts: 3858
Joined: Sat Sep 23, 2006 7:09 pm
Location: USA — midwest

Re: Heath & Food & Starvation

#10 Post by eleazar »

Daniel Santos wrote:...However, I think food supply should be the largest determining factor on growth and shortfalls (in either food or health) should have a greater negative effect than their their positive counterparts has positive effects (i.e., "diminishing returns").
I think you assuming some MoO-style mechanics in the way things work. Perhaps this will help.

Excess food is stockpiled at the capitol, so the only way it can effect growth is by being "enough".

In case of shortfall in food production, the stockpile of food can be shared with any planets connected to the supply network (solid colored starlanes). But that doesn't help planets that are blockaded, or otherwise separated from the capitols supply. (Stockpiles at individual planets was carefully considered and rejected. There's just one per empire.)

FO is a game of focused planets. Most will not come close to meeting their own food requirements. Many will produce no food. So in the case of blockaded colonies we wanted a little buffer between the beginning of food shortages and death by population loss, especially on habitable planets.

What we're working on now is mechanics that provides that buffer. At the moment we have Food shortages gradually decrease health, and sufficiently low health decrease population. Large food shortages decrease health more quickly.

Unless i misunderstand, your suggestion isn't helpful in this context. But if you want to revise it in light of whatever bit of context you didn't have before feel free -- i'm not entirely sure i understand what you are trying to do.

Daniel Santos
Space Floater
Posts: 30
Joined: Sun Nov 15, 2009 8:15 am

Re: Heath & Food & Starvation

#11 Post by Daniel Santos »

eleazar wrote:I think you assuming some MoO-style mechanics in the way things work. Perhaps this will help.
I'm not so much thinking MoO-style as I am anthropology, biology and sociology. For instance, in ancient times, Native Americans would abstain from sex during times when food was in short supply. If penguins aren't able to get fat enough during the summer months (another frightening event that's happened a lot recently) they will abstain from participating in their annual mating. In the duck pond behind my apartment, the park services has to "cull" them every year to prevent over-population because everybody loves to come and feed them. So, in nature, I've observed that availability of food is the number one factor affecting population growth or shrinkage.
eleazar wrote:Excess food is stockpiled at the capitol, so the only way it can effect growth is by being "enough".
I had presumed this to be the case, but I find a few weaknesses in the theorem. If I were running an empire and I knew that there could be interruptions to food supply ships, I would have each outpost or colony create a cache. On the flip side of that, I've discovered that when my mining planet is blockaded, it's production is lost (i.e., it's no longer connected) even though they are working like dogs (or cats). If it were reality, I would have them continue to mine and stockpile their mining goods somewhere on the planet (perhaps at a 10% productivity penalty for having to stockpile it) and then when the distribution channels were re-opened, they could begin unloading surplus.

However, this isn't a real empire and it's a game. As such, it may make it a better game to do things they way it's being done, and I wouldn't want to screw with something that's working.
eleazar wrote:Unless i misunderstand, your suggestion isn't helpful in this context. But if you want to revise it in light of whatever bit of context you didn't have before feel free -- i'm not entirely sure i understand what you are trying to do.
Well, before I propose anything in any exact terms, I would want to read more from the spec and forums. But the summary is something like this:
  • A buffer mechanism can be facilitated by using both the food supply vs demand ratio (hence "percent fed") and the health of a planet to determine growth and probably serve to augment the value of the health meter as well. By having food supply affect both health and growth, while continuing to have health affect growth, a buffer for food shortages is created. Also, by not having growth depend solely upon health, you don't have to magically bring health up to 20 when food is fully supplied to prevent the population from dying 18 turns after the end of a famine. Instead, you can allow health to regenerate normally and it will probably more closely mirror how these factors play out in nature.

User avatar
Bigjoe5
Designer and Programmer
Posts: 2058
Joined: Tue Aug 14, 2007 6:33 pm
Location: Orion

Re: Heath & Food & Starvation

#12 Post by Bigjoe5 »

I think it's really weird that it takes time start/stop losing population to a famine. It doesn't seem as simple as having basically the same penalty throughout the duration of the blockade. On the other hand, having an instantaneous drop to below 20 would be really weird for a planet with 100 health, and then afterward, it would have to recover to 100 from 20, even if the blockade or shortage lasted only a single turn...

I have some idea of how to solve this problem, but is there a particular reason that you chose such a famine system?
Warning: Antarans in dimensional portal are closer than they appear.

User avatar
eleazar
Design & Graphics Lead Emeritus
Posts: 3858
Joined: Sat Sep 23, 2006 7:09 pm
Location: USA — midwest

Re: Heath & Food & Starvation

#13 Post by eleazar »

Bigjoe5 wrote:I think it's really weird that it takes time start/stop losing population to a famine. It doesn't seem as simple as having basically the same penalty throughout the duration of the blockade.
It's not as simple as i'd prefer. But it seemed to be the simplest method that avoids worse problems.
Bigjoe5 wrote:I have some idea of how to solve this problem, but is there a particular reason that you chose such a famine system?
If "you" is me and/or Geoff-- as best as i remember the idea evolved mostly through trying to avoid things:
* Rejecting local stockpiles
* Disliking the too easily triggered instant death of that we've had till recently.
* Something else i've forgotten

Daniel Santos
Space Floater
Posts: 30
Joined: Sun Nov 15, 2009 8:15 am

Re: Heath & Food & Starvation

#14 Post by Daniel Santos »

eleazar wrote:* Something else i've forgotten
Now you're sounding like me :D

User avatar
Bigjoe5
Designer and Programmer
Posts: 2058
Joined: Tue Aug 14, 2007 6:33 pm
Location: Orion

Re: Heath & Food & Starvation

#15 Post by Bigjoe5 »

eleazar wrote:If "you" is me and/or Geoff-- as best as i remember the idea evolved mostly through trying to avoid things:
* Rejecting local stockpiles
* Disliking the too easily triggered instant death of that we've had till recently.
* Something else i've forgotten
Well, what we could do, if nobody is vehemently opposed to adding another meter, is create a new "Health Threshold" meter. By default, the meter would be set to 20, and health would act as it does now. When starvation kicks in, the Health Threshold could increase by something like, say, 10 per unit of food (which means that the population growth formula would probably need to be revised somewhat to include this variable). Or if it's more logical to take into account the proportion of the population, the threshold increase could be proportional to the percentage of population that's not being fed.

The result of this would be that healthier planets would be able to withstand small food shortages indefinitely, while less healthy planets, or very healthy planets with no available food would start losing population. The degree to which population is lost would increase with the degree of food shortage, but would remain constant with respect to the duration of the shortage. Even if the health threshold didn't increase above health, population growth on healthy planets would be reduced.

This behaviour seems reasonable, and is functionally somewhat similar to how planets with famine behave in MoO2.

This would permit the change in population growth to be instantaneous, without having to worry about weird shifts in the Health meter itself.

On a tangential topic, something similar seems useful for riot and rebellion thresholds for the allegiance and happiness meters.
Warning: Antarans in dimensional portal are closer than they appear.

Post Reply