Page 1 of 1

[2.0.76] Wrong rate calculations when amount_max > ignore_by_productivity

Posted: Sat May 09, 2026 6:01 pm
by Hasamentalist
As the title said, the rate calculations are wrong when amount_max is greater than ignore_by_productivity and productivity >0%.
I think this problem is better illustrated with an example.

A recipe that produce
amount_min= 2, amount_max= 4, ignored_by_productivity= 3

Factorio will treat this as 3 items being produced with any % productivity.

However, when productivity bonus is calculated. It'll gives an extra random[2,4] - 3 item as productivity.
When random[2,4] rolls out to be 4. You'll gain an extra item from that productivity bonus.
When random[2,4] rolls out to be 2 or 3. You'll gain no extra item from that productivity bonus.

Which means for higher productivity, you actually produce more than 3 items due to this extra item from lucky productivity bonus.
In this example with 100% productivity, you'll actually produce 3.333 items per recipe where as Factorio will calculate it as 3 items per recipe.

This wrong rate calculation due to the lucky prod event is also true when there is probability as well.


This result can be obtained with these mods if you can not replicate this with custom recipe (I'm not a modder so I can't test it myself)
Periodic Madness 0.8.14
Editor Extensions 2.5.2
Factorio Library 0.16.5
Base mod 2.0.76

Using the recipe "Medium quality polysilicon" with chemical plant 2 w/ 4 Super productivity modules.
You can obtain more Low quality polysilicon than what you've put in despite Factorio rate calculation said that you can only get half of them back.

The recipe "Medium quality polysilicon"
uses 5 "pm-low-quality-polysilicon"
and output "pm-low-quality-polysilicon" with amount_min= 0, amount_max= 5, ignored_by_productivity= 3

(I'm surprised that no one have reported this considering Factory Planner did take account of this and successfully predicted this lucky prod event)
(Or maybe there is but I just can't find it :lol:)

Re: [2.0.76] Wrong rate calculations when amount_max > ignore_by_productivity

Posted: Sat May 09, 2026 7:32 pm
by boskid
Duplicate 131864