Factorio

Factorio

View Stats:
Malidictus Nov 11, 2024 @ 2:52pm
Multi-fluid train station?
I've been playing around with multi-cargo train stations all day today, and it's been a ton of fun getting them to work reliably (as opposed to manually fixing endless stuck trains). I was wanting to do something similar with fluids, but I can't quite wrap my head around it. Not even sure if it's possible. Hence why I'm here. Has anyone done this before? Google doesn't find anything - or maybe I suck at searching.

Obviously, I can't store all the fluids in the same tank/system like I could with cargo, so I'll need multiple tanks. Fair enough. But then, how do I control the fluid flow? I can't attach a wire to a pipe and shut it off on signal input like I can with a belt. I could use pumps, but those have incredibly limited throughput. I'm loading trains, so ideally I'd want 9 pumps' worth of throughput. I can get that by attaching the tank directly to the pumps via pipes. Space Age gave pipes functionally infinite throughput, after all. But then, that's a hard connection that I can't detach conditionally.

Is there even a decent way to do this? You know, other than attaching 9 pumps to every tank and then another 9 pumps to the train. And that's only 9 because I'm using trains with three cars. There has to be a smarter way of doing this. I've looked into valve mods, but those have the same limitations of limited throughput and... still no easy on/off control anyway. Not sure what to do here.
< >
Showing 1-15 of 46 comments
Fel Nov 11, 2024 @ 3:00pm 
You can set filters to pumps, either manually or through circuit network.
Of course, enabling/disabling works as well but filters can be a complement to that.

Pumps can be used to separate the pipes leading to the pumps for the train, allowing the pipes to be re-used between liquids (possibly with some pumps in the other direction to empty the pipes when needed as well).

Not sure if you can do this much simpler than this though.
Simon Nov 11, 2024 @ 3:05pm 
I would put the fluid I want into the train and use the fluid wild card to tell the train where to drop it and use circuits to tell the station what fluid I want. This way the train doesn't need to know what fluid it'll haul, it'll haul whatever you give it, and you can give it whatever you need.

The alternative is using train IDs and that just sounds like a mess to me.

For the pumps themselves, probably sushi pipes if you have many fluids. I've not played with those yet though.
Last edited by Simon; Nov 11, 2024 @ 3:06pm
Malidictus Nov 11, 2024 @ 3:44pm 
Originally posted by Simon:
I would put the fluid I want into the train and use the fluid wild card to tell the train where to drop it and use circuits to tell the station what fluid I want. This way the train doesn't need to know what fluid it'll haul, it'll haul whatever you give it, and you can give it whatever you need.

I don't see how I can do that with just a single station, though. I would still need to control what gets pumped into the train if I want to pump more than one thing. I say this, because I will need to pump out any leftover fluid from the system before pumping in a different kind, else the fluid won't flow. This means I need to know when to pump in and when to pump out.

Controlling the trains isn't an issue - I'm already using Project Cybersyn, which handles the routing. I can do this quite easily by just building multiple stations, each dedicated to a different fluid. What I'm trying to accomplish is combining them all into one. Say I want to feed Petroleum, Light Oil and Heavy Oil into my train network from the same station, loading only what's needed when it's needed - when a train arrives at the station. Is there a decent way of doing that?

I can do this with items, because items can occupy the same container. Fluids can't.
Esxhaton Nov 11, 2024 @ 3:59pm 
Assuming a circuit network telling the station which fluid needs to be loaded next, I would probably structure it as follows:
- have a set of liquid tanks as big as the wagons on your train, they will be pre filled by the fluid requested next.
- the previous set of containers is connected via pumps to multiple fluid storages, these pumps are by default inactive
- according to the fluid requested by the circuit network: you first close the pump from to loading tanks to the train, flush that tank, open the pump from the desired fluid until loading tank is full. Close that pump and open the one that will load the train. Close and repeat after the train is full and leaves the station

I have never attempted this, so I am not even sure if it is possible to solve it in this way, but maybe it can still help a bit
POWER WITHIN USER Nov 11, 2024 @ 4:55pm 
Each wagon conveniently happens to have three ports, if you don't mind working at down to 1/3 of the throughput.
Esxhaton Nov 11, 2024 @ 5:47pm 
Originally posted by POWER WITHIN USER:
Each wagon conveniently happens to have three ports, if you don't mind working at down to 1/3 of the throughput.
Wait, can’t you have 6 pumps going into (or out of) a fluid wagon from one side?
Fel Nov 11, 2024 @ 5:59pm 
Only 1 per "tank" on the wagon can actually connect but yes, you could have a total of 12 pumps around the wagon, with 3 per liquid.
knighttemplar1960 Nov 11, 2024 @ 6:12pm 
Originally posted by Simon:
Originally posted by POWER WITHIN USER:
Each wagon conveniently happens to have three ports, if you don't mind working at down to 1/3 of the throughput.
If you use both sides you can work at only 2/3 the throughput.
Nope, the fluid wagon has only 3 ports total, all on the top of the wagon. You can only use 3 pumps simultaneously.
https://wiki.factorio.com/fluid_wagon

