Hello,
a user reported a bug on my mod which seems to be caused by the base game.
In the given example the miner has a base pollution of 10/min and two modules with +50% and -75% pollution. The tooltip and the pollution production statistics show that the miner actually produces 11.25/min (+12.5%) instead of the expected 7.5/min (-25%).
The attached map save has a mining drill setup with the mentioned modules.
[0.18.47] Mining drills with negative pollution effects produce more pollution instead of less
[0.18.47] Mining drills with negative pollution effects produce more pollution instead of less
- Attachments
-
- pollution desaster.zip
- (2.3 MiB) Downloaded 56 times
-
- factorio-current.log
- (6.54 KiB) Downloaded 56 times
-
- Unbenannt.png (44.83 KiB) Viewed 1319 times
Re: [0.18.47] Mining drills with negative pollution effects produce more pollution instead of less
I did not look at the mod, but I think you are confounding the pollution modifier and energy usage modifier into one thing or are at least misunderstanding how vanilla speed modules already increase pollution.
Re: [0.18.47] Mining drills with negative pollution effects produce more pollution instead of less
Well, without knowing the details, simple math seems to work properly: 100% (base value) + 50% - 75% is actually 75% (7.5 per second). The tooltip shows -25% after the value, which is also correct, as the value in brackets is change against normal value.
Re: [0.18.47] Mining drills with negative pollution effects produce more pollution instead of less
The problem is not the 'modifier' value in the brackets, but the 'actual' value before that.
Unless I'm seriously misunderstanding how the pollution is calculated, the pollution modifiers of all effect sources are added.
pollution = base value * (100% + sum(pollution modifiers))
10/min (base value) * (100% + 50% - 75%) = 7.5/min
The miner should produce 7.5 pollution per minute, but actually produces 11.25/min.
I experimented a bit around and it seems like the game actually multiplies the pollution with the power consumption modifier on top of that.
pollution = base value * (100% + sum(pollution modifiers)) * (100% - sum(power modifiers))
I can't tell if that is intentional or not, but it's unintuitive.
And if it's intentional, then the tooltip should somehow reflect that.
Unless I'm seriously misunderstanding how the pollution is calculated, the pollution modifiers of all effect sources are added.
pollution = base value * (100% + sum(pollution modifiers))
10/min (base value) * (100% + 50% - 75%) = 7.5/min
The miner should produce 7.5 pollution per minute, but actually produces 11.25/min.
I experimented a bit around and it seems like the game actually multiplies the pollution with the power consumption modifier on top of that.
pollution = base value * (100% + sum(pollution modifiers)) * (100% - sum(power modifiers))
I can't tell if that is intentional or not, but it's unintuitive.
And if it's intentional, then the tooltip should somehow reflect that.
Re: [0.18.47] Mining drills with negative pollution effects produce more pollution instead of less
It is intentional, you can find some explanations of this mechanic on https://wiki.factorio.com/Module and https://wiki.factorio.com/Pollution#Modules.tiriscef wrote: ↑Thu Aug 13, 2020 8:44 amI experimented a bit around and it seems like the game actually multiplies the pollution with the power consumption modifier on top of that.
pollution = base value * (100% + sum(pollution modifiers)) * (100% - sum(power modifiers))
I can't tell if that is intentional or not, but it's unintuitive.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.