OneLife
OneLife copied to clipboard
Birth cooldown time algorithm problem?
So if we look at the code for birth cooldown; https://github.com/jasonrohrer/OneLife/blob/master/server/server.cpp#L2091
We can see the the equation is set as the following
a = 2 b = 3 u = randSource.getRandomDouble(); (This returns a double between 0 and 1.0) v = pow( 1 - pow( 1-u, (1/b) ), 1/a ); x = v * 5 * 60
If 'u' in the equation above equals 0, the "pickBirthCooldownSeconds" function will output 0, as seen here:
Increasing 'u' to 0.1 increases the cooldown timer to 55.731099 seconds, as seen here;
And if the 'getRandomDouble' function returns it's maximum value (1), it will increase the cooldown timer to 300 seconds, as seen here;