Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 2 [3] 4 5

Author Topic: Hydrodynamics Education  (Read 53614 times)

MrLobster

  • Bay Watcher
    • View Profile
Re: Hydrodynamics Education
« Reply #30 on: December 14, 2009, 07:14:34 am »

Sometimes river flow can exceed drainage (especially but not exclusively if you dam it), and the river will then (and only then) be able to push water through a U-bend to the original height of the river
This is true for pumps as well, of course (the 'studied here' link suggests otherwise).
Logged

wagawaga

  • Bay Watcher
  • He is utterly unaware of his own intentions.
    • View Profile
Re: Hydrodynamics Education
« Reply #31 on: December 14, 2009, 02:12:02 pm »

Sometimes river flow can exceed drainage (especially but not exclusively if you dam it), and the river will then (and only then) be able to push water through a U-bend to the original height of the river
This only happens if the u-blend is neat the end of the river, if you put the u-blend near the beginning of the river, the u-blend will fill, the river will start to drain, near the end.
Logged

Kanddak

  • Bay Watcher
    • View Profile
Re: Hydrodynamics Education
« Reply #32 on: December 14, 2009, 03:37:12 pm »

This only happens if the u-blend is neat the end of the river, if you put the u-blend near the beginning of the river, the u-blend will fill, the river will start to drain, near the end.
You have no idea what you're talking about, please don't post silly crap that takes 5 minutes to debunk:
http://mkv25.net/dfma/movie-1877-u-bendatupstreamendofriver
Logged
Hydrodynamics Education - read this before being confused about fluid behaviors

The wiki is notoriously inaccurate on subjects at the cutting edge, frequently reflecting passing memes, folklore, or the word on the street instead of true dwarven science.

ebenezer

  • Bay Watcher
    • View Profile
Re: Hydrodynamics Education
« Reply #33 on: December 14, 2009, 05:43:27 pm »

Now I know what killed my mayor. Rule 2.
Logged
Ebenezer cancels Dwarf Fortress: seeking infant.

INSANEcyborg

  • Bay Watcher
    • View Profile
Re: Hydrodynamics Education
« Reply #34 on: December 14, 2009, 05:43:52 pm »

2. If water is in open space above a tile which is full of water to 7/7, it finds a path through tiles of 7/7 water to the nearest non-full space on a lower z-level, and then teleports there until the space is full or there is no water left to teleport. It only pathfinds north, east, south, west, up, and down; not diagonally. It does not move creatures or objects. This one rule is "pressure".

Some things I've noticed that should be confirmed/added about how it teleports.   One, it will not path up unless it can't path orthogonally or down.   Two, it will not favor down over orthogonal directions. Three, it will go to the closest spot, which is considered the one with the fewest orthogonal or down moves.   

The key part is if you use too much water at once, it can "jump" over gaps and pits before filling them, as well as loop around obstructions.   Horizontally, it will spread out in a diamond shape, while in 3d it'll look like an upside down pyramid  (it might seem distorted, the water doesn't move all at once so some of it has time to fall)

For example, I had built a 26x23x9 reservoir next to an emptied lake to speed up refilling.  I had planed on the water falling down into the lake, instead... well see for yourself

Before
Spoiler (click to show/hide)

After
Spoiler (click to show/hide)

While it happened relatively fast in game time, it wasn't instant.  And water never appeared outside above the opening, even with the water level inside the reservoir was still higher.
Logged

Innominate

  • Bay Watcher
    • View Profile
Re: Hydrodynamics Education
« Reply #35 on: December 14, 2009, 07:42:01 pm »

