/evolution console command can't handle negative values

This subforum contains all the issues which we already resolved.
Tekky
Smart Inserter
Smart Inserter
Posts: 1040
Joined: Sun Jul 31, 2016 10:53 am
Contact:

/evolution console command can't handle negative values

Post 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%)
Rseding91
Factorio Staff
Factorio Staff
Posts: 14301
Joined: Wed Jun 11, 2014 5:23 am
Contact:

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

Post 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.
If you want to get ahold of me I'm almost always on Discord.
Post Reply

Return to “Resolved Problems and Bugs”