Jump to content

ONIversity: Hydrodynamics - How to Create a Single Liquid Waterfall

Recommended Posts

This is a follow up post to the previous "How to Make Waterfalls of Any Height - The Bead Pump gone wrong." That post utilizes the following property of liquids to form the waterfalls on the left, and bead pumps on the right:

  • When a liquid lands on top of a different liquid, it (1) becomes a bead and (2) starts sending liquid left and right using the single tile horizontal flow algorithm, with one change. Water flows left every tick, but only goes right every other tick (not sure why), as shown below. 

This property requires two liquids, making it impossible to use crude oil for water falls. The extra liquid is not actually needed.

What are the bare minimum left side waterfall requirements?

To create a waterfall off the left side, you need at least one bead left of the ledge, at the same height as the water. The masses must allow the liquid on the solid to move left (generally it's sufficient to make sure the mass of the hovering bead is less than the mass of the liquid on the ledge). 

min-config.png.9a69264f9b87cd10ea581e02ad1d2bc2.png minimum-left-flow.png.cf4d0ca32026439cee5d96d46b4b7eec.png

On the next tick of the game, The hovering bead drops one cell (and expands left if you have more than the viscosity), the liquid on the ledge moves left, and the waterfall is now two tiles long. 


Your waterfall will form, and remain flowing till there is not enough liquid to push left. Since mesh tiles cause liquids to leave a vent in bead form, the following configuration will get you a waterfall instantly (I use 10g for the left valve, and 185 for the right valve with water). 


Note that having a second liquid on which the water sits also forces this configuration to occur. So you can either use a second liquid, or you can use vent of a mesh tile. Also, once the waterfall has began, the left valve (over the mesh tile) is no longer needed. You can dismantle it, remove the vent, and the mesh tile, provide you are 100% certain you will always have enough liquid to keep the flowing going. It's almost like a "jump start" for a dead battery. Once it starts running, the extra valve and vent are superfluous. 

What is the minimum liquid needed to keep the waterfall going?

(Whole section is edited) Each tick of the game, exactly 1/4 of the (edit: difference in) liquid will flow from the top of the ledge to the left, provided this amount stays above the minimum horizontal flow (see here), or check later down this page for the complete matrix computation of the minimum valve needs. . For water, the minimum horizontal flow is 10g, so provided the mass on the ledge stays above 40g, the waterfall will continue. Water leaves a vent every 5 ticks, though on save/load this can actually be at most 6 ticks. As such we need to make sure that the vent deposits enough liquid to survive mass 6 times (to prevent any issues on save/load).

  • For a single sided waterfall, we need a valve rating of 116 to survive save/load (this may not be enough to get it started, but will keep it going). 
  • For a two sided waterfall (water falls off both sides), the minimum valve rating is 513. Computations are later in this post. 

The minimum horizontal flow (available at oni-db.com, thanks to @f4rtux) . @Oozinator, I don't think these values have been known for 2 years. :) 

Can this be done off the right side?

Yes. The minimum configuration to get a waterfall going requires that a 3 tile column of liquid falls over the right ledge. 


Once you reach this configuration, the waterfall will continue as long as there is enough liquid to keep it going (same exact computation as the left going waterfall). 

How do you obtain a 3 column liquid configuration?  

  • Break open a large lake and let it flow over the right side of a ledge (these can occur naturally, but not as often as left flowing water falls). 
  • Use 3 liquid vents above mesh tiles, each set at 10g, to get 3 beads to appear in the right spot, essentially using an EZ-Bead pump (or part of one) to jump start the water fall. This option is quite space intensive (see the example on the right below). The next option is much simpler. 
  • Start the waterfall using a left flowing waterfall, and then provide the needed fluid on the other side. Basically, anything you can do to force the three beads to appear in the configuration above will get your waterfall going. 
    Start fall form-fall-using-left.png.3046d2a9fe2e78740efbbab03d98c9d3.png Build other side =>add-left-valve.png.d0c2245e16b71fb6c3722821173280d0.png Remove unneeded walls/vents/valves =>remove-right-valves.png.8438697cab05b7666997655d9b55f71a.png

Alternate Ways

Here are some other ways to get the falls to form (this list is NOT exhaustive). Anything that gets liquid in the correct tiles (one on left side, 3 on right side), will work. 

  • Use a mech door (see @socooo's comment below)
  • Have a two tile wide ledge, get water flowing, and then deconstruct the ledge. Off the right side, this gets a bead pump forming pretty quickly. 
    (This is my new favorite, thanks to @socooo's comment below, and will make forming super cold liquid falls much easier). 
  • Off the right, the following works (airflow tiles are needed in a gas environment, otherwise the initial deconstruct disrupts the build).

Can I enclosed the top part with tiles to prevent accidents? What configuration should I build?

One option is to first build the waterfall (in gas or vacuum) with no extra walls, and then add the walls you need. This "usually" works. If you want to build it first, and then start it after you built it, beware.  Some configurations result in a bead pump, some results in just the mesh tile bead dropping, and some result in all liquid dripping (no beads at all).

Here are 128 different configurations, tested in an oxygen environment (vacuum gets a waterfall almost always), which you can use to pick the type of waterfall, bead pump, etc., that you want.


These 64 configurations require that a blob of water be on the ledge to start with. 


These 64 configurations are the same as above, but require no liquid inside at the start. The jump start vent on the left should get liquid either first, or at the same time as the right vent.


Notice that some configurations yield bead pumps, some yield waterfalls, and some yield neither. This all has to do with a gas/liquid/solid interaction, something I'd like to perfectly predict at some point in the future.  I'd prefer to build a contraption because I know it will work, rather than build every possible scenario and then pick the one that gets the job done...

How wide can we build this?

As wide as you want, provided you only use a single liquid.  Different liquids, and nonequal masses, cause problems with maintaining the waterfall. The picture below is perhaps as compact as you could get things, though to get this picture in survival would probably require (1) starting in vacuum, (2) jump starting all waterfalls, (3) removing all extra mesh tiles/vents/valves, (4) rerouting liquid to arrive where the old vents were and building new valves inside the top. @Cairath, this is for you. :) 


(I'm pretty sure that looks like a robot smiling at us, waiting to destroy...)

Or, we can stack a ton of these all at once, getting a massive structure. I think I'll build my bedroom and cafeteria inside this from now on, letting my dupes sleep in atmosuits. :)  Though it causes problems as the soaking wet debuff gets added on save/load if a dupe is in liquid.  It's worth it though. ;) 



Link to comment
Share on other sites

19 minutes ago, BLACKBERREST3 said:

Oxygen waterfall it is. That will look nice in my evil magma lair.

Haha.  Why stop there. Just include all the elements (a one tile gap between each) that have min horizontal flow of 0.01. :) Hydrogen, chlorine, methane, carbon, oxygen, polluted water, water, carbon dioxide, carbon (tricky melting point...), and supercoolant. Might as well alternate between super cold and hot. While we're at it, use an escher water fall to get the magma falling too. :) I may build this later, just for fun.  Beware of the "flash phase change" issue when dropping liquids on insulated insulation tiles, as it will ruin things quite quickly (make sure your cold liquid falls on airflow). 


Link to comment
Share on other sites

1 hour ago, socooo said:


For those who need it. Translation "It can also be achieved using mechanical doors".

Yep. Anything that gets the correct tiles filled with liquid. Ez beads. Doors. A tile that gets deconstructed. Tons of ways.

2 minutes ago, BLACKBERREST3 said:

I think I'm getting the hang of this. 

That configuration requires a lot more liquid to remain stable on load. You loose 7/16 liquid each tick so worst case scenario (repeated save loads at 6 tick intervals) means 40( (16/9)^6-1) = 1223 as your flow rate. It can be set at 671 and not fail till save load. Something around 700 or so will protect you unless you save/load several times in rapid succession.

@socooo, I love your stuff. I know one tile falls are doable.  I haven't seen anyone post the exact requirements. This post is an academics, more info than needed, study. Thanks for adding the mech door version.

Link to comment
Share on other sites

1 hour ago, mathmanican said:

That configuration requires a lot more liquid to remain stable on load. You loose 7/16 liquid each tick so worst case scenario (repeated save loads at 6 tick intervals) means 40( (16/9)^6-1) = 1223 as your flow rate. It can be set at 671 and not fail till save load. Something around 700 or so will protect you unless you save/load several times in rapid succession.

You are probably right about the save/load. I got this config stable at 367 however.




I am currently trying to figure out how to cascade this into a wide fall. I don't completely get it yet, but I will mess around with it for a little bit. I can cascade it to the left pretty well. it takes some tinkering to get it to the right.

Link to comment
Share on other sites

7 hours ago, BLACKBERREST3 said:

I went down a rabbit hole and there is no turning back.

I hope we run into each other, but there are probably too many twists and turns. :) I'm currently on a math related rabbit hole tangent of this. 