I assume that Toady would be using an A* implementation (technically, Dijkstra's algorithm) for his fluid pressure. My guess is that water will teleport to the first space accessible by a series of planar-orthogonal or downwards moves, where it considers each step the closest possible move which has not yet been considered. This explains the diagonal structure seen in INSANEcyborg's picture. If no move is possible by pressure and the water is at least 2 levels below the source, it will search all considered tiles on the initial z-level to see if it is possible to move upwards and then restart the algorithm on that level (though not resetting the list of "considered" tiles, so it won't backtrack).
Logged

Moogie

  • Bay Watcher
    • View Profile
Re: Hydrodynamics Education
« Reply #36 on: December 15, 2009, 10:13:15 pm »

I get the impression that a lot of people don't understand how fluids work, and when I read the wiki articles about water and pressure, it's not hard to see why. The water pressure article still lists buggy behaviors from older versions. The "current best pressure model" is overly complex, and can be replaced by one simple rule which I am about to present.
A couple times I posted in threads explaining fluid behavior to people, but it seems like if there were better documentation of this behavior in the first place, a lot of these questions might be avoided.

(etc)


I spotted this thread yesterday and forgot to comment. I'd just like to say "thank you" for posting this, Kanddak! This is the first time I've understood the basics of what is going on with water pressure, thanks to your simple explanation. I'm no dullard, but I think people try way too hard to explain the complex systems behind this when people like me just need a simple, to-the-point answer to avoid killing ourselves in floods every time we try to work with liquids.

So again, thank you for putting it in terms that don't require hours of studying and mathematics just to make a basic pump system. :)
Logged
I once shot a bear in the eye with a bow on the first shot, cut it up, found another one, and shot it in the eye too. The collective pile of meat weighed more than my house.

spikesp

  • Bay Watcher
    • View Profile
Re: Hydrodynamics Education
« Reply #37 on: December 16, 2009, 12:19:03 am »

thanks kand with your cute water i can now work on my prototype hydro dam  ;D
Logged

Dr. Hieronymous Alloy

  • Bay Watcher
    • View Profile
Re: Hydrodynamics Education
« Reply #38 on: January 23, 2010, 09:22:08 am »

OK, so, question: if I want to make a "pressure washer" that will push goblins or monsters out of my entranceway, is it possible and how do I do it? From what I'm reading here, simply emptying a huge reservoir of water into my entrance won't do it, because the water will just teleport past the gobbies.
Logged

bluea

  • Bay Watcher
    • View Profile
Re: Hydrodynamics Education
« Reply #39 on: January 23, 2010, 10:50:57 am »

You need moving water that is not 7/7. If I understand correctly:

Code: [Select]
7777X..._
7777X..._
7777X..._
7777X..._
7777X..._
7777X..._
7=water, X=floodgate/bridge, .=ground, _=channel

You might need more water beyond what I drew, but something like that can plausibly push things off of the causeway and into the channel. The water is all on the same level - so it won't be using the teleporting rules. But there is a lot of it - so it won't be at 1 or 2 when it hits the goblins.
Logged

Dr. Hieronymous Alloy

  • Bay Watcher
    • View Profile
Re: Hydrodynamics Education
« Reply #40 on: January 23, 2010, 11:30:18 am »

You need moving water that is not 7/7. If I understand correctly:

Code: [Select]
7777X..._
7777X..._
7777X..._
7777X..._
7777X..._
7777X..._
7=water, X=floodgate/bridge, .=ground, _=channel

You might need more water beyond what I drew, but something like that can plausibly push things off of the causeway and into the channel. The water is all on the same level - so it won't be using the teleporting rules. But there is a lot of it - so it won't be at 1 or 2 when it hits the goblins.

Ahh! sounds good.

What about something like this:

Code: [Select]
777777#.#
777777#.#
777777#.#
777777#.#
777777#.#
777777#.#
777777X.#
#########

7's are water, . is empty space, # is wall, X is bridge/floodgate tile. Would something like that push anything (goblin, titan, dragon, whatever) back out the entrance again?
« Last Edit: January 23, 2010, 11:32:22 am by Dr. Hieronymous Alloy »
Logged

bluea

  • Bay Watcher
    • View Profile
Re: Hydrodynamics Education
« Reply #41 on: January 23, 2010, 11:52:13 am »

Part of the issue is that 7s don't 'push'. And the arrangement you've presented would lead to depths like: 0,0,1,2,4,6,7,7,7,7 along the path a goblin is actually going to attempt. There's only one or two squares pushing, and the goblin is walking directly opposite to the direction of travel - they might well get past the 'pushing' portion.

With the 'push off causeway' approach, any individual goblin needs to experience pushing three times to be swept away. With the approach you have, they have to be pushed all the way back up the entranceway.

Pushing is tricky enough that I don't have high hopes for that arrangement.
Logged

Dr. Hieronymous Alloy

  • Bay Watcher
    • View Profile
Re: Hydrodynamics Education
« Reply #42 on: January 23, 2010, 12:13:38 pm »

Ok, sounds good. I'm just trying to think of different/unusual types of fortress defenses, since it looks like things are going to be rougher in the new version now that marksdwarves aren't a cure-all. A causeway like that should actually be fairly easy to set up, thanks.
Logged

Djohaal

  • Bay Watcher
  • [PREFSTRING:Utter Insanitiy]
    • View Profile
    • My deviantart
Re: Hydrodynamics Education
« Reply #43 on: January 23, 2010, 10:58:50 pm »

This thread deserves all the necroing for all eternity.
Logged
I really want that one as a "when". I want "grubs", and "virgin woman" to turn into a dragon. and monkey children to suddenly sprout wings. And I want the Dwarven Mutant Academy to only gain their powers upon reaching puberty. I also have a whole host of odd creatures that only make sense if I divide them into children and adults.

Also, tadpoles.

RAM

  • Bay Watcher
    • View Profile
Re: Hydrodynamics Education
« Reply #44 on: January 24, 2010, 12:15:20 am »

What about something like this?
Code: [Select]
77777#.#
77777#.#
7##X##.#
7#444#.#
7X444#.#
7#444X.#
X#X#####
Logged
Vote (1) for the Urist scale!
I shall be eternally happy. I shall be able to construct elf hunting giant mecha. Which can pour magma.
Urist has been forced to use a friend as fertilizer lately.
Read the First Post!
Pages: 1 2 [3] 4 5