Bay 12 Games Forum

Please login or register.

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

Author Topic: Seasonal Floods: 3D  (Read 4965 times)

Draco18s

  • Bay Watcher
    • View Profile
Seasonal Floods: 3D
« on: March 09, 2008, 10:43:00 pm »

So, we all want our seasonal flooding back, yet due to the limitations of the current flows and the z-axis, how should Taody go about implementing it?

I'm of the opinion that a second river depth be created when the river is placed, such that the river (as it is seen now) is one level lower on the map and that a wider "Flood Plain" dent the map at the current river's z-level, which floods once or twice a year.

Side:

code:

###          ###
######7777######
################

Logged

Kagus

  • Bay Watcher
  • Olive oil. Don't you?
    • View Profile
Re: Seasonal Floods: 3D
« Reply #1 on: March 09, 2008, 10:57:00 pm »

Who's 'Taody'?  A zen amphibian?


I think that river flooding would indeed be a nice thing to have again, but I think the river 'source' acts differently than a standard water source.  It may be a bit difficult to tweak into an actual production point, instead of just something that can equalize the water in the river.

I think only major rivers should flood.  We really don't need brook floodplains, and having a four-tile wide stream flood into a deep floodplain seems strange to me...

But if this is implemented, I'd also like to see a bit more of a difference between soil and sand.  Growing crops in soil sounds fine to me, but growing it in sand has always looked weird.  Unless it's a cactus, but we don't grow those now do we?

This way, if you settle in a desert environment with a major river, you can grow whatever crops you desire in the floodplain after a good flood has deposited a nice layer of mud.  Then we can really go 'nile style'.


And while we're at it, some banks or maybe a little overhead for the underground river would be nice.

Drunken

  • Bay Watcher
    • View Profile
Re: Seasonal Floods: 3D
« Reply #2 on: March 09, 2008, 11:05:00 pm »

Assuming Kagus is right about this suggestion being difficult to implement I think any change in how rivers and fluids work in the game will require a complete revamp of the whole fluid system. I would really like to see a fluid arc on the dev notes. There are several other threads on this forum all dealing with different aspects including rain having an affect on ground water (also related to river flooding), other fluids such as alcohol and blood being implemented properly as fluids, water pressure, problems with the slowness of current flows and most importantly in my opinion, the massive lag that large bodies of water can cause. I am breathless with anticipation about what this game will be like in a years time regardless of whether fluids gets changed by then or not.
Logged
A stopped clock is right for exactly two infinitessimal moments every day.
A working clock on the other hand is almost never ever exactly right.

Draco18s

  • Bay Watcher
    • View Profile
Re: Seasonal Floods: 3D
« Reply #3 on: March 09, 2008, 11:57:00 pm »

quote:
Originally posted by Kagus:
<STRONG>Who's 'Taody'?  A zen amphibian?</STRONG>

Typo, albeit a funny one.  ;)

As for the fluid dynamics, we don't need to change how fluids work, just create a secondary river source tile on the floodplane level that doesn't always spawn water (only durring a flood season).

Now that I'm thinking about it, I think the whole length of the river would have one of these spawn tiles so we don't have to wait for the flow to trickle its way down, instead each day the next one is turned on and starts spewing water, which will spread mostly sideways as the one after it starts spewing, etc. and the floodplane would quickly fill up, simulating a real flood.  After that they all turn off and the water drains away.

I also agree on the "only major rivers flood," though I think they'd just flood higher and more often (even after a snowmelt brooks overflow their banks).

Logged

Savok

  • Bay Watcher
    • View Profile
Re: Seasonal Floods: 3D
« Reply #4 on: March 10, 2008, 12:19:00 am »

A brook could, instead of flooding into a floodplain, flood water of a height of 1-2 (though could be more, depending on world circumstances) for several tiles to each side of it, getting everything wet and moving some stuff around.
Logged
So sayeth the Wiki Loremaster!

Mechanoid

  • Bay Watcher
  • [INTELLIGENT]
    • View Profile
Re: Seasonal Floods: 3D
« Reply #5 on: March 10, 2008, 04:14:00 am »

The game could spawn the same liquid type on top of every 7/7 tile of that flow for a set duration.

Or have the "source" move up one level. Maybe? Of course the problem with cave rivers is the huge waterfalls; all the flood water would be contained at the top part before the first drop... Unless Toady wants to redesign river peices to include ramps and gradual slopes for water to flow over.
Which would be awsome.

Logged
Quote from: Max White
"Have all the steel you want!", says Toady, "It won't save your ass this time!"

kaypy

  • Bay Watcher
    • View Profile
Re: Seasonal Floods: 3D
« Reply #6 on: March 10, 2008, 06:40:00 am »

