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 5037 times)

btbtbtbt

  • Bay Watcher
    • View Profile
Shallow Channel / Aqueduct
« on: January 19, 2010, 10:07:09 am »

I hate to make my first post in suggestions, but it seems a good a place as any I suppose.

Anyway, I seem to have this thing about having complex water systems running through my fortresses, they're very satisfying and aesthetically pleasing in my mind. However, I often run into problems with the current channeling system. It's difficult to plan around having water running through a hallway when it takes a whole level below to sit in. I've accidentally flooded my dwarves bedrooms by aiming too high on several occasions, and not just the nobles either. (Yes, I've been playing DF for nearly three years now and I still flood forts).

I was thinking a good way to transport water through the fort would be constructions similar to a wall or floor, in the same vein as the channels and aqueducts of the 2D version. As constructions they would not interfere with the Z-level below as well. This may be incredibly difficult to work out with the 7 depth fluid system and pressure, but I'm not too familiar with the intricacies of those systems.

The specifics are as such:

Shallow Channel

Imagine a wide groove cut into the floor, about a foot deep. Creatures could walk over it and it could hold the equivalent of water at depth 1 for the sake of conservation of mass, or as close to that as DF gets anyway. Water on the level below in adjacent tiles could flow into it as long as it was above depth 6, as water at depth 6 would be near the level of the base of the shallow channel. I guess that would make a flooded shallow channel section depth 8. It might be useful to make them evaporation proof so that the water actually got into them, or possibly ignore the depth system entirely and just act as a pathway for the water to pass through instantly if it's pathing somewhere (as long as it turns blue and causes mud tracking of course). Dwarves could collect water or drink from it. If there were an adjacent normal channel as we know it the water would flow into that deeper section unless it was already full.

Aqueduct

Similar to the shallow channel, but a waist height construction that requires building materials. This would also block movement like a wall, but obviously you couldn't use it to walk on the Z-level above. As it would be higher you would require a screw pump to get water into it. This one faces the same problems with flow amounts.


I'm not sure how viable these are, but I would certainly love some way to have accessible water flowing through the halls of my fortresses without destroying the level below as well. While the current channels work with very, very careful planning, it can cause some very ugly messes and problems unless you only want dwarves living on every second Z-level.

If this is unclear in any way or completely impossible or something along those lines, please reply! I'm very willing to discuss the idea or learn why this is a bad idea.

Some examples for clarity:

Example 1: Shallow Channel not affecting Z-Level below

= = Wall
_ = Shallow Channel
+ = Floor

Upper Z-Level
Code: [Select]
====================
____________________
++++++++++++++++++++
++++++++++++++++++++
++++++++++++++++++++
____________________
====================

Lower Z-Level
Code: [Select]
====================
++++++++++++++++++++     <-- Not flooded!
++++++++++++++++++++
++++++++++++++++++++     
++++++++++++++++++++
++++++++++++++++++++     <-- Not flooded!
====================

Example 2: Shallow Channel interfacing with regular Channel (depths included)

= = Wall
_ = Shallow Channel
. = Regular Channel
+ = Floor

Empty Channels
Code: [Select]
====================
+++++_____..........
+++++_____..........
+++++_____..........
====================

Regular Channel filled to depth 6
Code: [Select]
====================
+++++_____6666666666
+++++_____6666666666
+++++_____6666666666
====================

Regular Channel fully filled
Code: [Select]
====================
+++++111117777777777
+++++111117777777777
+++++111117777777777
====================
Logged

Thanshin

  • Bay Watcher
    • View Profile
Re: Shallow Channel / Aqueduct
« Reply #1 on: January 19, 2010, 10:50:41 am »

Instead of replying point by point, let me try to answer what I think of the general idea of shallow channels and later we can compare.

"Shallow channels" as a type of built floor:

- They spend a material, just like building a floor.
- They let water pass, just like any floor, except that as long as: 1 - there's another "Shallow channel" or a full channel next to them and 2 - they are at 2/7 or less; they always spread water in that direction.

i.e.: If you build a line of channels in flat ground, water will always pass through that line unless it reaches 3/7, at which point the extra 1/7 can spread in any direction.

