Page 1 of 1

[0.17.79] Tooltip for pumps display incorrect speed (12800/s?)

Posted: Wed Nov 27, 2019 2:00 am
by spiral_power
To tank: speed 5000-6000/s, probably correct.

To wagon: speed always 12800/s ,this is not correct.
To wagon speed is a bit faster than To tank.
Is real speed 6000-7000/s ?
totank.png
totank.png (2.15 MiB) Viewed 3709 times
towagon.png
towagon.png (1.24 MiB) Viewed 3709 times
factorio-current.log
(5.13 KiB) Downloaded 152 times

Re: [0.17.79] Tooltip for pumps display incorrect speed (12800/s?)

Posted: Wed Nov 27, 2019 5:15 am
by TruePikachu
I can confirm, at least, that pumps shouldn't be capable of such speeds in vanilla, due to two different factors in `Pump::update()` (which I recently dug through for unrelated reasons). I wasn't paying close attention to the code responsible for tracking fluid transfer logging, however, so I can't say for certain if the bug is there or in the tooltip code.

According to my math, the maximum transfer rate into a fluid wagon should be the same as a storage tank; under vanilla conditions, this absolute maximum should be `(2-0)*0.4 + 2/10` = 1 internal unit/tick = 6000/s in-game, assuming the tank is continuously emptied and the pump is continuously filled.


EDIT: Disregard: I just remembered that I was also ignoring the wagon transfer logic, which might override the fluidbox-based logic.

Re: [0.17.79] Tooltip for pumps display incorrect speed (12800/s?)

Posted: Wed Nov 27, 2019 10:08 am
by migiyubi
This can be confirmed since 0.17.76.
Perhaps the fix for 77656 broke this?
viewtopic.php?f=7&t=77656

Re: [0.17.79] Tooltip for pumps display incorrect speed (12800/s?)

Posted: Wed Nov 27, 2019 8:34 pm
by TruePikachu
I just dug through the code again. Aside from a possible issue with modded pumps containing multiple input connections (going by a rough disassembly, it appears the pumping speed is limited per input connection; I don't know if this is correct or intended), the member `Pump::pumpedLastTick` is (in the case of filling a fluid wagon) first set to the amount of fluid transferred from the internal fluidbox to the wagon (which costs energy), and then in the loop per input connection the member is further added onto (also costing energy). This might mean that the pump not only can pump more than the specified speed if there's multiple input connections (only relevant to mods), but that it can also pump an additional multiple of the speed if it's feeding into a fluid wagon (which is 2x the speed in vanilla, assuming the wagon doesn't fill up entirely and the pump can take 2 internal units of fluid from the rear fluidbox every tick) — while consuming extra power as a result (e.g. a pump that's pumping 12800/s would be using 106.667% of the maximum power consumption, as listed in the prototypes).

For OP, the actual flow speed in this circumstance should top out at 12000/s, and is otherwise limited by how much fluid is available in the tank the pump is taking from. The bug is that both the movement from tank to pump and the movement from pump to train is counted.

Re: [0.17.79] Tooltip for pumps display incorrect speed (12800/s?)

Posted: Thu Nov 28, 2019 12:23 am
by TruePikachu
And I just reproduced the issue including the extra power consumption; this suggests the actual throughput is 6400/s. I'm not quite sure why the rear pump is behaving the way it is, though, from a theoretical perspective (but I think this is also a known bug that's marked as won't fix).

Re: [0.17.79] Tooltip for pumps display incorrect speed (12800/s?)

Posted: Thu Nov 28, 2019 8:51 am
by Klonan
It is just the max rate, which is limited by input and output bottlenecks

Even if it is a bug, the fix is a new fluid algorithm

Re: [0.17.79] Tooltip for pumps display incorrect speed (12800/s?)

Posted: Thu Nov 28, 2019 9:46 am
by spiral_power
The core problem is the ACTUAL speed is 6000-7000/s(6400/s?) but it displays 12800/s.
Is it really NOT a tooltip bug?
I may not matter 12800/s exceed ceiling 12000/s.

Re: [0.17.79] Tooltip for pumps display incorrect speed (12800/s?)

Posted: Thu Nov 28, 2019 3:23 pm
by TruePikachu
Except there's still a bug that the fluid transferred (and energy consumed) is double-counted. A simple fix would be to remove the energy usage and rate accumulation for filling a fluid wagon with the pump's fluidbox (since it still takes energy to fill its fluidbox from the rear fluidbox).

Re: [0.17.79] Tooltip for pumps display incorrect speed (12800/s?)

Posted: Thu Dec 05, 2019 9:22 am
by Honktown
There's been a longstanding complaint that pump numbers seem way off. ANY fluid only transfers at a max of 1200/sec at a 100->0 connection through piping or from tank-to-tank. Unless pumps have some special logic if they're connected end-to-end, it doesn't make sense.

Re: [0.17.79] Tooltip for pumps display incorrect speed (12800/s?)

Posted: Thu Dec 05, 2019 9:44 am
by Klonan
Honktown wrote:
Thu Dec 05, 2019 9:22 am
There's been a longstanding complaint that pump numbers seem way off. ANY fluid only transfers at a max of 1200/sec at a 100->0 connection through piping or from tank-to-tank. Unless pumps have some special logic if they're connected end-to-end, it doesn't make sense.
Yea, they were set crazy high so they basically never bottleneck or make additional problems

When/If the fluid logic rework happens, then the value shows will be set to something more reasonable