Bay 12 Games Forum

Please login or register.

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

Author Topic: Water motion in enclosed areas  (Read 13782 times)

eggrock

  • Bay Watcher
    • View Profile
Water motion in enclosed areas
« on: October 17, 2010, 04:40:23 pm »

Following up on one of my own questions, I experimented a bit with water and pressure plates. The basic idea is to fill an enclosed area with water of depth xxxy, with y being 1/7 different in depth than the x's. One or more pressure plates would then trigger !!Something!! at either y/7 or x/7 depth.

For the purposes of testing I created several areas, filled them to 7/7 water and removed one bucketful of water from each area. A river one z-level above was used to flood each room which hopefully filled everything to a precise level. In an earlier test I was dumping water down stairs into each area but that may have caused some partial evaporation so I wound up redoing everything, multiple times since I'm still noobish.

I started out with 3 miners, 3 masons and one architect with everyone proficient in Mechanics, then embarked with 3 picks, a bucket, enough food and booze to get by and a bunch of stone.

The areas I dug out looked like this--the dark spots are pressure plates:

Spoiler (click to show/hide)

Later on I dug out 10x1 and 20x1 tunnels that aren't shown in the image.

I didn't bother capturing exact times as that is somewhat dependent on the location of the pressure plates, but I did pause and step through time to see where and how frequently the 6/7 depth changed, and I found that it moved erratically. Sometimes it would move in and out of a tile in one step and other times it would remain stationary for eight or nine steps, but in no case did it move more than one tile from its previous loction. Areas with both x/y dimensions allowed for diagonal and more frequent movement.

Results were a little odd--I'm guessing that it's a function of the largest dimension in a room as opposed to the total area:

2x1 - didn't trigger at all
2x2 - ditto

3x1 - triggered very rarely
3x3 - fairly rare triggers

4x1 and larger - triggered frequently (even the 20x1 tunnel)
4x4 and larger - ditto - the 5x5 room was especially active. I didn't try placing a plate in the corner to see if that reduced the frequency.

In earlier testing I tried setting the pressure plates to a maximum value, eg 6/7 in a 4x1 corridor with depths of 5556. It didn't seem to make a difference.

