Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Dammed Brooks and Pressure  (Read 1439 times)

Quietust

  • Bay Watcher
  • Does not suffer fools gladly
    • View Profile
    • QMT Productions
Dammed Brooks and Pressure
« on: August 19, 2009, 12:25:33 am »

I've just observed some rather peculiar behavior with the brook on my map. From the beginning, I had a cistern 1 Z-level below my brook, and it never filled up further than that level (presumably from the familiar U-bend behavior). However, once I dammed the brook, it started to flood up to the same level of the brook, filling the lower level of my machinery tunnels (but not the rest of my fortress, as they're sealed off by doors, though out of sheer annoyance I crashed the game to the last seasonal backup).

Apparently, a brook outputs water at the edge of the map in the same manner as a screw pump, pushing water all the way up to the brook's Z-level, even through U-bends, but only if there's nowhere else for the water to go on the brook's normal level (which never happens unless it's dammed because the water drains off the edge just as fast as it enters on the other end).

Another curious behavior I noticed (when originally damming the brook) is that once the brook is dammed and there's no room for more water, the brook actually stops generating water at the map's edge, meaning that if you start drawing water from the brook, it won't refill, though once the water level drops close enough to the brook entrance (not sure if it's anywhere in the region tile or if a 6/7 tile has to actually reach the edge) it'll start generating water again at full force.
Logged
P.S. If you don't get this note, let me know and I'll write you another.
It's amazing how dwarves can make a stack of bones completely waterproof and magmaproof.
It's amazing how they can make an entire floodgate out of the bones of 2 cats.

Albedo

  • Bay Watcher
  • Menacing with spikes of curmudgeonite.
    • View Profile
Re: Dammed Brooks and Pressure
« Reply #1 on: August 19, 2009, 03:16:04 am »

Hmmm... those dammed brooks... what will they do next?!

Interesting catch.
Logged

Firnagzen

  • Bay Watcher
  • [CURIOUSBEAST_INSANE]
    • View Profile
Re: Dammed Brooks and Pressure
« Reply #2 on: August 19, 2009, 04:59:38 am »

Something just went click in my brain: I fully understand the pressure system in DF now.

You know how if you have a U-bend from a brook, it'd fill up to one level less than the brook? That's why. Water will teleport through 7/7 water to the lowest possible and nearest empty slot- If a brook isn't drained, that's the edge of the map. Only if you dam the brook, it'll go up that last z-level.
Logged
Christ, are you dwarves or are you elves? If you think Hell has too many demons, then you kill them till the population reaches an acceptable number.

redacted123

  • Bay Watcher
    • View Profile
-
« Reply #3 on: August 19, 2009, 05:25:53 am »

-
« Last Edit: January 24, 2016, 03:28:34 pm by Stany »
Logged

Neruz

  • Bay Watcher
  • I see you...
    • View Profile
Re: Dammed Brooks and Pressure
« Reply #4 on: August 19, 2009, 05:35:59 am »

Something just went click in my brain: I fully understand the pressure system in DF now.

You know how if you have a U-bend from a brook, it'd fill up to one level less than the brook? That's why. Water will teleport through 7/7 water to the lowest possible and nearest empty slot- If a brook isn't drained, that's the edge of the map. Only if you dam the brook, it'll go up that last z-level.

That actually makes sense, good lord, we have an explanation for the pressure system that actually makes sense!

Firnagzen

  • Bay Watcher
  • [CURIOUSBEAST_INSANE]
    • View Profile
Re: Dammed Brooks and Pressure
« Reply #5 on: August 19, 2009, 06:12:28 am »

Sure, want one?

Water, the blue, drowny, non burny stuff. Drinking this is inadvisable, may contain carp.
-Created.
-Looks around and scratches its head a bit.
-Tries to flow in any orthogonal directions: ><^v, or down a z-level.
-If it can't, it randomly decides to go diagonally or teleport.
-If diagonal, it will essentially delete itself and create a tile of water in the diagonal area at its z-level: This is why water flowing diagonally will lose its pressure.
-If teleport, it will teleport through 7/7 water to the nearest empty spot, or partially filled spot. This is the brook u-bend effect.

Magma. The red, glowy, burny stuff. Drinking this is inadvisable.
-Created.
-Looks around and scratches its head a bit.
-Tries to flow in any orthogonal directions: ><^v, or down a z-level.
-If it can't, it will go diagonally.
-If diagonal, it will essentially delete itself and create a tile of magma in the diagonal area at its z-level: This is why magma flowing diagonally will lose its pressure.
-It doesn't do teleportation, hence, the lack of 'pressure' which occurs when water teleports through other 7/7 water.

These rules are applied for each tile of water or magma. When pumped, the tiles coming out of the pump will behave like that of water, teleport and all. So contary to popular citation, magma doesn't strictly become pressurized when pumped, it's the tiles pumped by the pump alone which are pressurized.

I think that covers everything.
Logged
Christ, are you dwarves or are you elves? If you think Hell has too many demons, then you kill them till the population reaches an acceptable number.

Neruz

  • Bay Watcher
  • I see you...
    • View Profile
Re: Dammed Brooks and Pressure
« Reply #6 on: August 19, 2009, 08:11:00 am »

I knew about the teleporting water thing; that's why when you make a cistern with a hole in the bottom the water explodes out instantly. It's also why if you drop a theromonuclear lignite bin into the ocean it basically evaporates the entire ocean in a single instant as all the water teleports into it.

I meant the part about why river water only ever flows to Z-1, unless you dam it.

MrFake

  • Bay Watcher
  • Legendary Elficidal Maniac
    • View Profile
Re: Dammed Brooks and Pressure
« Reply #7 on: August 19, 2009, 08:14:50 am »

