Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: low water level triggered pressure plates  (Read 1095 times)

Yag Alone

  • Bay Watcher
  • Grumpy old fart
    • View Profile
low water level triggered pressure plates
« on: December 03, 2007, 07:06:00 am »

Hello there.

First, fetch some aspirin, you may need it  :)

Second...

I tried to build an advanced water powered device to continuously raise and lower some spikes here and there, and...

Here is the system, based on two DF equivalents of the classic electronic RS flip/flop.

code:
  

Water flow
in      out
v       ^
# ####### #
# XB Pp X # < RS1
# ####### #
# XB Pp X # < RS2
###########

with :
# : Pink floyd's "the Wall"
X : Floodgate
B : Raising bridge (To resolve the undefined state in case of both set/reset command at the same time)
P : High level plate (Triggered on water levels from 4 to 7)
p : Low level plate (Triggered on water levels from 0 to 3)


- RS1 P plate is linked to RS2 first floodgate
- RS1 p plate is linked to RS2 second floodgate and bridge
- RS2 P plate is linked to RS1 second floodgate and bridge
- RS2 p plate is linked to RS1 first floodgate

First problem : Theorically, as there is initially no water at all in the system, both of the "p" pressure plate should be triggered and then RS1 first floodgate and RS2 second floodgate should be opened, and RS2 bridge should be raised.
Actually, all the elements stays at their default state.

I thought it may be due to the way the pressure plate are coded (If I had to code this stuff, I would only resolve the links on actual transitions of the status of the pressure plate to reduce the CPU load)

But...

Second test : I manually primed RS1 (the real system is far more complex than the small schematic above. Those maintenance stuff is totally independant of the basic function of the system however.) and then, the following happened :

- RS1 filled with water.
- RS1 P plate triggered, opening RS2 first floodgate.
- RS2 then filled with water too.
- RS2 P plate triggered, opening RS1 second floodgate and raising RS1 bridge
- The water left RS1, resetting RS1 P plate (and then closing RS2 first floodgate)
- The low level of water in RS1 *should* also trigger its p plate, but there is no change on RS2 floodgate and bridge status.

Seems like a bugged behaviour on either the trigger itself or on the resolution of the link. I noticed that sometime the behaviour depend of the initial state of the trigger : For example, when linking one assembly gear to a lever, activating the lever and linking a second assembly gear, then only one of the gear will be active depending on the position of the lever.


However, I've found a workaround by using a NOT gate :

code:
  

Water flow
in      out
v       ^
# ####### #
# XB P  X # < RS1
# ####### #
# B  p  X # < RS1 NOT gate
# ####### #
# XB P  X # < RS2
# ####### #
# B  p  X # < RS2 NOT gate
###########

with :
# : Pink floyd's "the Wall"
X : Floodgate
B : Raising bridge (To resolve the undefined state in case of both set/reset command at the same time)
P : "Data" plate (Triggered on water levels from 4 to 7)
p : "_Data" plate (Triggered on water levels from 4 to 7 too)


the bridge and the floodgate of both "NOT" gate are linked to the respective "Data" plate.
This system should works perfectly (not yet tested), but is obviously slower than the first solution.

Logged

Dagonus

  • Bay Watcher
    • View Profile
Re: low water level triggered pressure plates
« Reply #1 on: December 03, 2007, 08:49:00 am »

...


purpose was to periodically raise and lower plates? I suppose so that it would be an automated defense system?

Logged
<P>The only difference between a bug and a feature is documentation.

Hypcso

  • Bay Watcher
    • View Profile
Re: low water level triggered pressure plates
« Reply #2 on: December 03, 2007, 08:53:00 am »

Is it really that difficult to have a dwarf sit there and pull a lever on repeat? =P
Logged

Shadowlord

  • Bay Watcher
    • View Profile
Re: low water level triggered pressure plates
« Reply #3 on: December 03, 2007, 10:37:00 am »

