KirkMcDonald / kirkmcdonald.github.io

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

Calculate pipe requirements for fluids #57

Closed KirkMcDonald closed 6 years ago

KirkMcDonald commented 6 years ago

Throughput is inversely proportional to pipe length, pumps may act as repeaters, and multiple, parallel pipes will act independently of each other. "Pipe length" refers strictly to the number of pipe segments, not any actual in-game distance covered.

The precise mechanics are fairly tricky. This reddit post spells out the numbers for the vanilla pipes, but mods can add new pipes with different capacities. Somewhat counter-intuitively, larger-capacity pipes can actually have lower throughput.

A given rate of fluid movement therefore defines a curve in a 2D space, with the minimum number of parallel pipes in one dimension and the maximum number of pipe segments in the other. If the calculator is to display this information, users should be able to pick whichever point on this curve they find most convenient. After some thought, this is most easily done with a pair of text boxes: Entering a value in one box will calculate the value for the other box, and vice versa.

This should go on the "Items" tab, next to each fluid, in the same column that the belt counts appear in for solid items.

KirkMcDonald commented 6 years ago

Added a start on this in 5655fbe29af86fd7f3a28f2f1d73f9c56b73c3b7. The feature isn't really "finished": It won't preserve user settings between solutions or page reloads. But I'm calling it good enough for now to close this issue.