Strange that it would never teleport to the cistern, but always to the map edge until that was no longer an option.  It's quite likely that a cistern is a nearer teleportation target than the map edge.  There must be a rule for teleporting when a layer of water is static (all 7/7), which, according to FPS gains, may be an actual state.  Or maybe it's simpler: don't search for teleportation targets downwards until the current z-level is exhausted.  You could test it with a brook and two or more cisterns spaced at lengthy intervals.  Dam the brook upstream of all cisterns and watch how they fill.
Logged
Swordbaldness: a trial of patience.

Firnagzen

  • Bay Watcher
  • [CURIOUSBEAST_INSANE]
    • View Profile
Re: Dammed Brooks and Pressure
« Reply #8 on: August 19, 2009, 09:01:49 am »

Hm, true.

How's about this scenario, I wonder.
Code: [Select]
Sideview
█S██████
█ █ ████
█ █ ██ █
█______█

Where S is the water source.

Which'll fill up first? Mmm. Can anyone test this? I can't play at the moment.
« Last Edit: August 19, 2009, 09:03:55 am by Firnagzen »
Logged
Christ, are you dwarves or are you elves? If you think Hell has too many demons, then you kill them till the population reaches an acceptable number.

MrFake

  • Bay Watcher
  • Legendary Elficidal Maniac
    • View Profile
Re: Dammed Brooks and Pressure
« Reply #9 on: August 19, 2009, 11:32:45 am »

For completeness, add a third chamber:

Code: [Select]
█S███████
█ █ █ ███
█ █ █ █ █
█_______█

It's possible that one of the two equal-leveled chambers fills up before the other one, depending on how the search works.  If it's a nearest-first search, then the leftmost chamber fills first.  If it's some kind of z-test, then both may fill up at the same time, but only after the rightmost is full.
Logged
Swordbaldness: a trial of patience.

Quietust

  • Bay Watcher
  • Does not suffer fools gladly
    • View Profile
    • QMT Productions
Re: Dammed Brooks and Pressure
« Reply #10 on: August 19, 2009, 12:09:57 pm »

I've just tested it in two different orientations (south of a brook and north of a brook), and it always seems to fill closest first. Additionally, it always fills the lower levels before any higher ones.

Code: [Select]
█S███████
█≈█ █ ███
█≈█ █ █ █
█≈≈≈≈≈≈≈█
█████████

Code: [Select]
█S███████
█≈█ █ ███
█≈█≈█ █ █
█≈≈≈≈≈≈≈█
█████████

Code: [Select]
█S███████
█≈█ █ ███
█≈█≈█≈█ █
█≈≈≈≈≈≈≈█
█████████

Code: [Select]
█S███████
█≈█ █ ███
█≈█≈█≈█≈█
█≈≈≈≈≈≈≈█
█████████

Code: [Select]
█S███████
█≈█≈█ ███
█≈█≈█≈█≈█
█≈≈≈≈≈≈≈█
█████████

Code: [Select]
█S███████
█≈█≈█≈███
█≈█≈█≈█≈█
█≈≈≈≈≈≈≈█
█████████

Also, on each Z-level, one shaft won't start filling until the previous one has reached 7/7, so they do fill in a very specific order.

As a rather interesting side-oddity, when I chose a region to test this, I actually got one with two brooks, flowing in opposite directions, though one edge of the map was also set as a water source, so one of the brooks had absolutely zero flow in it (nothing but blue/white ≈, no animated ~).
« Last Edit: August 19, 2009, 12:17:14 pm by Quietust »
Logged
P.S. If you don't get this note, let me know and I'll write you another.
It's amazing how dwarves can make a stack of bones completely waterproof and magmaproof.
It's amazing how they can make an entire floodgate out of the bones of 2 cats.

MrFake

  • Bay Watcher
  • Legendary Elficidal Maniac
    • View Profile
Re: Dammed Brooks and Pressure
« Reply #11 on: August 19, 2009, 03:41:11 pm »

Can you post the seed and location for that map?  That's wicked.

And kudos on the test.
Logged
Swordbaldness: a trial of patience.

Quietust

  • Bay Watcher
  • Does not suffer fools gladly
    • View Profile
    • QMT Productions
Re: Dammed Brooks and Pressure
« Reply #12 on: August 19, 2009, 05:38:55 pm »

I don't have the seed for the one I generated previously, though I just generated one now on the first try.

[SEED:2407700922], [HISTORY_SEED:1838671615], [NAME_SEED:1924220587], using a MEDIUM size world with all other parms set to default, go to the upper-left corner of the world and move 13 tiles down and 3 tiles right. One brook flows north, and the other tries to flow south but the map edge wants it to flow north so it doesn't go anywhere at all.
Logged
P.S. If you don't get this note, let me know and I'll write you another.
It's amazing how dwarves can make a stack of bones completely waterproof and magmaproof.
It's amazing how they can make an entire floodgate out of the bones of 2 cats.

Firnagzen

  • Bay Watcher
  • [CURIOUSBEAST_INSANE]
    • View Profile
Re: Dammed Brooks and Pressure
« Reply #13 on: August 19, 2009, 09:04:00 pm »

Ahh, I think I see.

Water paths out from its source, preferentially moving along the x-y axis. Only if there's nowhere on the x-y-axis to go, it'll go along the z-axis.
Logged
Christ, are you dwarves or are you elves? If you think Hell has too many demons, then you kill them till the population reaches an acceptable number.

MrFake

  • Bay Watcher
  • Legendary Elficidal Maniac
    • View Profile
Re: Dammed Brooks and Pressure
« Reply #14 on: August 20, 2009, 12:13:26 am »

Thanks Quietust.  I love bizarre things like a double-sourced brook.
Logged
Swordbaldness: a trial of patience.