Bob's Modules


Expansion to the Modules system.

Content
4 months ago
0.13 - 1.1
215K
Manufacturing

g Weird jump in % productivity?

3 years ago

Hello,

I'm not sure if this is a bug, intended, or something else! But when I set productivity start bonus to .01, and productivity per level to .03, instead of going 4%->7%->10% as expected, it goes 4%->6%->10%. However, after that, they all go exactly 3% per tier all the way to tier 8. So the issue is only with tier 2.

https://imgur.com/a/Xf701Nk

3 years ago

I checked the code, I'm not sure what would cause it to only be 6% and not 7%.
Why is pollution only 44% on 3? should be 45%.

I think it may be a rounding issue.

3 years ago

Yeah I thought it might be rounding as well, but that makes no sense since they're full percentage numbers in the first place :/

Also, does the game support decimal percentages for productivity, speed, etc. I.e. if the module was supposed to be 2.4% prod (shows as 2% in game), and you put 4 of them in a machine, does it show as 8%? or 10%? What's the actual impact on productivity?

3 years ago
(updated 3 years ago)

when I say Rounding, I'm talking about the way computers store fractions. 1 is stored as 1+0 with a shift of 0 bits to the right. now, that's all in binary, what is 0.01 in binary? impossible to calculate, that's what, it's like a third in decimal, it's an inbetween value. if it decides to store that as just under 0.01, then 0.01+ 0.01 is not quite 0.02. If Factorio then decides to round that "not quite 0.02" down, you end up with 1%, rather than 2%.

you don't usually get that issue when you just have 0.02 set as the value, but because it is calculated as Level * PerLevel + Bonus, the result for your level 2 is the formula 2*0.03+0.01, and that must end up with a result of "not quite 0.07" so rounds down to 6% instead of 7%.

The question is, what does it actually result as in game? It has been a long time since I tried, but I'm fairly sure it's bad news, the game crops it down to actually 6%, or 2% rather than 2.4 in your example...

I'll have to try some more, but if the case is that the game rounds down, cropping off what seems to us to be an entire 1%, Well we could fix these kinds of issues by just doing +0.001, which in our case is 0.1%, which would be rounded off anyway, but it solves the rounding down issues.

For now though, I've added to my to do list that I should perform tests, and made note of my suggested fix.

3 years ago

Thanks for the explanation. That makes a lot of sense!

New response