Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Time for a new fort. Pic of the last one.  (Read 1390 times)

Telok

  • Bay Watcher
    • View Profile
Time for a new fort. Pic of the last one.
« on: January 10, 2007, 09:45:00 pm »

Since the fort is on a treeless map I did two things. First, I excavated a strip off each side of the river for trees to grow. Second, I had planned to channel the entire outdoors and flood it with water to ward off animals, invaders and unwanted dwarves.

Unfortunately a bug with aqueducts prevented me from completing my steam room (trade depot, just in case I didn't get goblin invasions) as planned. So I re-routed my flows and got the right effect in the steam room. However, now my water channel didn't link up with my outdoors channels. But the magma channel did.

This was the test flood from the magma channel. It was a short burst, about ten to fifteen sqares "long". As you can see it went rogue on me and started a perma-flood in the upper left section of the channels. Attempts to stop the perma-flood by opening the floodgates and reflooding the area were unsuccessful.

Two things of note happened. First, the game speed slowed to a crawl. Second, two cats, a war dog, a noble, and a fortress guard all walked into the lava floods. It appears that any channel square that is not currently occupied by lava or water registers as "safe" to a dwarf.

Other than that it was a fine fortress. Pity the FPS drop killed it.

Logged

HaunterV

  • Bay Watcher
    • View Profile
Re: Time for a new fort. Pic of the last one.
« Reply #1 on: January 11, 2007, 03:20:00 am »

Aye 'tis a fine fort but sure ittis no pool english  *puffs from a pipe*
Logged

Eiba

  • Bay Watcher
    • View Profile
Re: Time for a new fort. Pic of the last one.
« Reply #2 on: January 11, 2007, 05:27:00 pm »

I've gotten such a bizarre infinite lavaflood outside as well- only my issue was that I had set up a system (by accident) that would periodically shoot out a lava wave in shorter and shorter intervals (I could have shut it down, but I was curious as to what would happen).

It seems when the front of one wave collided with the tail end of another wave, the lava expansion squares and lava deletion squares follow an incredibly chaotic pattern... and it slows everything down a hell of a lot (and none of my dwarves seemed to realize what was going on and all ran out into the swirling lava and died...) Basically the exact same thing happened as in your screenshot...

It may also be of note that my experience was on a map with a river, and on the open ground (not channels)

I don't quite know what happened in yours, but it looks like there was an issue in the corner, where the lava was still trying to expand when it was hit by the "drying up" wave... From what I understand of channels though... I don't quite know how that could have happened...

(For the record, when I test potentially world-destroying devices, I back up my save first...)

Logged

Gaulgath

  • Bay Watcher
  • ♪ Gold gold gold gold ♪
    • View Profile
Re: Time for a new fort. Pic of the last one.
« Reply #3 on: January 14, 2007, 08:46:00 pm »

Jesus! How do you people make these forts? They're... they're beautiful!
Logged

OldMiner

  • Bay Watcher
    • View Profile
Re: Time for a new fort. Pic of the last one.
« Reply #4 on: January 15, 2007, 07:22:00 am »

I believe the issue here is likely to occur with only "short spurt" like that.  This is a guess of how fluids work in dwarf fortress based on observation.  Feel free to correct me if greater information has been revealed by Toady somewhere else that I haven't read...

The way floods and antifloods appear to work is they're all just self-propogating squares.  When you open a floodgate, it checks to see if it's next to something that can flow through it.  If so, the channel spot is filled with that fluid and marked as "flooding".  If the source fluid is channel, then it's flood fluid.  If the source fluid is contained, (e.g. the river), the fluid is channel fluid.

Next time a flow tick is done (not sure if this happens every time you type period to single step or less often -- should test), all "flooding" spots check all 4 compass direction for adjacent spots they can flood. If the fluid is flood fluid, all spots that aren't blocked by floodgates, unmined rock, or closed doors are valid.  If the fluid is channel fluid, only channel square are valid targets.

Valid targets are filled with the same type of fluid as the originating square, the current square is no longer "flooding" and the new square (being just copies of the current fluid) are also "flooding".

This repeats until all square are no longer "flooding", and then whatever you've done is filled.

The problem occurs when multiple flows interact.  Closing a floodgate works identically, but instead of being say a "flooding water fluid" you get a "flooding anti-water fluid" which seeks valid spots which are filled with water.

Now, imagine a "circular" expanding wave hitting the edge of a channel.  '~' represents visible fluid while '*' marks a square targeted to be flooded next time

code:

___*
__*~~~~~
___*

code:

__*~
_*~~~~~~
__*~

code:

_*~~
*~~~~~~~
_*~~

code:

*~~~
~~~~~~~~
*~~~

Now imagine a really short anti-flood flowing behind instead...  '&' marks squares, filled with water, to be anti-flooded next time.

code:

___*
__*~&___
___*

code:

__*~
_*~&____
__*~

code:

_*~&
*~&_____
_*~&

code:

*~&_
~&______
*~&_

code:

~&__
&_______
~&__

Now the problem comes here in order-of-operations.  The '&'s at the top and the bottom *may* have been marked for flood because they are at the leading edge of the flood.  So you have these two square marked for flood and anti-flood in the same turn.

Granted, this would not happen if either (1) floods don't mark already-fluid-filled squares for flooding next-turn or (2) any leading edge of a flood is marked with a TTL which would effectively limit the amount of water that could flow from any source by a certain square count, and the TTL was forced to divide evenly if one square propogates to more than one square.  Anti-floods could be free from this TTL, since nothingness is happy to propogate forever.

Or I could be rambling too much too early.  Thoughts?  Criticisms?

Anyone want to try digging out a square after the space next to it has already flooded to see if, perhaps, I'm wrong, and *all* fluid filled flood water squares continue to be constant sources of water?  (I would think this could be handled processor-wise more efficiently by attaching a hook to all presently-flood blocking items as they're encountered to trigger further flooding when they are removed, hence removing the need to check every single clock cycle -- and then removing said hook upon anti-flood.)

