Bay 12 Games Forum

Please login or register.

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

Author Topic: Shallow Channel / Aqueduct  (Read 5031 times)

Mechanoid

  • Bay Watcher
  • [INTELLIGENT]
    • View Profile
Re: Shallow Channel / Aqueduct
« Reply #15 on: January 20, 2010, 05:22:08 pm »

With a sufficiently long shallow channel you could pipe water all the way across a map in 1 frame.
No, what i mean by teleport is by the rules that water teleports already. It just always chooses to teleport into another channel tile instead of other floors.

If there was 32 tiles of pressurized water and a T-shaped channel that could fit all 32 tiles inside at once, the water would only choose to teleport onto other channel tiles.

#._.#
#._.#
#._.#
#._.#
#._.#
#._.#
#._.#
.._..
__W__
.....
#####


Where W is a channel tile and has a large stack of pressurized water stopped by a hatch on the Z level above. When the hatch opens, the water only chooses to teleport onto other channel tiles until it has no where to teleport to, and then the water will spill out via teleportation randomly along the entire length of the "filled" channel

wouldn't it be difficult for the game to differentiate between a filled and flooded shallow channel? In other words, would a creature in a flooded room still drown on your shallow channel tile?
The liquid still exists in x/7 on the tile. When the liquid is on a channel tile, it's made "invisible" So, to drown creatures who stand on a channel tile in a [completely flooded] room, make the liquid 'visible' again.

If all 8 surrounding tiles around a shallow channel tile (including other channel tiles) are filled with 7/7 liquid, the channel removes it's "invisibility" from the liquid it holds. A 3x3 square of channel tiles with all nine tiles at 7/7 would have the center act like the liquid normally would. The same square of channel tiles with the same amount of water -1 would let you walk through the center tile just fine (because the center tile isn't technically surrounded by 7/7 water on all eight neighbors)
« Last Edit: January 20, 2010, 05:48:12 pm by Mechanoid »
Logged
Quote from: Max White
"Have all the steel you want!", says Toady, "It won't save your ass this time!"

btbtbtbt

  • Bay Watcher
    • View Profile
Re: Shallow Channel / Aqueduct
« Reply #16 on: January 20, 2010, 11:44:58 pm »

That seems good for the simplicity of not changing the water flowing system too much, but I would guess that there would be a similar amount of checks required in the code to determine whether the water is visible or not as needed just to check depth of water in the tile regarding overflowing. After all, both systems check if there are free shallow channel tiles, if not they overflow, depth dependence is just one more check.

Here's a visual of what I'm thinking at the moment:

Spoiler (click to show/hide)

The code would only need to check a few things, if certain elements were satisfied the flow would act as normal. The water would prefer to path to other shallow channel tiles as long as all connected tiles were below depth 2, otherwise the water could then flow sideways outside the channel. Similarly, if water was touching a shallow channel tile, it would only enter it if all adjacent free tiles were at or above depth 2. Pressure never becomes an issue because only water at 7/7 depth can be pressurised, at which point the water would have long since overflowed.

Clear explanations via text based media are hard.
Logged

jfs

  • Bay Watcher
    • View Profile
Re: Shallow Channel / Aqueduct
« Reply #17 on: January 21, 2010, 01:45:49 am »

Let's not have a "shallow channel" that just occupies the floor of a tile, can be walked across without getting affected by the fluid flowing in it, and also can contain as much fluid as a completely filled tile. I believe the channels in 2D should be imagined to be in a Z-level below the one you were building on.

I think shallow channels as suggested/discussed here are hard to get right without breaking physics in strange way, i.e. making inconsistent systems.
I'd rather see a system of pipes hanging below the ceiling, possibly functioning as a non-retractable grate for the level above if that doesn't have a floor, and then fountains you can attach to those pipes, to get access to tap water.
Logged

Thanshin

  • Bay Watcher
    • View Profile
Re: Shallow Channel / Aqueduct
« Reply #18 on: January 21, 2010, 02:51:46 am »

Let's not have a "shallow channel" that just occupies the floor of a tile, can be walked across without getting affected by the fluid flowing in it, and also can contain as much fluid as a completely filled tile.