Thus, you'd be able to build, for example, this:
Code: [Select]
z0 (#wall, +floor, _shallow channel, ·channel)
###################
+++++++++++++++++++
____________·++++++
++++++_++++++++++++
#####+_############
#####+_############
#####+_############

z-1 (*location of top standard channel)
###################
+++++_+_+_+__######
____________*######
+++++_+_+_+__######
###################

Which, once you released water in the z0 center left cell, would become this:

z0 (#wall, +floor, _shallow channel, ·channel)
###################
+++++++++++++++++++
111111111111·++++++
++++++1++++++++++++
#####+1############
#####+1############
#####+1############

z-1
###################
++++++1+1+1+1######
1111111111111######
++++++1+1+1+1######
###################
« Last Edit: January 19, 2010, 10:58:38 am by Thanshin »
Logged

Thanshin

  • Bay Watcher
    • View Profile
(nt)
« Reply #2 on: January 19, 2010, 10:55:13 am »

(I just quoted to correct instead of modifying. Too much work will do that to me).
« Last Edit: January 19, 2010, 10:57:17 am by Thanshin »
Logged

Starver

  • Bay Watcher
    • View Profile
Re: Shallow Channel / Aqueduct
« Reply #3 on: January 19, 2010, 11:02:38 am »

This has resonance with a past idea of mine regarding revamping the fordable natural streams.  Instead of being a channel into Z-1 but a walkable surface, as they currently are, they could be merely floor tiles of 'stream' (as opposed to natural ground, but perhaps retaining "on a bed of <ground-type>" qualities visible or otherwise) equivalent to 1/7ths depth but with a little less propensity for evaporation than you'd normally find.  (Or they'd be effectively evaporation-proof due to having a continual source, but even then, in hot climates they might run dry, leaving "dried stream-bed" tile...?)

As a natural (and world-genned) feature, I also sort of imagined a deposition/erosion cycle allowing slow changes to whatever pathing the watercourse took, depending on the material of the ground it is flowing past, and whether there are native or built walls/slopes neighbouring it, and leaving an appropriate sedimentation soil-type behind when it moves.  It could then flow into and attempt to fill dwarf-dug channels (or natural hollows) if it drifted over that far.  On Z-1, you wouldn't notice a thing (except a damp ceiling giving you the usual Z-1 from water warning) except where there was an opening of some kind (channel/stairs/ramp) between them, in which case it would pour through (and effectively decommission the down-stream parts of the original stream path as it passed through the sink-hole instead).


So... I think you're describing that, give or take a detail, for your "Shallow Channel" suggestion.  Whatever the current state of the floor, expend an extra material to make it a 'foot-bath' depth of water, perhaps, and thus resiliant to erosion and repathing (though if fed from a 'natural' stream or river it might be fun to have to clear out sedimentation at procedurealy determined twists and turns, or risk miner flooding over).

How to feed (my version of) your shallow channel, though?  Most water sources you might use are up to 7/7ths deep or on the level below (and pumps would create a 7/7ths height on the channel's Z-level) so would over-supply your watercourse.  Maybe a specialist building such as a sluice-gate, built to similar spec as the pump object, in game (visually, I can imagine a "-" or "_" and "=" featuring) that can be (manually, or mechanically controlled) made to deposit just 1/7th of water onto a suitable prepared (or otherwise?) outward side as long as there is more than 1/7th on the inward one.

And of course misuse of the shallow channeling (not properly defining edges or ends to such a channel) could mean that your pleasant 'foot-bath' became a potentially level-wide feature draining down every stairwell it could reach before evaporating and gradually filling up the lower levels.  (With great power come great responsibility.  With new irrigation methods, there should come enhanced possibility of messing it up. :))


This could also tie in with a farming expansion.  At least with certain crops.  Whether it's some crops that will only grow on designated field tiles touching/within a given distance of a shallow channel with water at least at the start of a given season, or something rice-like or marsh-liking whose fields of cultivation must be placed on shallow-channel tiles with a fairly constant (or at least regular) supply of water.


But I believe the current solution being arranged for easier water management and cross-fort transfer is pipework-based, running alongside pedestrian traffic in routable corridors and spaces, etc, which might also satisfy your original need.
Logged

Starver

  • Bay Watcher
    • View Profile
Re: Shallow Channel / Aqueduct
« Reply #4 on: January 19, 2010, 11:10:59 am »

Addendum: Yeah, I suppose constrtucted channels could be 2 or 3/7ths deep, 'surface only' streams (with adjustments to any sluice delivery accordingly).  That would negate the need to artificially 'proof' them against normal evaporation (though any excess would spill over onto adjacent floor squares in 1/7th units).

But I still see natural stream-bed tiles as being 1/7ths and naturally resiliant to that issue.  (That being an old idea of mine.)
Logged

Thanshin

  • Bay Watcher
    • View Profile
Re: Shallow Channel / Aqueduct
« Reply #5 on: January 19, 2010, 11:22:46 am »

How to feed (my version of) your shallow channel, though?  Most water sources you might use are up to 7/7ths deep or on the level below (and pumps would create a 7/7ths height on the channel's Z-level) so would over-supply your watercourse.  Maybe a specialist building such as a sluice-gate, built to similar spec as the pump object, in game (visually, I can imagine a "-" or "_" and "=" featuring) that can be (manually, or mechanically controlled) made to deposit just 1/7th of water onto a suitable prepared (or otherwise?) outward side as long as there is more than 1/7th on the inward one.
No need for a special building:

A - Building a wall over an existing shallow channel would create a 1/7 wall.
B - Building a shallow channel over an existing wall would turn it into a 1/7 wall.

Both buildings would be undistinguishable once constructed and they'd let pass only 1/7 per unit o time, refilling the shallow channel next to it.

So we could build the channel up to the water source and then pierce the wall with a shallow channel, or build walls on different parts of an existing shallow channel, to stop deeper water.

Or, alternatively, to make this modification even easier, the 1/7 wall could just be a standard fortification.
Logged

Starver

  • Bay Watcher
    • View Profile
Re: Shallow Channel / Aqueduct
« Reply #6 on: January 19, 2010, 12:24:32 pm »

No need for a special building:
Well, given you could approximate a sluice by a depth-sensitive pressure-plate and one or other form of fluid-control mechanics.  This was just an idea of what might fit the technology level appropriate to the style of shallow mill-race you might end up with. :)

Quote
A - Building a wall over an existing shallow channel would create a 1/7 wall.
B - Building a shallow channel over an existing wall would turn it into a 1/7 wall.
If you mean this to create "the upper 6/7ths of a wall, leaving a 1/7th gap below", or some variation, then that's also a possibility, if playing fast and loose with 'real world' fluid dynamics.  (Although you probably don't, and I apologise for not being able to visualise this.)


