I run into several problems with pipelayer:
- starvation: If fluid production isn't at least 100% of demand, one or more output pipes will simply not receive any fluid while others will be full.
- long startup time. If an input pipe hasn't accumulated enough fluid, no flow occurs. This happens with I feed refinery output directly into a connector.
I imagine each source attempts to distribute to one output, skipping 'full' outputs.
An alternative method:
- remove the 'input' and 'output' subtypes. All underground pipe connectors in a network are the same.
for each update:
- for each network:
- - 1: sum the fluid in the network's underground pipe connectors
- - 2: divide by the number of connectors.
- - 3: set each connector to this 'average' fluid amount.
If fluid is measured as an integer, you can store the remainder from step 2 into a single value per network, and add it back in step 1 on the next update.
This removes the magic 'pump' action from Pipelayer. If you want to increase throughput, you can still use pumps to push into and pull out of the connectors.
This fixes starvation and startup problems. All connectors will have the same amount of fluid every update with no thresholds.
This allows flow in both directions (at no performance penalty) and acts more like a series of vanilla pipes.