9 hours ago, BLACKBERREST3 said:

You are probably right about the save/load. I got this config stable at 367 however.

My computation was completely wrong (too little sleep, and way too much simplifying).  As mentioned above, the computation involves a linear difference equation. First the values (for water), and then the details (just a tiny bit of matrix math, not too much). 


  • To keep a single sided waterfall going till save/load, you need the valve set to 671/8=83.875 g/s, so 84g/s rounded up. I checked this value in game, and sure enough all computations match perfectly. Drop to 83g/s, and you'll see a hole appear every few seconds. Raise it up to 84 and after a bit the waterfall starts and continues. 
  • To keep a single sided waterfall going THROUGH save/load, you need the valve set to 14725/128 = 115.039 = 116 (rounded up). This computation assumes that the maximum number of ticks you can experience without getting more water is 6.  If this number is wrong, then the formula below will give the correct value. 
  • For a two sided waterfall, you need 324 (verified in game, but may die on save load) or 513 (survives save/load). 

Here is the math for a one sided waterfall (it was an extremely fun problem to solve).


These computations are for a waterfall off one side. 

  • Let m(t) be the mass of the central tile after t ticks.  
  • Let n(t) be the mass of the tile at the top of the waterfall after t ticks.
  • Since 1/4 of the difference in mass moves to waterfall top tile, we have n(t+1)= (1/4)(m(t)-n(t)).
  • The updated mass of the tile with the vent is m(t+1)=m(t)-n(t+1) = 3/4 m(t)+(1/4) n(t).
  • This gives the difference equation in matrix form as 
    (n,m)(t+1) = ( (-1/4,1/4),(1/4,3/4) ) .(n,m)(t).
    This means that after k ticks, we have
    (n,m)(k) = ( (-1/4,1/4),(1/4,3/4) )^k .(n,m)(0).
  • If we want to find the minimum flow without save/load, then we need both n(0)=10 and n(5)=10.  What is not known is the mass m(5) and m(0)=m(5)+x, where x is the valve setting. 
  • There are two unknown, namely m(5) and x.  The equation (n,m)(5) = ( (-1/4,1/4),(1/4,3/4) )^5 .(n,m)(0) gives the simple system
    (10,m(5)) = ( (-1/4,1/4),(1/4,3/4) )^5 .(10,m(5)+x). 
    The solution to this system is m(5) = 337/8 and x=671/8 = 83.875.