Quote
Or, alternatively, to make this modification even easier, the 1/7 wall could just be a standard fortification.
The trouble with that being that fortifications already pass water through at non-1/7th levels, I'm fairly sure.  (Although do they remove pressure when doing so?  I forget.)  But I could see some variation on that theme being practical, or revamping so that this is the case.

(I'm not wedded to the idea of a "sluice building" or construction, but that's what we'd end up using in all but name.  And I could see it being mechanically/physically operated, and perhaps thus useful in fluid computing.)
Logged

Derakon

  • Bay Watcher
    • View Profile
Re: Shallow Channel / Aqueduct
« Reply #7 on: January 19, 2010, 12:37:13 pm »

How is this all different from the pipe suggestions that we see occasionally?
Logged
Jetblade - an open-source Metroid/Castlevania game with procedurally-generated levels

Silverionmox

  • Bay Watcher
    • View Profile
Re: Shallow Channel / Aqueduct
« Reply #8 on: January 19, 2010, 07:43:53 pm »

Just being able to remove floors without removing the underlying square of rock would create gutters as well. Creating overflows of water bodies/channels for any desired height could be done by allowing floodgates to be set at a specific levels. Otherwise the map code would need to be adapted to x/8 units of terrain; while certainly interesting, that would cause problems (for example with regards to display clarity).
Logged
Dwarf Fortress cured my savescumming.

btbtbtbt

  • Bay Watcher
    • View Profile
Re: Shallow Channel / Aqueduct
« Reply #9 on: January 19, 2010, 10:20:07 pm »

Thanshin, I think your shallow channel is closer to my aqueduct in that it seems to be built above the level of the floor, from what I can tell? Except you can cross it still so it's both at once. Apart from that your example showing the mechanics of how it works is exactly what I'm thinking of, where the level below is only accessible through the full channel tile.

Starver, your stream idea is again very similar, although I might leave the sedimentation bit alone for a while, at least until the channels themselves work properly. The sluice gate seems like a good way to get water into the channel if the 7/7 tile is on the same Z-level, otherwise perhaps if the water was below a lower pressure pump which works in a similar fashion would be good, only depositing water of depth 1. Possibly using a +slightly less enormous corkscrew+.

How is this all different from the pipe suggestions that we see occasionally?

The difference between using pipes and channels is that pipes to me seem solely for getting water from A to B, and would require taps in certain places for the dwarves to get to it. While one of my reasons for wanting them, it's not the only one. Channels being open would be accessible from any channel tile, would look nicer, and would have a propensity to overflow catastrophically if you stuffed up their construction, which is a lot more fun. Besides, I'm sure both pipes and shallow channels could exist at the same time, they're not mutually exclusive.

---

I think rather than cutting a bit into the floor which was my original idea, building a couple of knee height walls on top of a floor tile might be the way to go. That way the base line is the same depth as the floor which means that the depth indicators would be the same, and there would be no mucking around with depth 8 water as Silverionmox points out.

It seems the easiest to program as well. I'm liking the way Thanshin described channels of depth 2 where water prefers to path to unless there is a deeper area, and that it can choose to overflow over the side if the water in the channel goes above depth 2. Although that would mean that if water was on the floor tiles and not in the channel, that water would have to become higher than 2/7 before it started flowing into the channel. If the whole room was completely flooded it would be full of 7/7 water, shallow channel tiles or floor tiles.
Logged

Mechanoid

  • Bay Watcher
  • [INTELLIGENT]
    • View Profile
Re: Shallow Channel / Aqueduct
« Reply #10 on: January 20, 2010, 03:07:45 am »

Pipes can also be pressurized, but that's besides the point.
IMO shallow channels really should avoid messing with water level alterations, otherwise it'll just turn into a real mess while dealing with pressure and equalization, and other stuff.

What i think this best relates to is the original 2D system of fluid, where the game basically used a flood-fill technique that was forced to flow inside a channel; treating all other tiles as "walls" unless the flood-fill was generated by a floodgate. It should definitely be a construction; that way you can put bars and floodgates "on top" without trouble from building conflicts.

So, what i suggest is to just copy the 2D system in principle so that water that's in a tile that has a "shallow channel" construction on it treats all other tiles as "walls" ... To us it may look like:
Code: [Select]
##### <- Actual walls
..... <- Floor, constructed or natural
_____ <- The shallow channel constructions
.....
#####

but the game sees it as:
Code: [Select]
#####
##### <- Water on channel tiles treats floors as
..... <- Water on channel tiles treats other channel tiles as
#####
#####

As well, this lets the game conserve it's x/7 system; the game would treat the tile as having x/7 water in it, BUT it would intentionally allow dwarves in the same tile to not drown/swim/burn/etc. Effectively, a liquid on a shallow channel construction is made "invisible" :)

So for example this case:
Code: [Select]
#####
7#...
7____
7#...
#####
The water would be forced to flow into the shallow channel, and once inside, the water in that tile would no longer drown creatures who were in the same tile, or slow them via swimming, burn them with heat, etc. Also, the water would "teleport" as it normally would if it were pressurized, so if the 7/7 water had more 7/7 water in it, it would hit the shallow channel tile, say "oh shit" and then teleport into only the channel tile.

The only time the water would "flood" out of the channel, is if the water had no where to teleport. THEN the game would remove the "do not move this water onto floors" rule and it would flood outwards.

As for graphical representation, the background and forground colors of the liquid should be swapped. The forground could be made bright when the channel cannot teleport it's water anywhere, and is flooding.
Logged
Quote from: Max White
"Have all the steel you want!", says Toady, "It won't save your ass this time!"

Mechanoid

  • Bay Watcher
  • [INTELLIGENT]
    • View Profile
Re: Shallow Channel / Aqueduct
« Reply #11 on: January 20, 2010, 03:24:35 am »

the (not so) tl;dr
0. Liquid still exists in x/7; it's simply made "invisible" to characters when it's on a shallow channel (SC) tile. It doesn't drown, cause swimming, or burn; but it could heat things up slightly and effect "unconcious" creatures like down-stair tiles do. (read: drowning/burning)
1. Liquid outside SC's behaves normally, including flowing into an SC tile. Liquid on an SC tile treats all other tiles (except empty space!) as walls and SC tiles as floor. Liquids always teleports while on an SC tile. (it still exists, it's just invisible!)
2. SCs are constructions. Buildings can be put on top of them, which apply their own liquid-blocking rules (floodgates/hatches block where appropriate; grates do not. no special cases needed here. INVISIBLE)
3. When the liquid has nowhere to teleport to, it disables it's "floors are walls" rule.
4. Liquid ceases to be invisible once it leaves the SC tile, by whatever means.
5. SC's are displayed as _ when empty, and swapping the forground of the liquid to the background.