I agree. As I stated before, a shallow channel should only be able to redirect 1/7 depth of water. You know, like a shallow channel would.

If you dig a one foot channel in the ground and then pour a truckload of water, the channel won't channel much.
Logged

jfs

  • Bay Watcher
    • View Profile
Re: Shallow Channel / Aqueduct
« Reply #19 on: January 21, 2010, 03:46:08 am »

And a 7/7 tile of water next to a channel shouldn't magically only pour a trickle of 1/7 water into the channel unless there is something limiting the flow.

Here's something that might work:
A dug channel changes the behaviour of fluid in a tile slightly. If there is only 1/7 water in a channel tile, it will never evaporate. If a channel tile becomes 2/7 it will look to evacuate the excess water using rules like: Prefer putting the excess water into an adjacent 0/7 channel tile, if there's no such prefer a 1/7 channel tile instead, and if there's no such either, regular flow rules apply. 1/7 water in a channel tile can also move into an adjacent 0/7 channel tile.
Combine that with a flow regulator and you should have something working
Add another rule telling that a 0/7 tile next to a 1/7 or 2/7 channel tile is considered irrigated, and you have a nice solution for more realistic farming. (Get rid of "once muddy, always muddy" replacing it with channel irrigation requiring constant flow.)
Logged

btbtbtbt

  • Bay Watcher
    • View Profile
Re: Shallow Channel / Aqueduct
« Reply #20 on: January 21, 2010, 03:51:01 am »

I would prefer not to have 7/7 water in a shallow channel as well. Whether it took 1 or 2 is fairly arbitrary though. I would err on the side of 2 because of flow rate concerns.

Actually, I would hazard a guess as to say shallow channels would be easier to implement than pipes. At least with the channels such as the one I illustrated earlier they only imply a relatively minor water pathfinding addition for water below a certain depth. Aside from that they would act like normal tiles.

Pipes bring in other issues along the lines of their capacity, how they act when not full, do they teleport water straight through, how much water comes out of the taps etc. I expect they would be more likely to create inconsistent systems. Shallow channels on the other hand would likely be closely related to the system that we already have, volume and pressure are non-issues, the only main complexity that I can see is making sure it always paths correctly, which would be somewhat shared with pipes, minus the aforementioned problems.

While I did and still do view the 2D channels as in the Z-level below, the important part that I want to take from them is their pathing. The preferential flow system that existed in 2D made water path through channels first, then flood when filled. That same system could also be used for these shallow channels, with the addition of a check for depth first.

Also, as I said before, I'm not advocating shallow channels instead of pipes, both systems could be available. I would be interested to find out the history of piping though, to see whether it fits in with the setting of the game or if they became prevalent too recently.

jfs, that latest set of rules is the sort of thing I'm thinking of as well, although at one depth higher. There would also be preferences for flowing into normal channels, possibly down stairs and things. The preferences should be fairly logical to work out.
Logged

Thanshin

  • Bay Watcher
    • View Profile
Re: Shallow Channel / Aqueduct
« Reply #21 on: January 21, 2010, 04:22:30 am »

And a 7/7 tile of water next to a channel shouldn't magically only pour a trickle of 1/7 water into the channel unless there is something limiting the flow.

Here's something that might work:
A dug channel changes the behaviour of fluid in a tile slightly. If there is only 1/7 water in a channel tile, it will never evaporate. If a channel tile becomes 2/7 it will look to evacuate the excess water using rules like: Prefer putting the excess water into an adjacent 0/7 channel tile, if there's no such prefer a 1/7 channel tile instead, and if there's no such either, regular flow rules apply. 1/7 water in a channel tile can also move into an adjacent 0/7 channel tile.
Combine that with a flow regulator and you should have something working
Add another rule telling that a 0/7 tile next to a 1/7 or 2/7 channel tile is considered irrigated, and you have a nice solution for more realistic farming. (Get rid of "once muddy, always muddy" replacing it with channel irrigation requiring constant flow.)

That's exactly what I was talking about.
Logged

Silverionmox

  • Bay Watcher
    • View Profile
Re: Shallow Channel / Aqueduct
« Reply #22 on: January 21, 2010, 03:56:40 pm »