Logged

Telok

  • Bay Watcher
    • View Profile
Re: Time for a new fort. Pic of the last one.
« Reply #5 on: January 15, 2007, 11:57:00 am »

Gaulgath:
After about 20 or 40 forts you tend to have a reasonably successful pattern established. That's the point that I started beautifying things. Of course my forts vary based on individual conditions like distance between river/chasm/magma in individual mountains. I still haven't managed to recreate the really nice chasm bridge room I had in one fort. Wonderful oval, good trap spread, nice door and statue design. This fort has a very sub-optimal magma setup due to where my main hall connected and my refusal to have multiple magma entrances. And thank you for the compliment.

OldMiner:
You're right. I watched for a while and the similarities with a slightly modified Life simulation are very close. In fact I recognized what had happened while it was going on. Much of why I abandoned is my continuing search for effective, efficent, and graceful animal/invader defenses that don't rely on some lacking point in the current game state. Steam defenses work alright, but the preformance hit is annoying and they are rather dangerous to the fort at several points.

I'm not quite as motivated as you are to take the time to diagram the exact procedures involved since they are, to me, rather self evident. What I mostly was concerned about is the fact that the dwarves (code) does not recognize a channel with magma travelling down it as a potential danger. As far as things are currently concerned that square immediately in front of the wave is perfectly safe, except that it will be filled with molten rock faster than any non-legendary dwarf can move. And perhaps it was just my perceptions being thrown off by the performance hit to FPS, but the waves seemed to propigate faster after the perma-flood was initiated. It may  be a difference between the flood state of magma and a strict channel state or it may just be the speed change. But I'm absolutely certian that normal dwarves outran magma while it was filling a single width channel, and didn't seem to be able to keep ahead of the flood waves.

Logged

Telok

  • Bay Watcher
    • View Profile
Re: Time for a new fort. Pic of the last one.
« Reply #6 on: January 15, 2007, 12:09:00 pm »

An addition.

code:
 

______________________~~~~
_________________~~~~~~~~~
________~_~~__~~~~~~~~~~~~
_______~~~~~~_~~~~~~~~~~~_
_____~~~~~~~~~~~~~~~~~~___
____~~~~~~~~_~~~~~~_______
__~~~~~~~~__~_~~__~_______
_~~~~~_________~__________
~~~~_______________~______
~~________________________


