KirkMcDonald / kirkmcdonald.github.io

Simple web-based calculator for the game Factorio.
Apache License 2.0
553 stars 147 forks source link

Drill power calculation is incorrect #238

Open Antoine-M opened 3 years ago

Antoine-M commented 3 years ago

1 drill is shown to consume 90kW, which is correct: https://kirkmcdonald.github.io/calc.html#data=1-1-19&cp=3&items=iron-ore:r:30 However, 2/3 drill show 61 kW instead of 60 kW: https://kirkmcdonald.github.io/calc.html#data=1-1-19&cp=3&items=iron-ore:r:20 1/3 drill show 32 kW instead of 30 kW: https://kirkmcdonald.github.io/calc.html#data=1-1-19&cp=3&items=iron-ore:r:10 ~0 drill show ~3 kW instead of ~0 kW: https://kirkmcdonald.github.io/calc.html#data=1-1-19&cp=3&items=iron-ore:r:1/100000

For more than one drill the power calculation is correct except for the fractional part: https://kirkmcdonald.github.io/calc.html#data=1-1-19&cp=3&items=iron-ore:r:320

To show that this is incorrect, here's a setup that uses exactly 1.5 drills: https://kirkmcdonald.github.io/calc.html#data=1-1-19&cp=3&items=iron-plate:f:1&modules=iron-plate:se

The calculator says the drills consume 136.5 kW.

Here's the same setup in-game: 20210904144506_1

The drills actually consume 90 * 1.5 = 135 kW.