Quinn and I were trying to walk through how eating was calculated. We decided that it should be calculated in small steps, rather than just having 1000s of animals eaten, and THEN they get to reproduce. So I made a model below, and then imagined a "step" where 1/10th of the total animals ate and reproduced. (Then it could be iterated a total of ten times, (in this example) including reproduction.) The other distinctive thing about this version is that players do NOT decide what their species diet should be - the computer maximizes it for them based on their success rates.
I walked through a possible step.... see below.
coyote has .7 success vs rabbit
wolf has .8
coyote has .8 success vs deer
wolf has .6
wolf and coyote and rabbit all eat grass
with equal success
there is 300 grass, so 100 will go to each
coyote will get 7/15ths of killed rabbits (7 coyotes succeed while 8 wolf succeed)
wolf will get 8/15ths of killed rabbits
coyote will get 8/14ths of killed deer
wolf will get 6/14ths of killed deer
a wolf has a 70% chance of finding and killing a rabbit. A coyote has an 80%.
animals eat what's easiest.
if fixed resources are available, then that's what they eat.
for every 1 wolf that eats grass, 1 coyote eats grass, 1 rabbit eats grass
for every 8 wolves that eat rabbits, 7 coyote eat rabbits, 5 rabbits get away, 2 wolves starve, and 3 coyotes starve (unless scarcity protects rabbits more).
for every 8 coyote that eat deer, 7 wolves eat deer, 2 coyote starve, and 3 wolves starve.
for every rabbit that gets away, .75 rabbits are born
for every wolf, .5 wolves are born
for every coyote, .5 coyote are born
in this case, there is a shortage of all food.
let's say the computer breaks it down into only 10 steps
So, 80 wolves at a time.
(one step model problem we should avoid: if the first wolves all eat grass because it's easiest, then rabbits won't get eaten at all in the early steps and they will get to reproduce for several steps until fixed resources are used up, THEN they get eaten. That's like just calculating repro before eating and will be too favorable for prey. So the program needs to have predators eat with the same behavior each step, the only difference in the steps will be the math that changes because to protect animals nearing extinction or overpopulation thresholds.)
computer sees that wolves will only get 1/3rd of grass, which is 100 total.
so, 1 out of every 8 wolves will try to eat grass.
computer sees that wolves have 2nd best success (after grass) vs rabbit. 500 rabbits (which is not considered scarce.) for every 20 rabbits, 8 will get et by wolf (2 wolves starve), 7 by coyote, and 5 will get away. so, if wolf only tried to eat rabbit, it can expect a maximum of 500*8/20 which = 200 rabbits for 250 wolves (50 starve).
So, that means that 2.5 wolves will try to eat rabbits for every 1 that eats grass
likewise, with deer
500 deer. for every 20 deer, 6 will get et by wolf, and 4 wolves will starve. so it takes 10 wolves to get 6 deer. 500*6/20 = 150. the most wolves can expect is 150 deer.
it takes 250 wolves to get 150 deer.
for every 1 wolf that eats grass, 7 try to eat something else.
2.5 will try to eat rabbit, and 2.5 will try to eat deer. That leaves 2 wolves who will starve from overpopulation. Also, of the ones eating prey, for every 2.5 that try to eat rabbit, only 2 will succeed, and for deer, only 1.5 will succeed, so 1.5 more will starve, total is 4.5 survive and 3.5 that starve.
then reproduce, then reiterate this process 9 more times.
so, for first iteration, (80 wolves) .
10 wolves, 10 coyotes, 10 rabbits eat grass.
20 wolves eat rabbit,
5 wolves starve
15 wolves eat deer,
10 wolves starve
20 wolves starve from overpop
then everybody reproduces
maybe the player can spend points for a diet preference that only lasts one turn if they really want to eat a certain thing with higher priority for strategic reasons, even though it will cause more starvation.
BTW grass is just a "fixed resource" and could be something else, like ambrosia, cream puffs, jack daniels, burritos. So I think the absurdities encouraged by the game make it hard to decide what is "realistic." I'd personally rather have cream puffs than bunnies, but bunnies rather than grass. It is also possible to have only an 80% success rate at eating grass... because we really have no natural death built into the game, so "starvation" sort of includes natural death and sickness. So it's not necessarily that wolves try to eat deer, and some fail and starve, but rather, of the wolves that are primarily living off deer, this many don't make it to next turn. I suppose we might need to make it impossible to have a 100% success rate at anything so there is always some natural death, and not just lack of food.
Also, I think the goal here is to figure out what the average rates of eating and birth are, and calculate them stepwise, rather than think of it like a pie, where they start eating the deer pie, and then around step 6 or 7 the pie is gone and they switch to another food source. We want the computer to somehow figure out what the whole diet of wolves would be like, 20% grass, 30% deer, something to that effect. That seems more realistic, taken from the long view, like each turn represents several generations, or an era of some kind. Rather than a "day" of eating, (where maybe on that particular day you eat only grass, then next day see if you can find deer) instead it's more of a "during this epoch wolves had a diet of grass, deer and rabbits, and their population grew/shrank."
SO I think the goal is to not create sequential eating choices (first eat rabbits, then grass if no rabbits) but rather to seek to express the general rates of change of the ecosystem at any given point in time.
Need formulas here.
I found an old doc file, don't know how much of it is still relevant. Some of this is just early thoughts we had before we made compromises and focused on a few easy to manage ideas. - Brandon
Dan’s formula as of 1/27/04
Every species r = 1.025 times mutation bonus(5 = .05)
1. Pop = (r times mut bonus ) times current pop, - number eaten by predators (which equals no of predators times some kind of competition percentage, or capacity effect)
2. Calculate starvation: (no of predators biomass - no of prey biomass eaten) A creature has to eat its own weight within one interval.
Growth rate = r times mutation benefits
Animals are eaten, then get to reproduce
next pop = survivor pop + (survivor pop * reproduction rate)
or, if you want to name K as a maximum population allowable,
survivor pop + (survivor pop * (1- survivor pop / K))
when predator eats, the number it eats of a certain animal is divided by the number of different kind of prey it eats.
How about if your population of individuals (biomass divided by size) drops below twice the minimum you need to reproduce, all predators are removed and starvation is negated. Once the population grows again, predators are reinstalled, randomly, one a turn.
Q for Dan---
What does cumulative mean in mutations?
To get a positive mutation, you have to get a negative mutation. (Like Champions) – or taking on a negative mutation gives you extra points to make a positive mutation.
When does an animal get to add a new creature to what it eats?
Can you have negative attack values?
Need to add age, and conditions. (Conditions for create and kill)
Two stages—eat, then reproduce
Need to add categories of animals. So that something that eats insects automatically eats all insects.
No of individuals = biomass / size (size is 3 to the x power, if negative, then individ is smaller than 1 biomass)
1.Each species declares who its feeding on – how much of each prey it has to eat
If you have 2 prey, and 1000 biomass, you need 500 of each.
Look at each prey, total net amount that all predators want to eat you (called total amount)
So wolves want to eat 500 of me, owl want to eat 1000 of me , so that’s 1500
There are 2000 of me.
Bunny biomass = b p = total amount
Amount of bunnies that get eaten = b/2p/b
double ratioAvailable = Math.pow(.5, totalAmount/biomass);
= 2000 / 1.68…. = 1189.2
amount of bunnies eaten is
(double in java means rational number. Int always rounds down.)
Birth rate: [sexual intermingling=1 if normal] x [(expected new young per female) / (total population of fertile offspring producers, usually this means mothers)] x [no. of times they reproduce per year]
In other words: BIRTH RATE= (EXPECTED NEW YOUNG FOR ONE MATURE MOTHER IN ONE YEAR) x BIRTH FREQ OF A SINGLE MOTHER OVER ONE YEAR
PRE BIRTH RATE= total number of conceptions
BIRTH RATE = rate of successful births
INFANT SURVIVAL RATE (changes) = percentage of young expected to reach maturity(ability to aid in reproduction)
So for some huge mammal with a lengthy pregnancy, birth freq would be about .2 –they only have kids about once every five years. For insects, it might be 1200, if a mother
In this example it is .2
NATALITY is ACTUAL BIRTHS PER YEAR
NATALITY= (SEX HEALTH) x (BIRTH RATE) x (TOTAL POPULATION OF MATURE MOTHERS FOR ONE YEAR)
BIRTH INTERVAL is time that passes from one mothering session to the next. A vole every 30 days, 4 times, then none until next breeding season. A bear, only once every 4 years. This would be a description, boiled down into a number per year.
No of births per interval (humans, 1.05, trout, 1000, vole, 6, ant queen 1)
No of intervals a yr. (humans, 1, trout, 1, vole, 4, ant queen, 5,000)
If a mother matures 3/4 of the way into the year, then she only counts as .25 of a mother for that year, since she was not a mother the whole year. Also, if a species dies after a very short time, then each individual mother only counts as a fraction of a mother.
Birth rate is fixed based on ideal conditions. Sexual health and total populations of mature mothers affects the actual births.
If sex health is below one, it reduces birth rate. It is always above zero.
Natality: new young / time
Fecundity: new young / female (/time)
1000 bears produce 200 young per year – fecundity = .2 (200/1000)
PRE MATURATION STAGES: 2 (Larvae, cocoon, depressed goth, etc.)
MATURATION TIME: number of years from birth to maturity (elephant = 10, vole = .04)
MATURATION RATE = expected new adults per year
ACTUAL MATURATION (varies) is number of new mature individuals per year
FERTILITY: The percentage of adults that are mothers
AVG MENOPAUSE: number of years from birth to infertility due solely to age
ELDERLY RATE = expected new elderly per year
ACTUAL ELDERLY =
Condition for successful reproduction: (bare minimum for conception) one male and one female together for 10 seconds, 3 years, one queen and 400 males, etc. A family unit must be created to reproduce. Total number of family units possible within the population might be more accurate than total mothers.
Health of food supply
Negative social conditions
Negative environmental conditions
Death rate: (per year) MORTALITY RATE is converse of SURVIVAL RATE
(of pre births (eggs)
(of post mature)
LONGEVITY = the age at which death rate = 100 percent
Of subdivisions within the species (gender, color, Stage, size of antlers, alpha males, lesser classes)
Sex ratio: (males, to females, to non fertles, to other genders, etc.)
Dispersal: which sub categories of the species disperse to new locations? Under what conditions?/ What different habiats are inhabited by the species, which ones produce a surplus for dispersal, which ones don’t?
How do environmental changes affect?
Biological unit/ family size: (herd / hive / couple)
Geographic unit size: number of families per area
Some factors are pop density dependent. Others not.
Density dependent: Food supply. Health.
Density independent: Weather, catastrophes