@OP there are 7 fluids available on Nauvis, Crude oil, heavy oil, light oil, petroleum, lubricant, sulfuric acid, and water. If you don't mess with the map settings water is all over the place. Its easy to access and the new pipes make it easy to transport long distance. So you can discount water. That leaves 6 fluids a station would have to handle. If you use 6 pumps, 3 on each side, you can dedicate a single pump per side to a particular fluid and you can use the circuit network to read the contents of the train and then use it to activate the correct pump each leading to a tank dedicated to that one type fluid.

Your max fluid unloading speed in Space Age/2.0 is 3,600l/s with the changes to the fluid system.

You can also barrel fluids and you can mix and match barrels on the same cargo wagon. Bulk inserter hand size with all upgrades is 12 and you can have 12 inserters, 6 per side, on a cargo wagon. The inserter will move 12 barrels from wagon to express belt in 52 ticks. That's 13.85 barrels/sec. Each barrel holds 50 liters so 12 bulk inserters can unload 8310 liters of fluid/sec. You can actually unload a cargo wagon carrying barreled fluids faster than you can unload a fluid wagon using pumps.

The downside to using barrels is you must recycle the barrels but since full barrels and empty barrels take the same amount of space you can use the same wagon to return empty barrels. The other downside is the cargo wagon only holds 20,000 liters worth of fluid while the fluid wagon holds 50,000 but barrels solve your sorting problem easily. You would just need more trains to move the same amount of fluid but your transfer rate will be more than double.
Ghevd Nov 11, 2024 @ 8:15pm 
If you want fluid logistics with extra steps you can just barrel it. :steamhappy::steammocking:
Malidictus Nov 12, 2024 @ 4:44am 
The biggest problem I've run into so far is that pumps hold on to fluid after they're done pumping. The only way to purge the pumps is through their output, which is pointing to the fluid rail car. This is fairly simple with cargo rail cars, since I can both load and unload at the same time. Can't do that fluids, since I would need to disable the loading pumps in order to connect the unloading pumps.

Means I need to pump in, then out, then back in again. I'm not really sure how to do something that complex with existing circuit logic. And more to the point, it's going to slow down loading and unloading anyway. So I need a different solution.



Originally posted by knighttemplar1960:
That leaves 6 fluids a station would have to handle. If you use 6 pumps, 3 on each side, you can dedicate a single pump per side to a particular fluid and you can use the circuit network to read the contents of the train and then use it to activate the correct pump each leading to a tank dedicated to that one type fluid.

That's not really a viable option, as it hard-limits loading and unloading speed to 1200 units per second, which is the speed of one pump. I'm already limiting throughput by routing multiple trains through the same station. I can't afford to limit throughput even farther by not using three pumps per rail car. At that point, I may as well just build one train station per fluid, since that's essentially what this is.



Originally posted by Esxhaton:
have a set of liquid tanks as big as the wagons on your train, they will be pre filled by the fluid requested next.

That could work, at least in theory. The problem is that I've never been able get measurements precise enough for this to work. I tried it with cargo, and it worked MOST of the time. Every so often, though, individual units of cargo would slip by and overshoot the limits. In the case of Fluids, pumps hold on to quite a but if fluid that I can't really control. I don't think I can read their fluid contents, either. This means that even if I precisely measure the fluid in the tank, I'm going to end up with extra fluid in the pumps.

Suppose I can try to manually account for that by filling the tank to "train capacity - 9*400" and hope nothing overshoots. I'm headed to work in a bit so I won't be able to try this until later. I am worried about fully pumping a pipe network dry, though. Pump speed seems to vary based on the fluid contents of the source and target fluid systems, so that might also affect throughput. Again, I'll run some Creative Mode tests when I have the time. Unfortunately, this is adding quite a few layers of complexity and footprint size, so we'll have to see how it goes.



Apropos of nothing, but I was really hoping the Fluid Must Flow mod could help me with this. That mod has pumps that go up to 120 fluid per second... in theory. In practice, there seems to be a hard cap of 100 fluid per tick for a single pump, meaning those pumps never go over 6000. Moreover, they rapidly lose their throughput when the source tank is less than 50% full and the target tank is more than 50% full. I'm not sure why, but I don't think it's anything the mod maker can control. Even with Fluid Must Flow, I don't think I can get away with not using lots and lots of pumps.
knighttemplar1960 Nov 12, 2024 @ 6:42am 
Originally posted by Malidictus:
Originally posted by knighttemplar1960:
That leaves 6 fluids a station would have to handle. If you use 6 pumps, 3 on each side, you can dedicate a single pump per side to a particular fluid and you can use the circuit network to read the contents of the train and then use it to activate the correct pump each leading to a tank dedicated to that one type fluid.

That's not really a viable option, as it hard-limits loading and unloading speed to 1200 units per second, which is the speed of one pump. I'm already limiting throughput by routing multiple trains through the same station. I can't afford to limit throughput even farther by not using three pumps per rail car. At that point, I may as well just build one train station per fluid, since that's essentially what this is.