x. SC tiles can have a cousin "aquaduct" tile that has a case where it treats "empty space" tiles as walls as well, keeping the liquid "in" the tile at all times except when it has nowhere to go and like the SC, floods outwards; but it always floods outwards in open spaces before it floods outwards on floors.

y. Liquids on the same level and same tile should still interact with one another.
« Last Edit: January 20, 2010, 05:49:11 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 #12 on: January 20, 2010, 05:39:12 am »

If shallow channels forced water to path into other shallow channels unless the water was above a certain level, pressure shouldn't be a problem, because the channel could never become pressurised unless flooded as well as everything else around it. At that point it could be treated as a normal floor tile for water movement because the edges of the channel would be submerged and no longer restrictive.

Mechanoid, under your system 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?

While I'm not sure how the flow system is coded at the moment, but knowing that it teleports to available spaces it might only be another couple of lines and checks added to make the water prefer to path in shallow channels. I'm going to make a flow chart and add it to this post later because writing a whole bunch of if statements will be ugly.

EDIT: Bugger the flow chart, I'm too lazy.
« Last Edit: January 20, 2010, 10:34:27 pm by btbtbtbt »
Logged

Starver

  • Bay Watcher
    • View Profile
Re: Shallow Channel / Aqueduct
« Reply #13 on: January 20, 2010, 07:30:36 am »