Water seems to behave like, well, water. (; It's wavy and in perpetual motion, and the peaks and troughs seem to have a hard upper and lower limit, but without the algorithm I can't really say much else about it. Using a 6x1 tunnel with 1-6 pressure plates triggering !!Something!! (or several somethings) every 1-20 seconds could be useful. It brought to mind one of the people here that is building a dungeon for people to solve in Adventure mode. This would be useful with randomizing ways through a particular level that could actually be solved by someone insightful enough to notice and clever enough to figure it out--that seems to be the bulk of people in this forum!
Logged

Untelligent

  • Bay Watcher
  • I eat flesh!
    • View Profile
Re: Water motion in enclosed areas
« Reply #1 on: October 17, 2010, 06:09:35 pm »

Ooh, did you just find an easy-to-build, zero-maintenance repeater?
Logged
The World Without Knifebear — A much safer world indeed.
regardless, the slime shooter will be completed, come hell or high water, which are both entirely plausible setbacks at this point.

Eric Blank

  • Bay Watcher
  • *Remain calm*
    • View Profile
Re: Water motion in enclosed areas
« Reply #2 on: October 17, 2010, 11:21:02 pm »

Sounds like it, and sounds useful. Extremely useful

I'm guessing you meant Metime00's Giant Dungeon thread, which is somewhat useless I guess; Metime stated (and I agree) that he finds using Max White's idea of a community fort more appealing than working alone. (using mine that I was making, and a new thread I made in the community games and stories section)

Nobody has posted to accept the first year as a community fort yet, and the only region taken is straight East (It's being cordoned off on the horizontal plane so we can use as much vertical space as we please), so it's mostly up for grabs if you have an idea for a section of the dungeon.
« Last Edit: October 17, 2010, 11:29:46 pm by Eric Blank »
Logged
I make Spellcrafts!
I have no idea where anything is. I have no idea what anything does. This is not merely a madhouse designed by a madman, but a madhouse designed by many madmen, each with an intense hatred for the previous madman's unique flavour of madness.

Shoku

  • Bay Watcher
    • View Profile
Re: Water motion in enclosed areas
« Reply #3 on: October 18, 2010, 12:48:54 am »

Do you know about the init option that changes the blue water tiles to blue numbers 1 through 7? It's very easy to visually see what the water does like this though mathematically describing it is another matter. My best attempt is to say that they all just choose one direction to move for awhile and then choose another direction. There are some gaps in this movement as you often see several tiles of a certain depth in a row followed by a one tile interruption and then the same number in a row with another one tile interruption and so forth. The spots with a different height seem to show a hexagonal sort of arrangement when considering another axis.

This sloshing behavior is distinct from liquids spreading out because they spread out in all directions much much faster than the time it takes for sloshing to even change directions just once. 1/7 worth of a liquid sliding around on a lower sheet doesn't seem to deal in diagonals, though I haven't paid close attention to how pools behave when the top 1/7 is pressed up at them. I do know that they will go diagonally under SOME circumstance but with open space they seem to stick to the four cardinal directions.
Logged
Please get involved with my making worlds thread.

Burning_Iceman

  • Bay Watcher
    • View Profile
Re: Water motion in enclosed areas
« Reply #4 on: October 18, 2010, 08:54:24 am »

Cool idea.
I believe the 3x1,4x1 and 5x1 would trigger more often if the plate was placed i the middle of the hall, not at the end.
Did you compare it to the triggering speed of a lever on repeat?
The only repeater I desiged, while pretty neat could only trigger once for every 2-3 triggers of the lever.
Logged

eggrock

  • Bay Watcher
    • View Profile
Re: Water motion in enclosed areas
« Reply #5 on: October 18, 2010, 01:26:33 pm »

Anything in the center of a corridor or area should get hit more frequently in just about any scenario.

I tried to speed things up using a 5x1 corridor with 55666 depths and a pressure plate set to 5/7. That actually triggered much slower than a 6x1 tunnel using 566666 depths, and probably kills the idea of strobing using something like 565656. More testing needed..

Figuring out how to reduce the frequency would be beneficial to me since I want to give nobles a decent chance to make it through the 'bathing area' they cross on their way to and from their rooms. To that end I'm considering something like this:

7_p
76_
77_

7 = 7/7 water
6 = 6/7 water
_ = undug tile or wall
p = pressure plate (6/7)

The 6 theoretically has a 20% chance of moving over the plate in a random scenario, and if simulated motion is involved the chance of a 'bounce' in the corner may come into play.

@Shoku - Turning on the depth display didn't work with the tileset I was using, so instead of taking two minutes to switch to ASCII, I spent way too long using pause/loo[k] around. Still a noob..

Working with floodgates, bridges etc. will be tricky due to their activation delay. It will probably take a couple of adjacent pressure plates for spike traps to properly raise and lower.
Logged

MagmaMcFry

  • Bay Watcher
  • [EXISTS]
    • View Profile
Re: Water motion in enclosed areas
« Reply #6 on: October 18, 2010, 01:44:25 pm »

Don't forget the 100-step pressure plate reset delay! More frequently is not always better.
Alternately, I think that 76666 water moves more slowly.
You can test your theory with a huge dwarfy counter system (see below) that always spills 6 units of water (the last unit stays on the ledge) into a big vertical tube and watch which tube fills fastest.

Code: [Select]
Side view:

######
~F~~##
###XD_
###BD 
### ##
  DA #
#### #
#### #

A: Drawbridge
B: Retracting bridge
F: Fortification
X: Maintenance Floodgate
D: Maintenance Doors

Link both bridges to the same pressure plate and start the repeaters by dropping "77776" (or "76666") water on them with retracting bridges linked to a single lever.

Have fun.

Edit: fixed serious design flaw
« Last Edit: October 19, 2010, 11:32:13 am by MagmaMcFry »
Logged

Shoku

  • Bay Watcher
    • View Profile
Re: Water motion in enclosed areas
« Reply #7 on: October 18, 2010, 01:44:59 pm »

I thought tilesets weren't going to be able to override regular characters until Baughn's next thing was integrated into the game...

Well anyway with plates they send their on signal immediately but their off signal comes when they have been not met their condition for 100 ticks. This would be why the 55666 hall was so slow. 55566 should fare slightly better.
But yeah, if you have the time to link whatever you want triggered to several plates the different on and off signals should speed things up significantly. At worst you'd get one sending an on when things were already on but even in the worst case of that it's not any slower than the 1 plate.

Edit: Damn, sniped.
Logged
Please get involved with my making worlds thread.

eggrock

  • Bay Watcher
    • View Profile
Re: Water motion in enclosed areas
« Reply #8 on: October 18, 2010, 02:18:02 pm »

You both nailed it; I forgot all about the pressure plate cooldown period. That makes much more sense and explains why I can see a hatch strobe close/open but never vice versa. Thanks!

Huh, I have a copy on my work PC and the flow setting works just fine. I probably screwed something up trying to move Mayday's graphics set from .14 to .16.
Logged

Shoku

  • Bay Watcher
    • View Profile
Re: Water motion in enclosed areas
« Reply #9 on: October 18, 2010, 04:40:00 pm »

Still, I didn't think that you could assign graphics to water tiles, at least not yet. That should still be a character set thing. If you just straight up copied the init files over there could have been some trouble though.
Logged
Please get involved with my making worlds thread.

eggrock

  • Bay Watcher
    • View Profile
Re: Water motion in enclosed areas
« Reply #10 on: October 19, 2010, 04:04:57 pm »

I think that the one time I tried out the flow setting, the only water in view had open space above it. I guess the depth doesn't display in tiles with open space above.

This layout 'fooled' the movement of the 6/7 depth into mostly staying away from the pressure plate, which is in the far left side of the flooded area, adjacent to a very hard to see floodgate.

Spoiler (click to show/hide)

The '6' (for lack of a better term) generally bounced around in the large area and once in awhile trigger the plate, occasionally hovering nearby for 5-10 seconds. There were periods upwards of thirty seconds when the plate wasn't triggered. That's good enough for my needs.

In a series of 6x1 and 10x1 corridors with one 6/7 tile, everything triggered just fine (rapidly), bridges and spike traps a little less due to their delays. A 6x1 corridor seems to be the sweet spot for anything you want triggered rapidly.
Logged

krenshala

  • Bay Watcher
    • View Profile
Re: Water motion in enclosed areas
« Reply #11 on: October 19, 2010, 06:02:52 pm »

I wonder how well a 2x5 room with 5 pressure plates would work?  Each plate would control 20% of the traps, preferably staggered around so the victim(s) would never know which ones were going to be triggered next.
Logged
Quote from: Haspen
Quote from: phoenixuk
Zepave Dawnhogs the Butterfly of Vales the Marsh Titan ... was taken out by a single novice axedwarf and his pet war kitten. Long Live Domas Etasastesh Adilloram, slayer of the snow butterfly!
Doesn't quite have the ring of heroics to it...
Mother: "...and after the evil snow butterfly was defeated, Domas and his kitten lived happily ever after!"
Kids: "Yaaaay!"

Brandstone

  • Bay Watcher
  • Come hug me bro
    • View Profile
Re: Water motion in enclosed areas
« Reply #12 on: October 19, 2010, 06:16:18 pm »

With the way pumps work could you build in a kill switch by using a U-shaped hallway, and placing a pump one z-level above the top of the U?

Xinael

  • Bay Watcher
    • View Profile
Re: Water motion in enclosed areas
« Reply #13 on: October 19, 2010, 06:26:35 pm »

This idea is genius! But I'm a complete and total noob, so I have a couple of questions:

1) How do you get exactly 1/7 of water out of your system? Just making it a water source with a pond job somewhere and then removing the zone once 1/7 has gone?
2) Is there an easy way to turn it off? I've not used pressure plates before, so can you link a lever to them to say "stop working for a bit", or do you have to just dump out the water and start over?

...which is a great mental picture, actually. "Urist, there's a dead kitten stuck in the danger room again! Hit the dump valve!"
Logged

The Grackle

  • Bay Watcher
    • View Profile
Re: Water motion in enclosed areas
« Reply #14 on: October 19, 2010, 11:26:26 pm »

Doesn't water disappear on abandon/reclaim?  If so, this might not help for adv. mode.
Logged
Pages: [1] 2