# Gas pumps, water pumps, pipe pumping

## Recommended Posts

The way substance moves through the pipes is all wrong, it's just wrong to attempt to split the substances in chunks. It's same for air and water.

So as an example, lets look at gases.

1. One tile fragment(like 1/9 of a tile) can hold only one type of gas at the same time, then they move around, interchanging themselves, that mechanic takes too much calculation and is pretty bad in the end, aka when you have contaminated oxygen, normal oxygen and co2 in the same room, you see all the different chunks. It could be simple visually, but it's pretty bad for devices.

2. Pressure takes too much time to fill in, in reality difference in pressure would be fixed within seconds in a large compound.

3. Due to the way gases and pressure works, gas pumps are completely malfunctioning, you can have a room at high pressure, filled with mix of oxygen and hydrogen, but pump would only do one push, then it would require quite some time to fill the lost pressure. At the same time if you have a few oxygen energizers, they all stop working cause room gas pressure is too high.

How to fix all that?

1. Let the same tile be filled with multiple gases, just give every tile fragment an array of values for all the gases.

2. Gas movement speed should be based on difference between (current gas density * density_of_current_1/9_tile) / density_of_target_tile_for_movement. So if lets say you have a room with 3000 density and another one with 500, that would change in a matter of seconds to stabilize the pressure. But the way hydrogen goes up and CO2 goes down would be a lot slower as density difference is not that big.

3. Gas pumps should just grab all the gases they are in, 30% oxygen, 70% hydrogen? grab both, by simply reducing the pressure in surrounding tiles by some capacity. The 2nd part would make sure gas pump would keep working. A gas pump should only stop working when the density of gas in the entire room is below some value, 100, 200, anything. Let the efficiency be based on density, you shouldn't need a pump in a room with 3000 pressure, to move gas to a room with 100, even a single vent should handle that kind of movement.

4. Tracking gas movements in pipes kills the programmed code. Just calculate entrance points, exit points. Mix the gases inside violently. You have pump set up in an environment with 4 gases, but it only pushes hydrogen into a machine, while does not filter any other gas? Make it malfunctioning aka pipe pressure would be maximum, but only filled with other gases, so pump wouldn't be able to get in any more hydrogen, unless a filter is installed that removes all other gases. By providing entrance points and exit points, the system would work a lot more stable. As of now, if there are multiple entries and exists, i see dots with gas moving left and right all the time. Visualizing the pumping process should be a side effect. Aka just create a pie sliced dot for every pipe part, showing how much of different kinds of gases it has in.

It's same for liquids, just a lot worse for gas, aka gas pumps are completely useless, as the pressure issue is killing them. While for liquids, you usually only pump one type of liquid.

As for liquids. Somebody peed in the pool with pure water? Well from what i know, you should no longer be able to drink from that pool. So all the water gets contaminated, just to a small extent, aka if water is contaminated by 1%, it should only have 0.01 multiplier for bad effects. And for how to clear it? Water filters. Just like gas filters, only filter our the contaminated water from what is pumped. it would never clean to 100% if you drop it back into the same pool, but o'well that's reality

##### Share on other sites

Nice idea, would solve a lot of problems with the gas mechanics while at the same time save some computing power for other things.

##### Share on other sites

I just got this game today and got really into it, I absolutely love the game! But one of the problems that I ran into that really dicked me over no matter how hard I tried to figure it out was the water/gas filtration. I tried using the water filtration to separate contaminated water into clean water and use it as a resource. But as soon as I got a final attempt of organizing all of the pipes it ended up flooding everything without even separating the contaminated water. I don't know if I did it the wrong way or if it wasn't worked on yet, but that is all I wanted to bring to attention at this point and time. I can't wait for the full release of this game with all of the potential it has.

##### Share on other sites

There are some problems about gases expanding to fill empty spaces pretty fast, specially when you are digging very deep looking up for resources, the gases of your main base will fill the vacuum you have just created and will make your oxygen pressure pretty thin. It might not be realistic but I think is fine the way it works.

##### Share on other sites

Not looking to bump my own thread, but I did some calculations using the dev tools on gases and not only does the mass thin out, but it also can spontaneously create and destroy gases depending on how and where it flows to and from. Mixing gases actually accelerates the process too, so if you have a ton of varied gases in your base, your numbers will be going wild. Their system definitely needs changing.

In fact, there's no pressure calculations going on at all - it's just dependent on mass numbers. Below 150g of air is when plants get the 'low atmospheric pressure' warning; that's it.

Gas movement speed right now is gas type dependent: Oxygen generally moves at a 12% rate, and CO2 at a 10% rate. If it's flowing into tiles of its own gas, it usually only flows the difference (10kg CO2 into 1kg CO2 only gives 900g instead of 1kg). This DOES kind of give it a speed, but it's a slow linear movement. Not like pressure flow at all.

I like your idea about the Gas and Water lines - that's exactly how Space Station 13 handles its piping; it's all just one 'pipe network' that automatically transports entry materials to the exits. I think there might be a rate limit but I dunno. It also does a similar thing with gas content. However it also uses cellular automata for it's flowing mechanics, like this game, and it produces the same 'slow drip of units' problem. There's an alternate mechanic that segments sections into rooms for instant pressure movement, but that's not feasible here.

##### Share on other sites

What the OP is talking about is very similar to how Space Station 13 handles atmosphere, and makes it very realistic.

What would be even faster is to treat each enclosed room as a single tile, and when there is a break, slowly exchange the gases between the two rooms until they reach a equilibrium based on their sizes.

There is really no need for gas simulation on every single tile.

Oh and if devs want to keep the "CO2 falls down and H2 rises up" thing, just make a quick gradient calculation on each room and make people suffocate below or above some certain height threshold.

##### Share on other sites

20 minutes ago, Bloc97 said:

What the OP is talking about is very similar to how Space Station 13 handles atmosphere, and makes it very realistic.

What would be even faster is to treat each enclosed room as a single tile, and when there is a break, slowly exchange the gases between the two rooms until they reach a equilibrium based on their sizes.

There is really no need for gas simulation on every single tile.

Oh and if devs want to keep the "CO2 falls down and H2 rises up" thing, just make a quick gradient calculation on each room and make people suffocate below or above some certain height threshold.

You mean the LINDA model for SS13. There's two different ones. That could work here; entirely depends on how efficient Klei can make their 'detect enclosed area' algorithm. Not to mention how it handles opening doors and airlocks constantly breaking the consistency.