Upon examination, the fact that water in this game uses averaging between two random tiles makes the flowing water make SOOOO much more sense! It's why pools take forever to drain; they literally can't flow faster than 3 or 4 units per tick into an open square, then the square after that has to half again, and again. The speed of water calculations only masks the fact that the flow rate is abysmally slow; you can really see how slow it moves when you stretch it out over a lot of tiles - or even comes to a near-complete stop. Given that it seems to consider open air and a 1/7 tile of water as equally promising, you can very quickly see a 'blobbing' effect to water in the game.So aside from good ol' water, there's a few sets of special circumstances that affect water in the game:
- Brooks, flowing water which can be walked over.
- Murky water, which arises from a 'Murky pool' ground tile.
- Salt water, from oceans, seems to have a similar concept.
Turns out brooks are more of a workaround; a 'Brook' is actually a special floor tile that you can walk over, but still allows liquid to pass, like a floodgate. When testing Brooks, I found that the water inside was regular water, not special in any way. Channels containing it we impassable by dwarves, unlike the brook; they had to walk onto the 'Brook' tiles to get to an area I sectioned off via channeling. Not much to say here, since Brooks are more of a cheat way of making water streams you can walk across. The water is ordinary.
Murky and Salt water are far more interesting.
Murky status for water persists, even when it flows onto regular tiles again. If drained, any water that arises to fill the pool is also murky. Seems to imply water-containing tiles can inherit properties from other tiles, and spread them as they flow. All the better for a liquid body system~
'Murky' is considered a contaminant, and can be removed with a screw pump (this process is probably just deleting the murky water and spawning regular water at the end of the pump).
When regular water from the brook attempted to average between Murky and regular water, it left both tiles as regular, deleting the contaminant. However, dumping fresh water from a bucket into stagnant water does not produce this effect, it remains stagnant. Speaking of buckets; Buckets maintain their contamination status when they are dumped. Stagnant water stays stagnant, fresh water stays fresh.
When fresh water is dumped into a hole, then allowed to mix with murky water, all of the water turns fresh - effectively purifying it. It likely does this to avoid polluting an entire river.
At this point I'd like to note that if Fluid Bodies were used, you could measure contamination levels within an entire body and avoid this problem. If fresh and contaminated water mix, it averages the contamination across the bodies, so when they separate they would then have half and half contamination. Same for salt levels, speaking of which...
Time to hit the beach... for SCIENCE!
...
...Huh. Salt water is... strange. For one, when exposed to fresh water, salt water and fresh/murky water will refuse to overwrite the other. They actually WILL still share though! Seriously; although each tile remains static in whether it is 'Water' or 'Salt Water', they do appear to exchange units of liquid - effectively meaning that if you create a small hole next to the ocean, dump fresh water in there, then connect it to the open sea, you will have an infinite supply of purified water. No need for a screw pump.
Who the fuck needs Desalination plants!? Not dwarves, that's for damn sure. My guys were kicking back on the beach, drinking salt water filtered through nothing but a few drops of stagnant water
Which also seemed to spontaneously de-contaminate itself for some reason...
I also dealt with Aquifers at the beach. It seems like they fill adjacent tiles with the same system; open tiles fill with 3/4 units of fluid, so the aquifer rock is treated as a 7/7 tile that cannot be depleted. I connected an Aquifer-flooded tunnel up to salt water (pouring down the stairs) and interestingly enough, once the salt water touched regular water, it refused to 'claim' any more tiles as salt water. They were all signified as regular water.
I performed a repeat test to be sure, this time letting the salt water flow in before I triggered the aquifer. I'm sure Urist appreciated the gravity of his contribution to the field of dwarven water physics whilst he mined out an aquifer in an already-flooding room. The previous result seemed to be a fluke; salt water could claim tiles just as easily as regular water, it's just random to see if they 'jump' on a tile first. Also produced the same result: salt water and fresh water can exchange units, but cannot overwrite one another. Curious. My next thought would be to drain out regular and salt water tiles to see if they retained those values when fluids were removed - although that would take a lot of time and I feel like the answer is 'No'.
This is literally what it looks like.
So... on closer inspection, water physics are even more fucked than I had anticipated. Some of this stuff might even be worth adding to the wiki, regarding how the liquids interact. I'd really love to see how salt and murky water interact with lava, but that's an elaborate thing to set up so I'll leave it be.
Now, to figure out if Fluid Bodies could solve these problems...