To find the value for 6 ticks (safe for save/load), just solve the same equation with k=6. The solution to (10,m(6)) = ( (-1/4,1/4),(1/4,3/4) )^6 .(10,m(6)+x) is m(6)=5435/128 and x=14725/128 = 115.039. The number 10 is the min horizontal flow rate of the given liquid.

The computations off the right side are identical, if the left side is blocked off, so liquid flow really is the same (once the waterfall starts). 

Now let's look at the math for a 2 sided waterfall. 


For a two sided waterfall, we have three variables that change each tick.  They are:

  • L(t) = left side mass after t ticks,
  • C(t) = center mass after t ticks,
  • R(t) = right side mass after t ticks.

Assuming the flow has not exceeded the viscosity (we're making waterfalls, so this is reasonable), the next tick of the game gives

  • L(t+1)=(1/4)(C(t)-L(t))=(-4/16)L(t) +(4/16)C(t)
  • C(t+1)=C(t)-L(t+1) - (C(t)-L(t+1)-R(t))/4 = (3/16)L(t)+(9/16)C(t)+(4/16)R(t)
  • R(t+1) =(C(t)-L(t+1))/4 = (1/16)L(t)+(3/16)C(t)-(4/16)R(t). 

Our matrix equation is (L,R,C)(t+1) = ( (-4/16,4/16,0),(3/16,9/16,4/6),(1/16,3/16,-4/16) ) .(L,R,C)(t), which means after k ticks we get

  • (L,C)(k) = [(1/16)( (-4,4,0),(3,9,4),(1,3,-4) ) ]^k .(L,C)(0)  (notice the 4:9:3 ratio in both the middle column and middle row)

We let R(0) =10 = R(5), then we let L(0)=L(5), and we let C(0)=C(5)+x where x is the desired flow rate. We then solve (L(0),C(5),10) = [(1/16)( (-4,4,16),(3,9,4),(1,3,-4) ) ]^5 .(L(0),C(5)+x,10) for x to get x=323.078  (L(0)=12.4992, C(0)=44.547). 

  • A two sided waterfall, if you don't care about save/load, requires a min valve setting of 324. 

For a save load, version, just change the 5 to a 6, and we get x=512.026. 

  • You can use a valve setting of 513 and the two sided fall will persist  between save load. 

 @Saturnus, I think you'll have fun with this computation, if you're following the hydrodynamics stuff. 

I did manually verify all the non save/load calculations in game, and got a perfect match. 

Link to comment
Share on other sites

4 hours ago, BLACKBERREST3 said:

This is so wrong, but it feels so right.

Now you're speaking my language. :) This is just a beautiful application. 

Should I run the math computations to see exactly how far down we can make this work?  With another vent above your starting tile, you could get a second vent adding another 10kg/s, and the liquid arriving every 2 and 3 tick, instead of once every 5 ticks, could help. It only gets you so much though to add water in one place, as percentages drop the total content very quickly. This is the best you can get with 2 pumps.


Of course, if you are happy using a vent at each spot, you get extra leverage for the same power (this doesn't use the full power of 2 pumps, rather I got tired adding more stuff). 


Now that we've got exact values, and know the way to make things, we have power. :) This was so much fun, it became my profile picture.


Link to comment
Share on other sites

This is pretty amazing. similar to the complexities of real world physics, but simplified enough to not be too resource heavy. Whats funny is that it takes a lot of effort and ingenuity to reverse engineer these sorts of things and at the same time, the devs had to code this into the game. There is so much more to this game in terms of what it is, what it will be, and what it could be...cough diseases cough cough. Now that @mathmanican has given us the numbers, there are going to be a lot more waterfall builds. Can’t wait for the next installment of hydro/aerodynamics, maybe we’ll get another crazy mechanic out of it like a low pressure escher fall or even a fountain or dupe made geyser.

Link to comment
Share on other sites

2 hours ago, BLACKBERREST3 said:

maybe we’ll get another crazy mechanic out of it like a low pressure escher fall or even a fountain or dupe made geyser.

They (thankfully) got rid of the dupe made liquid geysers, though the metal cannon still exists. Does this count as a fountain?


For a sneak peak at the next installment, I'm analyzing high pressure beads first, before I move onto multi-layer flow.



As a side note, I believe that the hardness of the solid under the liquid has an impact on the formation. Fun time ahead. 


Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

  • Create New...