With the upper left corner being the direction of travel of the lava. This is similar to what the origin of the flood looked like when it started. I was actually worrying about what would happen if the trailing edge of the flow interfered with the leading edge and a square tried to flood and un-flood.

I presume that you could recreate something similar with a large cave area and floodgates on opposite sides. The interaction of conflicting wave fronts and wave ends is a danger here.

Logged

darknight

  • Bay Watcher
    • View Profile
Re: Time for a new fort. Pic of the last one.
« Reply #7 on: January 15, 2007, 06:29:00 pm »

No joke on the danger part there! I lost a number of forts from exactly that kind of thing. One or more waves starts interacting with one or more other waves, and it sets up a non-stop pattern that cant be killed. And channels and floodgates change nothing. I have seen such wave floods going OUT of floodgates next to the river, when that should have been impossible. But even if gates next to fluids only allowed flows in one direction, it would still have little or no effect on such wave flooding, since as soon as it is past the gate it would just merge with the existing wave patterns.

Even when Toady redoes the fluid dynamics, I dont see it helping that condition much. The game is still 2-dimensional, and there is only so much you can do without factoring in gravity, height, and fluid volumes. And if you could put those in, it would swamp any CPU.

I think we are just going to have to live with certain risks any time we flood things. But its not so bad if you think about it. Right now we can flood huge areas that are separated from other areas by nothing but a one-by wall. If that were done for real, there would be a great chance for the water, or lava, to find a crack in that wall, and blast a hole thru at that point. That would make for some very realistic flooding that I for one could do without. I've taught enough hairy little people to swim as it is!

Logged
ho watches those that watch us???

OldMiner

  • Bay Watcher
    • View Profile
Re: Time for a new fort. Pic of the last one.
« Reply #8 on: January 15, 2007, 07:14:00 pm »

quote:
Originally posted by darknight:
<STRONG>No joke on the danger part there! I lost a number of forts from exactly that kind of thing. One or more waves starts interacting with one or more other waves, and it sets up a non-stop pattern that cant be killed. And channels and floodgates change nothing. I have seen such wave floods going OUT of floodgates next to the river, when that should have been impossible. But even if gates next to fluids only allowed flows in one direction, it would still have little or no effect on such wave flooding, since as soon as it is past the gate it would just merge with the existing wave patterns.

Even when Toady redoes the fluid dynamics, I dont see it helping that condition much. The game is still 2-dimensional, and there is only so much you can do without factoring in gravity, height, and fluid volumes. And if you could put those in, it would swamp any CPU.

I think we are just going to have to live with certain risks any time we flood things. But its not so bad if you think about it. Right now we can flood huge areas that are separated from other areas by nothing but a one-by wall. If that were done for real, there would be a great chance for the water, or lava, to find a crack in that wall, and blast a hole thru at that point. That would make for some very realistic flooding that I for one could do without. I've taught enough hairy little people to swim as it is!</STRONG>


It's really not that bad of an issue, 2d or not.  The problem can be solved by either provably insuring that all waves will eventually stop propogating without a continual external stimulus, regardless of the depth of the original source, given a constant sink (and then expand to include all cases where the sink can change), or to insure that there is a simple limit on the amount of waves which can propogate from any given flood source.

This is graph theory.  Math is not some deep mystic voodoo.  It's just proofs.

Logged

Genuine

  • Bay Watcher
    • View Profile
    • http://none
Re: Time for a new fort. Pic of the last one.
« Reply #9 on: January 15, 2007, 08:05:00 pm »

quote:
Originally posted by Telok:
<STRONG>Gaulgath:
After about 20 or 40 forts you tend to have a reasonably successful pattern established. That's the point that I started beautifying things.</STRONG>

It doesn't quite take that long, you just have to plan very carefully and make sure you take all the variables into account (especially weird river/chasm/waterfall locations.

This was my fifth fort (old), and I'm just pimping it out because I spent forever on the design. Anyone else have forts they're proud of and want to share? I'm looking for some new ideas other people have come up with in design.

 

[ January 15, 2007: Message edited by: Genuine ]

Logged