Ok, going into wishful-thinking damn-the-implementation-difficulty-full-speed-ahead mode:

What I would like to ideally see is having rivers/streams of different depths. That way a brook is essentially a shallow/narrow river, and flooding is just a matter of changing the depth:

Brooks would then be fordable due to being shallow and having ramped sides, rather than having their own special tile.

code:

brook
#####^            ^###
##########^3^#########
######################

^=ramp


A brook could 'flood' just by getting deeper to the point of needing swimming to cross

code:

deep brook
#####^            ^###
##########^6^#########
######################

A river would normally not be fordable, and be wider, and may or may not have ramped sides (could depend on terrain- a gorge/cliff versus a floodplain for example)

code:

river
#####             ^###
######777^############
######################

And would flood by getting additional water levels above level 7, as discussed above

code:

river, flooding
#####222222221111 ^###
######777^############
######################

And in case I wasn't far enough into crazy territory yet:

It might be nice to have more depth terrains. say floor, shallow ramp, ramp, tile-without-ceiling ("shallow-channel" maybe?), wall

Each of these would allow differing amounts of water (effectively displacing a some water) eg:
7/7, 5/5, 4/4, 2/2, 0/0
Thus providing shallow streams that will overflow instead of just getting deeper.

Only ramps would actually allow access to upper levels (although these could be used to smooth hills further- at which point wagons might need a gradual slope rather than plain old ramps...)

Just dont ask me how any of this can be done without murdering memory for tile types and cpu for flows...

Logged

kaypy

  • Bay Watcher
    • View Profile
Re: Seasonal Floods: 3D
« Reply #7 on: March 10, 2008, 07:03:00 am »

Ok, getting saner and pessimisticer again.

On the 'flooding from multiple tiles' I can see a few things to consider, mostly with keeping track of the tiles to flood from:

It may be possible to mark the river tile as "fill this tile to x level, going to higher tiles as needed"

But what happens if you undermine the river? Should the tile drop? You'd get wierd depths. Should it increase the fill level? You suddenly get masses of water?
Maybe it should be removed, but that would give you weird downstream effects.

What happens if you dam the river? Maybe the flood-here tiles should be removed if they dry? (Are they actually going to dry? Maybe they stop spawning water except during the flood...) And of course you could then remove your dam, at which point it should flood again...

Checking if the flood tile is connected to the edge of the map by water before triggering it might work (there could be something damming just the flood-here tiles, but still allowing water around)

Should the river still flood if you pave over the top?

Logged

zagibu

  • Bay Watcher
    • View Profile
Re: Seasonal Floods: 3D
« Reply #8 on: March 10, 2008, 09:12:00 am »

Why not just make it possible for tiles to be filled in seven steps with any terrain, not just water? Or rather eight steps, from 0/7 to 7/7...
Logged
99 barrels of beer in the pile
99 barrels of beer!
If some dwarves know the way to the pile
0 barrels of beer in the pile!

Thallone

  • Bay Watcher
    • View Profile
Re: Seasonal Floods: 3D
« Reply #9 on: March 10, 2008, 10:01:00 am »

probably the easiest thing to do would be to place in an algorithm that would mimic the original river floods, but also affect the outside rivers.

The solution, fill all empty spaces above ground tiles within X of the river and on the same z-level with 3/7 or maybe 4/7 water. I believe X used to be 16? After the flood, water can attempt to reneter the river, flow out away from the river, or if shallow enough, evaporate. For bonus points, in swampy areas flood out from any pond that the flood reaches. Ideally the flood would take about a day to cross the map, but I wouldn't be wholly disapointed if it just happened instantly. I would have streams flood to 2/7 within 10 of the stream. In either case, you'll want it to be an init option because all that water's gonna be a bit of a drag on fps.


A flood overlay could even be created on map generation to make filling easier later. I suppose for waterfall maps this might take several overlays, but they could be saved to disk until needed.

Logged

Quift

  • Bay Watcher
    • View Profile
Re: Seasonal Floods: 3D
« Reply #10 on: March 10, 2008, 10:09:00 am »

quote:
Originally posted by kaypy:
<STRONG>Ok, going into wishful-thinking damn-the-implementation-difficulty-full-speed-ahead mode:

What I would like to ideally see is having rivers/streams of different depths. That way a brook is essentially a shallow/narrow river, and flooding is just a matter of changing the depth:

Brooks would then be fordable due to being shallow and having ramped sides, rather than having their own special tile.

code:

brook
#####^            ^###
##########^3^#########
######################

^=ramp


A brook could 'flood' just by getting deeper to the point of needing swimming to cross

code:

deep brook
#####^            ^###
##########^6^#########
######################

