Page 1 of 1

/evolution console command can't handle negative values

Posted: Sun May 28, 2017 11:52 am
by Tekky
Normally, when I use the /evolution console command, I get a result such as this:

Code: Select all

Evolution factor: 0.9066. (Time 20%) (Pollution 45%) (Spawner kills: 33%)
However, if one of these three categories is negative (for example by setting game.map_settings.enemy_evolution.time_factor to a negative value), there is an error in the calculation (overflow or signed/unsigned mismatch) and the output of the /evolution command is the following:

Code: Select all

Evolution factor: 0.8777. (Time 4294967287%) (Pollution 63%) (Spawner kills: 46%)
Instead of this, it would have been correct to display the following:

Code: Select all

Evolution factor: 0.8777. (Time -9%) (Pollution 63%) (Spawner kills: 46%)

Re: /evolution console command can't handle negative values

Posted: Sun May 28, 2017 8:24 pm
by Rseding91
I've fixed the underflow error but the display isn't going to show -9% because the numbers it's showing are a % of the summed values applied to each section compared to the current value.

So if evolution is 0.4 and time has given -0.4 with pollution giving + 0.8 it will show: 0.5. (Time 50%) (Pollution 50%) (Spawner kills: 0%). Negative evolution increase just isn't something the game was built around and it doesn't handle it well.