The reason that the plates which should have been triggered from the get-go did not open the floodgates is, as you suspected, that they only send open/close signals when they change states.

It sounds like there was something wrong with the RS1 p plate. Did you try dismantling, rebuilding, and relinking it? (In my own tests, low-water plates work  fine except when I'm not paying attention and set their water levels wrong or forget to link them to the right things)

One design in particular that I made and tested included a 0-N pressure plate which worked fine:

quote:

Room 2: Main water feed connects through initially open floodgate B to room containing a
   PP7-7 followed by a PP0-6. The PP7-7 is connected to items A0 and the PP0-4 to items A1.
   Two floodgates named C and D sit beside the room for later drainage.

Items A0: Things which need to be open when the trap is active and closed when it isn't. Includes:
   Floodgate E, which fills the death chamber

Items A1: Things which need to be closed when the trap is active and open when it's inactive. Includes:
   Floodgate B
   Drainage hatches in the long spiral multi-level tunnel.


When the PP0-6 reaches 7/7 water, the floodgate leading to that room closes properly (and the drainage hatches shut, if they were open - normally they wouldn't be open unless the trap was draining after a previous activation).

P.S. My best repeater design consists of this:
Bottom level (underground, the ~ is a filled murky pool or water from it):

code:

###
<D^#
# #
# #
#X#
#~#
##~###
#~~~~#

Top level (ground level, here the ~ means the level above a murky pool):

code:

> H`
 @
W@W
W W
`W W
W.W
W.W+
WWW~~

^ is a pressure plate, D is a door, > and < are stairs, ` are levers, @@ is a pump, H is a hatch, . is open space, W is a constructed wall, # is a dug out wall, + is a constructed floor.

The pressure plate is set to 4-7 water, and linked to the hatch above it and to other stuff to be toggled. The pump is powered by a windmill built on top of it. When the hatch is closed, the pump cannot pull water from below. When it's open, it pulls water off the pressure plate's tile, and sends it back to the murky pool.

The top right lever is linked to the hatch, so I can manually open it for draining. The lower left lever is linked to the floodgate, so I can close it to allow work on the pressure plate.

Note: Bridges respond rather slowly - slower than this toggles state - to signals. Hatches respond much faster. I haven't tested sharp spikes with this yet.

Logged
<Dakkan> There are human laws, and then there are laws of physics. I don't bike in the city because of the second.
Dwarf Fortress Map Archive

Yag Alone

  • Bay Watcher
  • Grumpy old fart
    • View Profile
Re: low water level triggered pressure plates
« Reply #4 on: December 03, 2007, 07:55:00 pm »

quote:
Originally posted by Shadowlord:
[QB]
It sounds like there was something wrong with the RS1 p plate. Did you try dismantling, rebuilding, and relinking it?

Yes, I cleared the whole device and rebuilt it twice to ensure that no mistakes were done. Beside, both "p" plates shows up dark pink (triggered) state after construction while the two "P" plates appears light pink (not triggered)

Perhaps it is something wrong in my copy...

Logged

SmileyMan

  • Bay Watcher
    • View Profile
Re: low water level triggered pressure plates
« Reply #5 on: December 04, 2007, 11:50:00 am »

While I'm not trying to build anything like as complicated as above, I am trying to create an underground reservoir beneath my dining room so that I can build a well or two down into it.

It would be very useful if pressure plates (and other triggers?) could send a state event when a new link is created.  So if I have a pressure plate designed to open the floodgate for the reservoir, with the min water level set to zero, when this is linked to a floodgate, the floodgate would open.

The current workaround (thanks Wiki!) is to create a lever and temporarily connect the lever to the floodgate so that you can start the system with the floodgate opened, which isn't very intuitive.

Logged
In a fat-fingered moment while setting up another military squad I accidentally created a captain of the guard rather than a militia captain.  His squad of near-legendary hammerdwarves equipped with high quality silver hammers then took it upon themselves to dispense justice to all the mandate breakers in the fortress.  It was quite messy.