Fluid filter

Post your ideas and suggestions how to improve the game.

Moderator: ickputzdirwech

Post Reply
User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7351
Joined: Fri May 09, 2014 1:01 pm
Contact:

Fluid filter

Post by bobingabout »

TL;DR
Add a fluid filter that separates the selected fluid from anything else passing through it.

What ?
Back when 0.15 was released, and fluid wagons were added, a problem that I couldn't figure out how to solve was introduced.

I haven't really thought about the issue for a while, until I started playing "Oxygen not included". One of the key entities that you use quite often in the game is a fluid/air sorter. It has 1 input pipe, and 2 output pipes, and a filter. If the fluid matches the filter, it comes out of one pipe, if it doesn't, it comes out of the other.

So that is my suggestion, fluid logistics, a filter that separates the selected fluid from anything else passing through it. (Like a filter inserter would)

As a result, if you just had one big fluid station, any train docking can use any station, and the fluids can be filtered to the appropriate pipes.

Why ?
What if a water wagon stops at a station designed for oil? there is no way to sort fluids as you would with items (Logistics robots, smart/filter inserters etc, multiple methods to sort items that have been mixed up).
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.

Engimage
Smart Inserter
Smart Inserter
Posts: 1067
Joined: Wed Jun 29, 2016 10:02 am
Contact:

Re: Fluid filter

Post by Engimage »

Currently any fluid container down to a single piece of a pipe can only contain a single fluid so it is not nesessary to make anything like a splitter.
The only really useful thing I think would be adding a filter to a pump. This would really simplify things.

User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7351
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: Fluid filter

Post by bobingabout »

You already have a filter with a circuit connection, the problem with that is that it doesn't prevent the pump from filling with the wrong liquid, hence the idea of a filtered splitter type entity. But it would need to be pumped, to make sure the current input fluid box empties to not only allow the new type of fluid to flow in, but empty what is likely a storage tank connected to it's input.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.

urza99814
Long Handed Inserter
Long Handed Inserter
Posts: 91
Joined: Sat Dec 10, 2016 12:57 am
Contact:

Re: Fluid filter

Post by urza99814 »

The plans for 0.16 include "fluid squashing" which, IIRC, fixes the issue of having pipes blocked with 0.0 of some other fluid. Once that's implemented it should be pretty easy to build a fluid filter using regular pipes and pumps, so I don't think there will be any need for adding new structures to handle that.

https://wiki.factorio.com/Upcoming_features

JohnyDL
Filter Inserter
Filter Inserter
Posts: 533
Joined: Fri May 16, 2014 3:44 pm
Contact:

Re: Fluid filter

Post by JohnyDL »

one of the ways you could do it for trains is reading the trains contents and circuit conditions on 7 pumps for the 7 liquids but that has limits it relies on having unique fluids to a train for the circuit network to be faster than the pumps etc

I agree with you that this is something that'd be useful in other situations too though, cleaning out and not wasting the contents of pipe mistakes and mixed fluid pipes (we do it with belts 2 things on the same lines why not fluids)

in the interim would circuit conditions on tanks to pumps pulling from them do the same trick? if water >0 enable on one pump, if water = 0 on a second from the same tank

urza99814
Long Handed Inserter
Long Handed Inserter
Posts: 91
Joined: Sat Dec 10, 2016 12:57 am
Contact:

Re: Fluid filter

Post by urza99814 »

Last time I checked, you can't use more than three pumps at a train stop. It'll pick 3 to use based on build order, and even if you disable those through the circuit network it won't use any others.

Circuit conditions on tanks will work for some time but eventually it will always fail -- you'll end up with 0.0 (or even 0.9...the network detects 0.9 as 0) of some fluid stuck in the tank, the pumps won't pump it out and nothing else will be able to fill it. But as I said above, I believe that's planned to be fixed in 0.16 which should make filtering pretty simple then.

urza99814
Long Handed Inserter
Long Handed Inserter
Posts: 91
Joined: Sat Dec 10, 2016 12:57 am
Contact:

Re: Fluid filter

Post by urza99814 »

Turns out you can actually build a working multi-fluid train station in vanilla Factorio already. Here's the blueprint/screenshot, after which I'll explain how it works. In my example I have a train stop that can unload oil, water, or petroleum; but you should be able to just keep blueprinting each section to expand it as much as you need.
Fluid filter blueprint and screenshot
Basically the idea is it's a multiple stage filter...the first stage removes the oil, the next stage removes the water, and the final stage removes the petroleum.

Couple tricks you need to use to make this work...first, you have to pump directly from fluid tanks, with no extra pipes attached as that would allow fluid to back up inside those pipes. So for example at the first stage, the pump on the top fills the tank from the train; the pump on the side removes any oil; and the pump on the bottom moves anything that isn't oil on to the next stage.

Next, you've gotta deal with the issue of 0.9 fluid registering as 0. So, instead of pumping if the fluid in the tank is greater than 0, you set up an S-R latch and a basic timer circuit. When there's oil in the first tank, it set the first latch, and it outputs A=2 (A=1 from the set line, and another A=1 from the latch itself). When the tank empties, the latch will hold the output at A=1. So then when A=1, the timer starts to count up on B and when B = 40 it stops the timer and resets the latch. When A>0 you pump out oil, when A=0 you pump on to the next stage. The timer value of 40 was just a rough estimate, it needs to be high enough to give time for the tank to fully empty but low enough that it resets before the next fluid starts to come in. May need to adjust that based on your train timings and how fast your factory is able to consume the fluids.

Finally, you've gotta deal with the same 0.9 = 0 issue when initially filling the tanks. For that, I connect the tank to the train station and read the train contents; that way the signal goes high immediately when the train arrives and you don't have that fill delay. But if you're carrying multiple fluids on the same train you might need to do something else...in that case I'd suggest separating the two pumps, and using a second timer circuit for the pump that moves the fluid on to the next stage so that neither one will activate until the fluid level rises above 1. That might also work for filtering any pipe input instead of only input from trains, but I haven't tested that at all. Not sure if you could get the timer precise enough to use it that way.

In theory you could also detect two separate liquids at each stage, making it a bit more conpact...since my design leaves one open output on each tank. But then you'd need a few more circuit components to control the bottom pumps. And if you were only going to filter three liquids you could do it with only two tanks as in my example the final tank would only ever hold petroleum, so that tank and related circuit components could be removed entirely.

I also just noticed that my blueprint leaves out a green wire between the second and third tanks. It's not necessary in this case since that whole third tank could be omitted, but if you were going to expand it to more than three fluids you'd need to add that so it would carry the train signal all the way down.

Post Reply

Return to “Ideas and Suggestions”