Average Resource Consumption
Moderators: Moleman, Kwijibo, Luna
Average Resource Consumption
I personally thought this was the obvious way to go about things. Got a nasty surprise when things started adding and subtracting all over the place.
The Problem
When a the quantity of a consumable resource (anaeroebes, medicine, organics or oil) in the refinery becomes too small to deliver a bonus, the consumption on that consumable is halted, and the bonus is cancelled. It remains this way until there are enough resources to deliver the bonus, and then resumes full consumtion on that resource.
This causes a couple of minor issues.
Firstly, the quantity of any consumable doesn't often hit zero, nor will it show any kind of consistency. It will climb a little then fall again, in accordance with the fluctuating demands of the colony.
Secondly, the morale and population rates as listed in both the biodome and the radio receiver screens will fluctuate just as randomly. Both values will indicate either a massive increase or a massive decrease, and cannot be relied on to indicate what the colony is actually doing.
The Solution
The obvious answer is to give a consistent average of bonuses instead of all of the bonus sometimes and none of it others. However there are several intricacies which need to be examined first.
The first relates to the quantity of resource in the refinery. If the harvest rates for a resource exceed the consumtion rate for it, there will always be a full bonus. Or if there is any non-zero quantity in the refiney, there will always be a full bonus. If there is exactly zero in the refinery and consumption rate exceeds harvest rate, the quantity will remain at zero and the fraction of harvest/consumption will be used to determine bonuses instead.
The second relates to the size of the bonus. Under the current system, having a supply of two resources will yield three times as big a bonus as having only one such resource. Thus the bonuses cannot simply be added together, as that would result in a change in the mechanic, which is not the purpose here.
An effective averaging formula is propsed:
time_fraction_with_both = (harvest_rate_1 / consumption_rate) * (harvest_rate_2 / consumption_rate)
time_fraction_with_neither = (1 - harvest_rate_1 / consumption_rate) * (1 - harvest_rate_2 / consumption_rate)
time_fraction_with_only_one = 1 - time_fraction_with_both - time_fraction_with_neither
total_bonus = const_bonus_for_one * time_fraction_with_only_one + const_bonus_for_both * time_fraction_with_both
The Result
-Change rates listed in the biodome and radio reciver screens will be a meaningful indication of what the colony is doing.
-The colony population and morale will not have such rapid rises and falls all over the place, instead will smoothly change to the appropriate level.
This simulation is of an oceanic planet with 5% tax, 45% harvest, owner charsima 5, no disasters, no researches, fully built. The population begins at 11,000 and morale begins at 1400. There are no resources in the refinery at time = 0. The planet is simulated over a 250 hour time interval.
The same planet as above, only this shows the growth rate as given in the biodome window. The time scale has been reduced to 20 hrs through to 25 hrs for clarity.
The Problem
When a the quantity of a consumable resource (anaeroebes, medicine, organics or oil) in the refinery becomes too small to deliver a bonus, the consumption on that consumable is halted, and the bonus is cancelled. It remains this way until there are enough resources to deliver the bonus, and then resumes full consumtion on that resource.
This causes a couple of minor issues.
Firstly, the quantity of any consumable doesn't often hit zero, nor will it show any kind of consistency. It will climb a little then fall again, in accordance with the fluctuating demands of the colony.
Secondly, the morale and population rates as listed in both the biodome and the radio receiver screens will fluctuate just as randomly. Both values will indicate either a massive increase or a massive decrease, and cannot be relied on to indicate what the colony is actually doing.
The Solution
The obvious answer is to give a consistent average of bonuses instead of all of the bonus sometimes and none of it others. However there are several intricacies which need to be examined first.
The first relates to the quantity of resource in the refinery. If the harvest rates for a resource exceed the consumtion rate for it, there will always be a full bonus. Or if there is any non-zero quantity in the refiney, there will always be a full bonus. If there is exactly zero in the refinery and consumption rate exceeds harvest rate, the quantity will remain at zero and the fraction of harvest/consumption will be used to determine bonuses instead.
The second relates to the size of the bonus. Under the current system, having a supply of two resources will yield three times as big a bonus as having only one such resource. Thus the bonuses cannot simply be added together, as that would result in a change in the mechanic, which is not the purpose here.
An effective averaging formula is propsed:
time_fraction_with_both = (harvest_rate_1 / consumption_rate) * (harvest_rate_2 / consumption_rate)
time_fraction_with_neither = (1 - harvest_rate_1 / consumption_rate) * (1 - harvest_rate_2 / consumption_rate)
time_fraction_with_only_one = 1 - time_fraction_with_both - time_fraction_with_neither
total_bonus = const_bonus_for_one * time_fraction_with_only_one + const_bonus_for_both * time_fraction_with_both
The Result
-Change rates listed in the biodome and radio reciver screens will be a meaningful indication of what the colony is doing.
-The colony population and morale will not have such rapid rises and falls all over the place, instead will smoothly change to the appropriate level.
This simulation is of an oceanic planet with 5% tax, 45% harvest, owner charsima 5, no disasters, no researches, fully built. The population begins at 11,000 and morale begins at 1400. There are no resources in the refinery at time = 0. The planet is simulated over a 250 hour time interval.
The same planet as above, only this shows the growth rate as given in the biodome window. The time scale has been reduced to 20 hrs through to 25 hrs for clarity.
i've never noticed this "random" fluxuation. to be perfectly honest you completely lost me.
what i've found is:
anaerobes and organics effect on reproduction goes as follows:
both yellow or white ==> +pop/39.2
one yellow or white (the other red) ==> +pop/117.65
neither yellow or white ==> +0
medicine and oil effect on morale goes as follows:
both yellow or white ==> +5.76
one yellow or white (the other red) ==> +1.92
neither yellow or white ==> +0
this method has been tested with different populations on different planet types and on multiple servers. (classic is different)
--------------------------------------------------------------------------------
this is how i understand reproduction is calculated
R = reproduction rate in colonists per hour
PT = base reproduction rate of the planet type
AO = anaerobe and organic bonus
MGR = morale growth rate bonus (calculated before reproduction)
CR = current morale
GT = government type bonus
WP = weather prediction bonus
R = PT + MGR + CR + GT + WP
PT =
arctic +(pop/-45.46) col/hr
desert +(pop/-40) col/hr
earthlike +(pop/-52.67) col/hr
greenhouse +(pop/-38.46) col/hr
mountainous +(pop/-43.48) col/hr
oceanic +(pop/-47.60) col/hr
rocky +(pop/-41.67) col/hr
volcanic
paradise +(pop/-55.56) col/hr
AO =
both yellow or white +(pop/39.2) col/hr
one yellow or white (the other red) +(pop/117.65) col/hr
neither yellow or white +0 col/hr
MGR = +((pop/400)*morale growth rate) col/hr
CR = +((pop/5000)*((curent morale value)/100)) col/hr
GT =
socialism +(pop/200) col/hr
democracy +0 col/hr
democracy(d3) +0 col/hr
directorship +0 col/hr
prison +0 col/hr
WP = +(lvl*(pop/500)) col/hr
----------------------------------------------------------------------
this is how i understand morale is calculated
MGR = morale growth rate
CR = crowdedness modifier
TR = tax rate modifier
GT = government type bonus
MO = medicine and oil bonus
BB = building bonuses
CD = channel descrambling bonus
OC = owner charisma bonus
EI = entertainment industry bonus
PD = pollution disaster modifier
MGR = CR + TR + GT + MO + BB + CD + OC + IE + PD
CR = -(pop/1111.11) units/hr
TR =
0 +(4.8) units/hr
1-20 +(4.2-((tax percent)*0.6) units/hr
GT =
socialism +0 units/hr
democracy +0.9 units/hr
democracy(d3) +1.8 units/hr
directorship -0.48 units/hr
prision -2.4 units/hr
MO =
both yellow or white +5.76 units/hr
one yellow or white (the other red) +1.92 units/hr
neither yellow or white +0 units/hr
BB =
artesian well +1.5 units/hr
radio tower +1.2 units/hr
broadcast reciever +2.1 units/hr (replaces radio tower bonus)
CD = +(lvl*0.36) units/hr
OC = +((average charisma)/8) units/hr
EI = +(pop/5555.56) units/hr
PD = -(0.24*(number of disasters)) units/hr
what i've found is:
anaerobes and organics effect on reproduction goes as follows:
both yellow or white ==> +pop/39.2
one yellow or white (the other red) ==> +pop/117.65
neither yellow or white ==> +0
medicine and oil effect on morale goes as follows:
both yellow or white ==> +5.76
one yellow or white (the other red) ==> +1.92
neither yellow or white ==> +0
this method has been tested with different populations on different planet types and on multiple servers. (classic is different)
--------------------------------------------------------------------------------
this is how i understand reproduction is calculated
R = reproduction rate in colonists per hour
PT = base reproduction rate of the planet type
AO = anaerobe and organic bonus
MGR = morale growth rate bonus (calculated before reproduction)
CR = current morale
GT = government type bonus
WP = weather prediction bonus
R = PT + MGR + CR + GT + WP
PT =
arctic +(pop/-45.46) col/hr
desert +(pop/-40) col/hr
earthlike +(pop/-52.67) col/hr
greenhouse +(pop/-38.46) col/hr
mountainous +(pop/-43.48) col/hr
oceanic +(pop/-47.60) col/hr
rocky +(pop/-41.67) col/hr
volcanic
paradise +(pop/-55.56) col/hr
AO =
both yellow or white +(pop/39.2) col/hr
one yellow or white (the other red) +(pop/117.65) col/hr
neither yellow or white +0 col/hr
MGR = +((pop/400)*morale growth rate) col/hr
CR = +((pop/5000)*((curent morale value)/100)) col/hr
GT =
socialism +(pop/200) col/hr
democracy +0 col/hr
democracy(d3) +0 col/hr
directorship +0 col/hr
prison +0 col/hr
WP = +(lvl*(pop/500)) col/hr
----------------------------------------------------------------------
this is how i understand morale is calculated
MGR = morale growth rate
CR = crowdedness modifier
TR = tax rate modifier
GT = government type bonus
MO = medicine and oil bonus
BB = building bonuses
CD = channel descrambling bonus
OC = owner charisma bonus
EI = entertainment industry bonus
PD = pollution disaster modifier
MGR = CR + TR + GT + MO + BB + CD + OC + IE + PD
CR = -(pop/1111.11) units/hr
TR =
0 +(4.8) units/hr
1-20 +(4.2-((tax percent)*0.6) units/hr
GT =
socialism +0 units/hr
democracy +0.9 units/hr
democracy(d3) +1.8 units/hr
directorship -0.48 units/hr
prision -2.4 units/hr
MO =
both yellow or white +5.76 units/hr
one yellow or white (the other red) +1.92 units/hr
neither yellow or white +0 units/hr
BB =
artesian well +1.5 units/hr
radio tower +1.2 units/hr
broadcast reciever +2.1 units/hr (replaces radio tower bonus)
CD = +(lvl*0.36) units/hr
OC = +((average charisma)/8) units/hr
EI = +(pop/5555.56) units/hr
PD = -(0.24*(number of disasters)) units/hr
That's exactly it.
The problem is the way that the game calculates partial consumption bonuses (or rather, doesn't calculate them). Once a consumable hits red, it will stop being consumed and climb back into yellow. Then start being consumed again. This happens every five minutes. So your colony will say growing 120 people/hour, then five minutes later the org and ane will be gone and it'll say shrinking 170 people/hour. Neither will indicate what the colony is actually doing.
Been that way since, what, January? Somewhere around there.
The problem is the way that the game calculates partial consumption bonuses (or rather, doesn't calculate them). Once a consumable hits red, it will stop being consumed and climb back into yellow. Then start being consumed again. This happens every five minutes. So your colony will say growing 120 people/hour, then five minutes later the org and ane will be gone and it'll say shrinking 170 people/hour. Neither will indicate what the colony is actually doing.
Been that way since, what, January? Somewhere around there.
ok now that i understand. and yea i noticed this around January too. it is a big problem because colonies don't actually preform how they theoretically should.The problem is the way that the game calculates partial consumption bonuses (or rather, doesn't calculate them). Once a consumable hits red, it will stop being consumed and climb back into yellow. Then start being consumed again. This happens every five minutes. So your colony will say growing 120 people/hour, then five minutes later the org and ane will be gone and it'll say shrinking 170 people/hour. Neither will indicate what the colony is actually doing.
simple solution.
make the bonus go negative instead of halting at 0. this will either balance an unstable col or kill it if the settings arn't changed. however this would make colonies harder to maintain since they are technically benifiting from this problem.
p.s. Turkey please mail me if you have something different for any of those calculations.
- Mondaydark
- Posts: 227
- Joined: Wed Apr 11, 2007 3:52 pm
- Location: \m/ (>_<) \m/ <^> (o_o) <^>
- Contact:
I still dont completely understand in what order the resource and pop/morale calculations are made.
What i mean is, are bonuses counted before resource production or after?
Most probably the order is like that: add harvested resources, remove consumed resources (which is 0 if the planet had 0 of the resource on last check), allocate bonuses and set consumption statuses.
But these 3 actions can be juggled in some other ways, all of which make sense, and it needs some experimenting to see how it works.
Some solution can be then made by adding some additional check in between the steps.
Or you could just make consumption never turn off. If the resource goes below 1 after it is consumed, set it to 0 and dont give any bonuses.
This will make it impossible for colony to grow using these small portions of resources though.
The other way is also to make consumption never turn off, but give partial bonuses if the resource is harvested at least a little.
Bonus should be calculated like this:
If Stockpile/consumption >=1 then give full bonuses (bonus:= 1) and subtract consumption amount from stockpile
Else if stockpile >0 then give bonuses:=(stockpile/comsumption) and set stockpile to 0
Else give no bonus (bonus:= 0) and set stockpile to 0 (though it should already be).
The overall bonus (bonus given by 2 resources together) is calculated as
FullBonusFor1Resource*(bonus1+bonus2+bonus1*bonus2)
bonus1 and bonus2 are values between 0 and 1, the way of calculating them is described above. FullBonusFor1Resource is exactly what it means - its amount of bonus you would get if you had sufficient supply of 1 resource. Having full supply of both resources gives 3 times bigger
bonus than having only 1 resource supplied, just as in current system.
Since resource calculations are made every 5 minutes, "consumption" here is consumption of resource per 5 minutes, not an hour. Resource growth should be calculated before resource consumption for this to work.
So, if your colony produces 60 organics every hour (5 units every 5 minutes), consumes 120 organics every hour (10 units every hour), and also produces 150 anaerobes every hour (more than consumption), the income for org wil be displayed in the refinery as -60 and for ana as +30.
Every 5 minutes, 5 organics are added to refinery and immediately consumed. But since 5/10=0.5, you still get the bonuses for it, but amount of this bonus is multiplied by 0.5, and after every 5 minutes you are again left with 0 organics in your refinery, meaning that its state is the same as before and no fluctuations can happen. And since you also get full bonus for having enough anaerobes, the overall bonus multiplier for pop growth will be (1+0,5+1*0.5)=2. Twice as much than if you didnt collect any organics at all and used only anaerobes.
Well, it got a bit more complex than i thought it is, but thats mostly because im bat at explaining stuff simply.
What i mean is, are bonuses counted before resource production or after?
Most probably the order is like that: add harvested resources, remove consumed resources (which is 0 if the planet had 0 of the resource on last check), allocate bonuses and set consumption statuses.
But these 3 actions can be juggled in some other ways, all of which make sense, and it needs some experimenting to see how it works.
Some solution can be then made by adding some additional check in between the steps.
Or you could just make consumption never turn off. If the resource goes below 1 after it is consumed, set it to 0 and dont give any bonuses.
This will make it impossible for colony to grow using these small portions of resources though.
The other way is also to make consumption never turn off, but give partial bonuses if the resource is harvested at least a little.
Bonus should be calculated like this:
If Stockpile/consumption >=1 then give full bonuses (bonus:= 1) and subtract consumption amount from stockpile
Else if stockpile >0 then give bonuses:=(stockpile/comsumption) and set stockpile to 0
Else give no bonus (bonus:= 0) and set stockpile to 0 (though it should already be).
The overall bonus (bonus given by 2 resources together) is calculated as
FullBonusFor1Resource*(bonus1+bonus2+bonus1*bonus2)
bonus1 and bonus2 are values between 0 and 1, the way of calculating them is described above. FullBonusFor1Resource is exactly what it means - its amount of bonus you would get if you had sufficient supply of 1 resource. Having full supply of both resources gives 3 times bigger
bonus than having only 1 resource supplied, just as in current system.
Since resource calculations are made every 5 minutes, "consumption" here is consumption of resource per 5 minutes, not an hour. Resource growth should be calculated before resource consumption for this to work.
So, if your colony produces 60 organics every hour (5 units every 5 minutes), consumes 120 organics every hour (10 units every hour), and also produces 150 anaerobes every hour (more than consumption), the income for org wil be displayed in the refinery as -60 and for ana as +30.
Every 5 minutes, 5 organics are added to refinery and immediately consumed. But since 5/10=0.5, you still get the bonuses for it, but amount of this bonus is multiplied by 0.5, and after every 5 minutes you are again left with 0 organics in your refinery, meaning that its state is the same as before and no fluctuations can happen. And since you also get full bonus for having enough anaerobes, the overall bonus multiplier for pop growth will be (1+0,5+1*0.5)=2. Twice as much than if you didnt collect any organics at all and used only anaerobes.
Well, it got a bit more complex than i thought it is, but thats mostly because im bat at explaining stuff simply.
Let me try making it sound more simple. Here is what KiT and Turkey have said so far:KiT wrote:Well, it got a bit more complex than i thought it is...
Start of Proposal
The main thing here is that when there isn't enough resources, you don't get the full bonus for having that resource. Instead, you get (for this one resource) a fraction of the bonus. The code would be like so:
Code: Select all
If: (Stockpile+Harvest) > Consumption
Then: Modified Bonus = 1
Else: Modified Bonus = (Stockpile+Harvest)/Consumption
Code: Select all
Total bonus = (Modified Bonus 1 x Modified Bonus 2 + Modified Bonus 1 + Modified Bonus 2) x Bonus Constant
Code: Select all
If: Old Stockpile > Consumption
Then: New Stockpile = Old Stockpile - Consumption
Else: New Stockpile = 0
End of Proposal
There's something I need to say: The above assumes that the current version deactivates the bonus contributed by a resource when there isn't enough of that resource in the stockpile. Could we check to see if this is how it actually works?
A second thing: Is the bonus that both resources provide equal? As in, does having one type of resource give a bigger bonus than if you had the other type?
Nice simplification. I wish I'd done that.KiT wrote:FullBonusFor1Resource*(bonus1+bonus2+bonus1*bonus2)
The existing system uses every-five-minutes evaluation, so the bonus constants shouldn't have to change from what they are now.NeatLogs wrote:As KiT noted, bonuses are calculated every 5 minutes, so the 'Consumption' used in the above calculations is really: consumption/(12xhour).
At the time I did these graphs, I'd been using the radio tower to monitor the bonuses as resources were consumed. It appears very much this way.NeatLogs wrote:There's something I need to say: The above assumes that the current version deactivates the bonus contributed by a resource when there isn't enough of that resource in the stockpile. Could we check to see if this is how it actually works?
They are equal.NeatLogs wrote:A second thing: Is the bonus that both resources provide equal? As in, does having one type of resource give a bigger bonus than if you had the other type?
Sorry for bringing this thread back up, but this looked like the best place for this.
*Prepares chlorine and water*
Is there any way we could get a spreadsheet showing what would happen if we fed pollution directly back into morale? So -0.1 morale for every percent of pollution. I'd do it, but I don't have any colonies for solid data. I also knoiw nothing about population growth.
If someone can tell me how population growth works, I can use the proposal in this thread to get an approximation.
Edit: I found some of the info in milo's post, but I still need to know how harvest rate is calculated on an arctic planet. Like, how many resources per hour do you get for anaerobes, medicine, organics and oil. Also, I need to know how pollution currently increases.
*Prepares chlorine and water*
Is there any way we could get a spreadsheet showing what would happen if we fed pollution directly back into morale? So -0.1 morale for every percent of pollution. I'd do it, but I don't have any colonies for solid data. I also knoiw nothing about population growth.
If someone can tell me how population growth works, I can use the proposal in this thread to get an approximation.
Edit: I found some of the info in milo's post, but I still need to know how harvest rate is calculated on an arctic planet. Like, how many resources per hour do you get for anaerobes, medicine, organics and oil. Also, I need to know how pollution currently increases.
If I had to guess, Neatlogs, I would say that the population would slowly decline until you cleaned the pollution, at which point it would rise fairly quickly to its normal value then start declining again.
If you want to play with this, download Milo's spreadsheet and edit his morale calculation. (I think he took out pollution in the recent version, which makes it harder).
If you want to play with this, download Milo's spreadsheet and edit his morale calculation. (I think he took out pollution in the recent version, which makes it harder).