It seems strange to me to add several new pieces of terrain that all would need their own exceptions from the rules to function, just to make the fluids flow a little smoother in some circumstances. A thorough implementation of this kind of channel buildings would require to do much of the work to implement x/7 squares of rock anyway, and that for just a little more functionality than water-filled long holes have currently. x/7 terrain will automatically make channels of more precise depths possible. The waterflow algoritm could use some improvement, but why not address it as such? For filling channels at specific depths, allowing floodgates to be set at a specific height with a lever suffices.

Pipes on the other hand would serve different purposes and open new possibilities. They would pipe much smaller quantities of water (a waterskin's worth per square), sequentially, and could easily be pressurized or coupled to pumps to pump water (or air, or any fluid) upwards, and possibly several (how many?) of them could fit in a square, while still running in different directions or with different fluids.
Logged
Dwarf Fortress cured my savescumming.

Starver

  • Bay Watcher
    • View Profile
Re: Shallow Channel / Aqueduct
« Reply #23 on: January 22, 2010, 05:55:49 am »

First of all, I like the idea of x/7ths fine control, for several reasons, but reckon that (potentially, unless there's a better way of representing it) a map-size increase of up to 7 (or 8) times to define the same nominal volume would be problematic for some.  (It could be a single byte, or three currently spare bits of a 'flag byte' already there, of course, assuming the current quality of each tile is sufficient to describe it all and you weren't able to create 'striped' channel walls of differing materials for each 7th.  And this all ignores whatever encapsulating compression algorithm you might use, except of course when laid out 'raw', in memory.)

Pipes on the other hand would serve different purposes and open new possibilities. They would pipe much smaller quantities of water (a waterskin's worth per square), sequentially, and could easily be pressurized or coupled to pumps to pump water (or air, or any fluid) upwards, and possibly several (how many?) of them could fit in a square, while still running in different directions or with different fluids.
Pipes definitely have that advantage, but I suppose it depends on era compatibility and also whether (for balance) you want to have to 'install' a tap wherever you want to get some liquid out, or just be able to define a 'water source' over a channel tile that happens to be routing, or through carefulyl designed sluices and (in the enhanced design) multi-height channel walls, so spillways and offshoot irrigations could be arranged to delivery quantities as required.

But I think pipework is already being worked on, so that's probably what's coming in.

Also, I didn't think about air.  Possibly because at the moment you don't have air presure, and thus the possibiltiy of 'air traps' and diving-bell-like features in flooded areas.  But that'd be something interesting.  Even if beyond the nominal tech level, perhaps given room to be moddable in if Toady gets it sufficiently flexibly coded.
Logged

Silverionmox

  • Bay Watcher
    • View Profile
Re: Shallow Channel / Aqueduct
« Reply #24 on: January 22, 2010, 06:59:33 am »

The Romans had piping, so no problem there. The restriction on piping will be the metal requirements and the need for maintenance.

I surely expect the need to supply taps, and leaks when trying to install one on a filled pipe.
Logged
Dwarf Fortress cured my savescumming.

jfs

  • Bay Watcher
    • View Profile
Re: Shallow Channel / Aqueduct
« Reply #25 on: January 23, 2010, 01:30:19 am »

Having metal pipes would probably need to introduce a new concept of how easily a metal oxidises/rusts and put some requirements on that for whatever is used to construct pipes.
Logged

Starver

  • Bay Watcher
    • View Profile
Re: Shallow Channel / Aqueduct
« Reply #26 on: January 25, 2010, 09:36:14 am »

Having metal pipes would probably need to introduce a new concept of how easily a metal oxidises/rusts and put some requirements on that for whatever is used to construct pipes.
Well, iron, etc, only really goes rusty wrong when in the presence of moisture and free oxygen.  Other oxides aren't as 'bad' for the structure of the metal.  Although compare the classic roman solution of lead (ignoring all the problems there) with some freshly smelted (but not from bauxite vioa hyroelectric power!) Aluminium with its tougher oxide layer.  And a different type of metal poisoning if the water is of whatever pH it needs to be to dissolve it. :)
Logged
Pages: 1 [2]