If you want single station and throughput use barrels.
Fletch Nov 12, 2024 @ 6:56am 
7 fluids available on Nauvis, Crude oil, heavy oil, light oil, petroleum, lubricant, sulfuric acid, and water.

There is also the two Steam types (boiler "colder steam" and the nuclear "hotter steam") if one wants to get truly pedantic on every possibility.

Anyhow, they'll need at least 3 wagons (times the 3 tanks per wagon) gives you 9 "storage" slots capable of holding all Nauvis' different types of fluids. What's the complexity here? Just pump in the correct fluid type into the correct tank in the correct wagon at both rail stops (source and destination). If you need more "throughput" for a particular fluid type, then you can can just dedicate all 3 tanks in a wagon to that particular fluid (and scale upwards with more wagons/tanks as needed). Would not try to mix/match different fluids into the same tank using some kind of complicated circuit controller and dealing with partial fluid remnants in a pipe. There is no "belt filter splitter" equivalent on pipes.
Malidictus Nov 12, 2024 @ 8:19am 
Originally posted by Fletch:
What's the complexity here? Just pump in the correct fluid type into the correct tank in the correct wagon at both rail stops (source and destination).

You just yatta-yatta-ed the actual design here - i.e. the subject of the discussion. You may as well advise me to "just build a multi-fluid train station". The problem is doing that while maintaining 3 pumps per fluid per tank. I suppose I can stick 6 pumps on each side and toggle them in groups of three, but that still only gives me a maximum of 4 fluids. Probably enough for a basic Oil Refinery, if I use one of the groups as oil output, but still - that's not a scalable design. What if I want more than two fluids? What if want to output three fluids and some cargo?

Obviously, that's asking a lot, but I can do all of this with cargo stations without any issue whatsoever. Indeed, I can do this with fluid OUTPUT quite easily, as I can purge the lines directly into their holding tanks. That means I can use the same set of pipes to unload Heavy Oil and Fish Oil (my own resource from Biodome Industries) without needing multiple sets of pumps. I can't do the same for loading trains, however, because I've no means of purging the upload pumps. The only way to pull fluid from those is to push it into the tanks, which I can't drain at the same time.

*sigh*

I'll try using separate fluid systems and see what I can do. I've no intention of trying to load exactly the precise amount of fluid, however. Just about every component of fluid handling holds on to its own fluid slop that I can't read via signals. Only thing I can read is container levels, not those of their connected pipes or pumps. Not to mention, throughput nosedives when tanks approach their caps both upper and lower. I'll have to figure out a way to use tanks substantially larger than what a single train can carry.



*edit*
Best I can do is this:

https://steamcommunity.com/sharedfiles/filedetails/?id=3364644405

Those are Krastorio fuel tanks, modded to hold 450K fluid each (so 9 regular tanks, or 3 train's worth). I've connected each to a separate fluid system from the tank directly to the pumps. Green wire reads Cybersyn train request (it's output as a negative) and all the pumps are set to only activate if their requisite fluid is < 0. This disables them on blank signal (no train at station) and when something else is being loaded. I could potentially handle four fluid streams that way.

It's not what I was hoping for since that's a LOT of pumps, but it's better than the ugly monstrocity I had set up before.
Last edited by Malidictus; Nov 12, 2024 @ 8:35am
Fletch Nov 12, 2024 @ 8:41am 
Originally posted by Malidictus:
Originally posted by Fletch:
What's the complexity here? Just pump in the correct fluid type into the correct tank in the correct wagon at both rail stops (source and destination).
<snip>

I was incorrect and thought you can use each of the 3 tanks in a wagon separately, you can't (I must be misremembering from an older version of the game). Anyhow, what specifically are you trying to do? You want a single train station capable of transporting 9 fluid types? The simple answer is a train with 9 fluid wagons and each wagon dedicated to a single fluid type. That is by definition a "multi-fluid train station".

If you are trying to make a single wagon capable of transporting all 9 different fluid types, well, I can't help ya there, but I'll watch to see what you come up with. Whatever your solution is, it would be the same solution needed to make a single pipe capable of transporting all 9 fluid types too (with whatever circuit network logic to prevent fluids from mixing).
slothrop Nov 12, 2024 @ 8:51am 
Originally posted by Fletch:
Originally posted by Malidictus:
<snip>

I was incorrect and thought you can use each of the 3 tanks in a wagon separately, you can't (I must be misremembering from an older version of the game). Anyhow, what specifically are you trying to do? You want a single train station capable of transporting 9 fluid types? The simple answer is a train with 9 fluid wagons and each wagon dedicated to a single fluid type. That is by definition a "multi-fluid train station".

If you are trying to make a single wagon capable of transporting all 9 different fluid types, well, I can't help ya there, but I'll watch to see what you come up with. Whatever your solution is, it would be the same solution needed to make a single pipe capable of transporting all 9 fluid types too (with whatever circuit network logic to prevent fluids from mixing).
Yeah the 3 tanks did used to be separate in an early version, but they changed that a while back to merge it into 1 tank.
< >
Showing 1-15 of 46 comments
Per page: 1530 50

Date Posted: Nov 11, 2024 @ 2:52pm
Posts: 46