A river would normally not be fordable, and be wider, and may or may not have ramped sides (could depend on terrain- a gorge/cliff versus a floodplain for example)

code:

river
#####             ^###
######777^############
######################

And would flood by getting additional water levels above level 7, as discussed above

code:

river, flooding
#####222222221111 ^###
######777^############
######################

And in case I wasn't far enough into crazy territory yet:

It might be nice to have more depth terrains. say floor, shallow ramp, ramp, tile-without-ceiling ("shallow-channel" maybe?), wall

Each of these would allow differing amounts of water (effectively displacing a some water) eg:
7/7, 5/5, 4/4, 2/2, 0/0
Thus providing shallow streams that will overflow instead of just getting deeper.

Only ramps would actually allow access to upper levels (although these could be used to smooth hills further- at which point wagons might need a gradual slope rather than plain old ramps...)

Just dont ask me how any of this can be done without murdering memory for tile types and cpu for flows...</STRONG>


This post is a thing of beauty...

Logged

Silveron

  • Bay Watcher
  • Arichect of Destruction
    • View Profile
Re: Seasonal Floods: 3D
« Reply #11 on: March 10, 2008, 11:28:00 am »

Hrm. Being able to dig shallow tiles could be fun for all kinds of flow tricks.
Spillways FTW!
Logged

Othob Rithol

  • Bay Watcher
  • aka Dark Snathi, Rain & Tom Bombadil
    • View Profile
Re: Seasonal Floods: 3D
« Reply #12 on: March 10, 2008, 01:12:00 pm »

As can be seen from my name/title  <----

I'm all for this, in any implementation at all, even a bad one. Flavor and all.

Silveron - I want a spillway too..being able to build a tile that could be set like a combo pressure plate/floodgate that allows water above level x to pass through would make all sorts of interesting water works. However a universal 7/7 depth for every tile would be a memory hog I am sure.

The whole flooding thing could be solved with the physics already on hand. Anyone that has played with pressurized water knows that a lot of water can move very far and quickly if it has 10 Zlevels on water column pushing it. So...

When the game generates the river, it (as suggested) tries to make a floodplain around the river, depending on type of river and local terrain. IE a brook would have a narrow one, and the floodplain would be narrower in granite than in silt.

When it comes time for the flood, the game just generates an huge volume of water, under pressure, on the tiles one z-level above the current source tiles. It will cascade down the river as well as move into the floodplain in a somewhat chaotic manner.

When I get a chance (after I finish the Goblin Rail Gun) I'll use my current fort to attempt to simulate this, and report if it works at all. I do have about 10000 units of power I am not using....

Alfador

  • Bay Watcher
  • Dangerous Lunatic
    • View Profile
Re: Seasonal Floods: 3D
« Reply #13 on: March 10, 2008, 02:13:00 pm »

Fording? Madness! Caulk the wagons and float them!

It always works.

Logged
This is a fox skull helmet. All craftsdwarfship is of the highest quality. It menaces with spikes of fox bone and is encircled with bands of fox leather. This item is haunted by the ghost of Alfador Angrorung the fox.

Draco18s

  • Bay Watcher
    • View Profile
Re: Seasonal Floods: 3D
« Reply #14 on: March 10, 2008, 04:46:00 pm »

quote:
Originally posted by kaypy:
<STRONG>Ok, going into wishful-thinking damn-the-implementation-difficulty-full-speed-ahead mode:

What I would like to ideally see is having rivers/streams of different depths. That way a brook is essentially a shallow/narrow river, and flooding is just a matter of changing the depth:

Brooks would then be fordable due to being shallow and having ramped sides, rather than having their own special tile.

code:

brook
#####^            ^###
##########^3^#########
######################

^=ramp


A brook could 'flood' just by getting deeper to the point of needing swimming to cross

code:

deep brook
#####^            ^###
##########^6^#########
######################

A river would normally not be fordable, and be wider, and may or may not have ramped sides (could depend on terrain- a gorge/cliff versus a floodplain for example)

code:

river
#####             ^###
######777^############
######################

And would flood by getting additional water levels above level 7, as discussed above

code:

river, flooding
#####222222221111 ^###
######777^############
######################

</STRONG>

That is exactly the kind fo thing I was thinking about.  I didn't put ramps in my little images as I was just depicting elevations.  :)

As for the "digging under a river" I'd see the flood tiles being 1 level above the river (i.e. drop the tile) and if you damn the river, well, you didn't damn the flood level, the water is going to overflow.  You can turn off the "dry" flood tiles, but the wet ones will still spawn water, causing it to overflow your damn (possibly), thus looking normal.

Logged
Pages: [1] 2