How is this all different from the pipe suggestions that we see occasionally?
I was going to say aesthetics and the increased potential for disaster, but it looks like I was Ninjaed. :)


Just being able to remove floors without removing the underlying square of rock would create gutters as well.
Somewhere in the deep dark depths of time I postulated floor removal as part of revamped material use plan[1], but I never thought about linking this with my idea about streams.

Hmmm..


[1] You know, currently you can mine out an area and an experience miner leaves rocks on the floor which you can then tile the floor with the spoil... and still walk through the tunnel, despite having apparently replaced everything you just dug out, somehow storing everything you've just produced in less space than it came out of.  So either flooring would take 1/7th (or 1/8th) of a single tile's mining production or mining would produce material in units of 7 (or 8)[2], all of which would be needed to create a wall but a single unit for the floor.  And when putting a floor down you'd take (unless it was over a void) the same amount of original material up (whether natural or previously (re-)constructed floor).

[2] Which could also require that the spoil in multiple-units-per-mined-tile would have to be removed from the mine-workings to pile up in the corridors in a spread-out manner.  Either single units with little/no movement penalty for walking over or mutiples that progressively bring the walkable floor closer to the ceiling and inhibit movement.
Logged

Draco18s

  • Bay Watcher
    • View Profile
Re: Shallow Channel / Aqueduct
« Reply #14 on: January 20, 2010, 10:51:17 am »

1. Liquid outside SC's behaves normally, including flowing into an SC tile. Liquid on an SC tile treats all other tiles (except empty space!) as walls and SC tiles as floor. Liquids always teleports while on an SC tile. (it still exists, it's just invisible!)

I don't think this works the way you think it works.


#######
++___++
#######

#######
1+___++
#######

#######
21___++
#######

#######
22___++
#######

#######
32___1+
#######

#######
43___21
#######


With a sufficiently long shallow channel you could pipe water all the way across a map in 1 frame.
Logged
Pages: [1] 2