I'm going to take this opportunity to tack on a few miscellaneous pieces of information about water behavior that have been studied since I made this thread.
And to show my support for necromancy, since it occurred yesterday, I have a question: If I want to make a waterfall out of an existing brook without using a pump, can I channel it off the map? One person said you could dig up to the map edge and then carve a fortification...
Water can leave from a map edge using rule 1; that is, if it's next to a map edge, and happens to flow in that direction, it falls off the edge and disappears. Magma doesn't do this, and pressure-pathfinding can't just find a path off an edge and make water vanish. You can get water to the map edge at low elevations by carving fortifications.
If you are on an ocean site, any map edge tile below sea level is an ocean source and water will come in through it. I haven't experimented with lakes but I suspect they'd be likely to work the same way. I keep hearing about aquifers too, but if you have an aquifer you have water shooting out of so many places I'm going to maintain a healthy skepticism about what's coming from the map edge until I see a good demonstration. Map edge ocean sources appear to only create water in adjacent tiles, without pressure pathfinding.
Speaking of aquifers, here's basically how they work: Any unsmoothed aquifer wall tile will periodically create water in an orthogonally adjacent space or a space below it. Aquifers don't create water diagonally, and they don't appear to use any pressure pathfinding; only adjacent spaces. Water can pressure pathfind into aquifer walls to disappear; the mechanics of this aren't precisely understood, but essentially you need to drop the water into the aquifer, you can't pump it in from the side.
River sources work like pump outputs and will pressure-pathfind to find a place to put water. Normally there is empty space near the downstream map edge created by water falling off said edge. 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 (which can be how people get their wells flooded); pressure pathfinding only goes up as an absolute last resort, and will take any down/horizontal path available, no matter its length, before going up. (
studied here)
Magma vents: The magma flow tiles at the bottom of vents periodically pathfind in a
vertical line to find a place to create 7/7 magma, no higher than the top level of the vent. Speaking of magma, it has been confirmed by experiment that the horizontal diffusion rates of water and magma are the same, and the idea that "magma moves very slowly compared to water" is a myth stemming from magma's lack of natural pressure.
Order of evaluation, FPS issues: (
gleaned from my walrus trapping adventures)
The water movement algorithm appears to break the map up into 16x16 blocks, and then evaluate water movement in each of these blocks starting from the top left corner, moving down in a column first before going right to the next row. You can observe this by dropping a fire bin into an ocean. (see
here,
here)
It turns out that not every water tile is evaluated on every single frame. The algorithm goes through a specific pattern, which you can observe by draining an ocean into an aquifer; on the first frame, only certain tiles will disappear into the aquifer, and so on.
It appears that long-distance pressure pathfinding is a major drain on FPS, compared to static fluids or local diffusion. When a drained ocean refills, each level begins filling quickly; as the level fills up and the remaining empty spaces become farther from the map edge, I have observed FPS deteriorating, only to improve dramatically as soon as the level fills and the ocean sources begin to fill the next level starting from spaces near the edges.
Open areas of fluids research:There is a bug where a closed hatch can break pressure pathing such that when the hatch is opened, the game doesn't recognize that there is now a clear path, and water doesn't rise up through the hole when it should.
There is another bug where water on ocean and lake sites can be vanished as if in an aquifer by dropping it into a hole.
The exact flow rates of different water sources have never been quantified. Stream & river sources seem to create water more quickly than brooks.
The behavior of underground waterfalls (river sources) has not been studied. http://www.bay12games.com/forum/index.php?topic=37861.0 (Thanks Vanguard Warden)The rules governing when waterwheels turn are still shrouded in mystery and certain power plant designs seem to work some times and not others. I've had
some luck starting a power plant by throwing a bucket of water in from a couple levels up.