Bay 12 Games Forum

Please login or register.

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

Author Topic: Advanced logic for triggering and stopping a magma trap  (Read 1607 times)

Nagidal

  • Bay Watcher
    • View Profile
    • My gaming channel
Advanced logic for triggering and stopping a magma trap
« on: October 23, 2017, 10:48:43 am »

Can you help me design the advanced logic to operate a magma trap?

Mightymushroom has kindly suggested a magma trap design I want to try in my fortress. It goes like this:

Legend:

█ wall
+ or _ smooth floor
· open space
> downstairs
< upstairs

║ raising bridge

^ pressure plate
magma


View from the top:
(path to the fortress leads from the downstairs in the north to the upstairs in the south)

████████
·>+≈≈≈
·++≈≈≈
·++≈≈≈
·^^≈≈≈
·++≈≈≈
·++≈≈≈
·++≈≈≈
·++≈≈≈
·++≈≈≈
·<+≈≈≈
████████

(In reality the path from one end to another is over 20 tiles long and the pressure plates would be linked to three such bridges.)


View across z-levels from the side:

    █≈≈≈
    █≈≈≈
    █≈≈≈
    █≈≈≈
^^≈≈≈
█__ █
█ __█
█__ █


This is how I would like to operate the trap:

  • Dwarves pull a lever to ON, bridge is raised, magma tank can be filled, pressure plate trap is armed.
  • Goblin steps on either of the pressure plates. Pressure plate sends the trigger to lower the bridge (after 100 ticks).
  • Goblin steps off the pressure plate. The released pressure plate does not send any trigger to raise the bridge.
  • Any subsequent pressure plate depressions (by more goblins stepping on it before the bridge is lowered) do not interfere.
  • Bridge lowers, magma flows out and kills goblins. Any items accidentally lying on the pressure plate should not interfere.
     (Insufficient triggering weight)
  • Dwarves pull the lever to OFF, bridge remains lowered
  • Go to 1. (repeat cycle)

How would you design some logic to operate the trap like this? Or if you have any more convenient ideas, share them, too.
« Last Edit: October 23, 2017, 10:59:53 am by Nagidal »
Logged
I stream most of my DF sessions: gaming.youtube/nagidal146, they are archived on my youtube channel. (Dwarf Fortress Tutorials)

bloop_bleep

  • Bay Watcher
    • View Profile
Re: Advanced logic for triggering and stopping a magma trap
« Reply #1 on: October 23, 2017, 11:10:36 am »

Hmm. I have an idea -- how about you place the magma reservoir right above the trap hall, replace its floor with a retracting bridge, and link the bridge to the pressure plates. When a goblin first steps on the pressure plate, it sends an "open" signal to the retracting bridge, which does nothing since it's already considered "open." Then, 100 ticks after the goblin steps off, it sends a "close" signal, causing the bridge to retract and the magma to fall down on top of the goblins.
Logged
Quote from: KittyTac
The closest thing Bay12 has to a flamewar is an argument over philosophy that slowly transitioned to an argument about quantum mechanics.
Quote from: thefriendlyhacker
The trick is to only make predictions semi-seriously.  That way, I don't have a 98% failure rate. I have a 98% sarcasm rate.

Fleeting Frames

  • Bay Watcher
  • Spooky cart at distance
    • View Profile
Re: Advanced logic for triggering and stopping a magma trap
« Reply #2 on: October 23, 2017, 11:34:11 am »

Requirements can be accomplished by a simple signal relay, i.e. minecart above hatch that will fall onto pressure plate on track floor, with arming lever both raising the bridge and allowing access to minecart so that it can be re-placed onto hatch (automatically queued with route designation on hatch). Instant signal (no falling delay) can be accomplished by having a minecart on an accelerating ramp pushing against a linked floating door, but this is probably overkill.

Getting rid of the drying magma...Hm, I see no good way. Retracting bridge over downstairs would work, but would scatter the items. Using hatches instead would result in trolls destroying them.

@bloop_bleep: Open sent to retracting bridge causes it to open (as the default state is closed). This is obviously an improvement.

bloop_bleep

  • Bay Watcher
    • View Profile
Re: Advanced logic for triggering and stopping a magma trap
« Reply #3 on: October 23, 2017, 01:07:50 pm »

@bloop_bleep: Open sent to retracting bridge causes it to open (as the default state is closed). This is obviously an improvement.

Oh. Then aren't the requirements satisfied already? The initial "open" signal sent by the pressure plate won't affect an already raised bridge. The "close" signal a hundred ticks later will lower the bridge, releasing the magma until the bridge is raised again by the lever pull.
Logged
Quote from: KittyTac
The closest thing Bay12 has to a flamewar is an argument over philosophy that slowly transitioned to an argument about quantum mechanics.
Quote from: thefriendlyhacker
The trick is to only make predictions semi-seriously.  That way, I don't have a 98% failure rate. I have a 98% sarcasm rate.

Nagidal

  • Bay Watcher
    • View Profile
    • My gaming channel
Re: Advanced logic for triggering and stopping a magma trap
« Reply #4 on: October 23, 2017, 03:41:47 pm »

Hmm. I have an idea -- how about you place the magma reservoir right above the trap hall, replace its floor with a retracting bridge, and link the bridge to the pressure plates. When a goblin first steps on the pressure plate, it sends an "open" signal to the retracting bridge, which does nothing since it's already considered "open." Then, 100 ticks after the goblin steps off, it sends a "close" signal, causing the bridge to retract and the magma to fall down on top of the goblins.

So the retracting bridge remains extended for 100 ticks after the pressure plate is depressed and then the bridge retracts because the pressure plate sends an close signal. And how would I extend the bridge again?

Anyway, I would prefer not to dig the whole configuration again. I will have to go with a sideways magma release.
Logged
I stream most of my DF sessions: gaming.youtube/nagidal146, they are archived on my youtube channel. (Dwarf Fortress Tutorials)

Nagidal

  • Bay Watcher
    • View Profile
    • My gaming channel
Re: Advanced logic for triggering and stopping a magma trap
« Reply #5 on: October 23, 2017, 03:52:33 pm »

Requirements can be accomplished by a simple signal relay, i.e. minecart above hatch that will fall onto pressure plate on track floor, with arming lever both raising the bridge and allowing access to minecart so that it can be re-placed onto hatch (automatically queued with route designation on hatch). Instant signal (no falling delay) can be accomplished by having a minecart on an accelerating ramp pushing against a linked floating door, but this is probably overkill.

The signal relay thing is really simple and ingenious. However, I have no idea how you can deliberately place a minecart on a hatch. As far as I know dwarves can only guide minecarts along carved tracks. I cannot carve tracks on a hatch.


   ╔════╗
z+0╚═₵▼═╝
z-1 ╞═▲


The ramp would have E/W tracks carved so the minecart could be guided from level z-1 to z+0. But how do I explain that they shall place the minecart onto the hatch?
Logged
I stream most of my DF sessions: gaming.youtube/nagidal146, they are archived on my youtube channel. (Dwarf Fortress Tutorials)

Fleeting Frames

  • Bay Watcher
  • Spooky cart at distance
    • View Profile
Re: Advanced logic for triggering and stopping a magma trap
« Reply #6 on: October 24, 2017, 12:14:30 am »

Don't need to make multiple stops or anything. Create a hole, carve track on bottom:

||

On z-level above, you have something like this:

||

Place hatches on both above track and on stairs.

||

And pressure plate to the bottom.

Now, you can place minecart route directly on the hatch above empty space.

||

It may be necessary to enter the list and x three times to remove default conditions as to prevent the "guide to north in 28 days always", depending on setup.

A dwarf will come and place cart on hatch.

||

Now, when the hatch is opened, cart falls down and triggers pressure plate on bottom:

||

Here, this generated a job to place item in stockpile, since I didn't remove path to minecart. Locking the hatch, pulling the lever again, and unlocking the hatch results in dwarf coming and placing minecart back on hatch:

||

"No need to overcomplicate it" says FF while posting 8 image+paragraph explanation.
So the retracting bridge remains extended for 100 ticks after the pressure plate is depressed and then the bridge retracts because the pressure plate sends an close signal. And how would I extend the bridge again?
Not because the pressure plate sends a close signal (which will happen a bit later, actually, since goblins don't move at lightspeed), but because the bridges have 100 step delay on operation.

taptap

  • Bay Watcher
    • View Profile
Re: Advanced logic for triggering and stopping a magma trap
« Reply #7 on: October 24, 2017, 07:43:48 am »

I would use a S/R-Latch (http://dwarffortresswiki.org/index.php/DF2014:Fluid_logic#S.2FR_Latch).

1) Design w/ raising bridge

W+^+ (wherein W is unlimited fluid source, + doors and ^ a pressure plate triggering on high water. The whole cell is filled.)

SET: The second door is linked to your goblin pressure plates. Goblins triggering one of the plates, opens the door, this lowers the water below the threshold, the pressure plate sends an OFF signal, that is duly processed by your bridge. Any further signals arrive, but won't make the water rise in the cell.

RESET: Once the first door is opened, the cell refills quickly (not only unlimited but pressurized water is wanted here), the pressure plate triggers and sends an ON signal, that your bridge will process. The first door needs a final off signal to close again. (So please run your reset through an edge detector, e.g. an empty lever in a dead end and a pressure plate in front of it, give a single pull lever order and a dwarf will run over the pressure plate that will first send an ON and later an OFF signal.)

2) Improved design w/ retracting bridge

Retracting bridges do not work as advertised above in this thread. Just test it w/ a bridge, a lever and a single link.

Working with ON signals involves less delay, simply change the pressure plate in your fluid logic cell from high water trigger (5-7) to low water trigger (0-4). It works otherwise exactly the same.
« Last Edit: October 24, 2017, 07:55:57 am by taptap »
Logged

Nagidal

  • Bay Watcher
    • View Profile
    • My gaming channel
Re: Advanced logic for triggering and stopping a magma trap
« Reply #8 on: October 24, 2017, 11:15:25 am »

Thanks Fleeting Frames for your careful explanation. I think I understand it now. However, I am concerned about signal timing:

Triggering sequence:
  • Goblin steps on the pressure plate (g^)
  • g^ sends OPEN signal to the hatch under the minecart (▮¢)
  • ▮¢ opens instantly, ▮ falls
  • After a short delay, ▮ lands on the pressure plate on tracks (▮^)
  • ▮^ sends OPEN signal to the bridge holding magma (╞═╡)
  • 99 ticks after (1.), g^ sends CLOSE signal to ▮¢
  • ▮¢ closes instantly
  • 99 ticks after (4.), ▮^ sends CLOSE signal to ╞═╡
  • 100 ticks after (5.), the bridge opens
  • 100 ticks after (8. or 9.?), the bridge closes

Is it ok to send a CLOSE signal to a bridge which has not been opened yet or is just about to open? What if the CLOSE signal arrives the very same tick when the bridge would open?

Another thing I am not sure about is this part of your previous post:

... with arming lever both raising the bridge and allowing access to minecart so that it can be re-placed onto hatch (automatically queued with route designation on hatch).

Do I still need to link a lever to the bridge? The bridge will close some time after the pressure plate (▮^) sends the close signal. Looking at your explanatory images I can have a lever controlling nothing but the hatch above the access staircase. Once it opens, dwarves gain access to the minecart and will haul it onto ▮¢ which should be closed by then.

Logged
I stream most of my DF sessions: gaming.youtube/nagidal146, they are archived on my youtube channel. (Dwarf Fortress Tutorials)

Nagidal

  • Bay Watcher
    • View Profile
    • My gaming channel
Re: Advanced logic for triggering and stopping a magma trap
« Reply #9 on: October 24, 2017, 11:19:15 am »

Thanks taptap, you showed me interesting setups, I might sport in some later trap designs. For now I will try to do it with the minecart relay.
Logged
I stream most of my DF sessions: gaming.youtube/nagidal146, they are archived on my youtube channel. (Dwarf Fortress Tutorials)

Fleeting Frames

  • Bay Watcher
  • Spooky cart at distance
    • View Profile
Re: Advanced logic for triggering and stopping a magma trap
« Reply #10 on: October 24, 2017, 11:51:14 am »

You're not quite correct about triggering sequence.

8. 9. 10. only happen after the thing causing the signal - minecart in this case - is removed - by a dwarf, in this case.

If a bridge gets same signal type as it already has or is already queued to do something, the signal is ignored. You can take advantage of this with minecarts that pass over pressure plates in single step to have pressure plates toggle the bridges (as the close is sent 99 steps after minecart leaves the plate, but bridge takes 100 steps to get ready).


And yeah, you don't need to link a lever to bridge if you're willing to wait for a dwarf to come remove minecart from pressure plate. You don't tbh need levers at all, if you use forbidding a door/hatch to prevent minecart from being removed, but you might want to have some way to absentmindedness-proof the device so that once the cart falls dorf pathing is prevented, lest the minecart gets hauled to a furniture stockpile or back on top of hatch after goblin steps off the hatch-linked plate.

Or might not, given that goblins burn away completely in, like, half a day of magma immersion.
« Last Edit: October 24, 2017, 11:55:47 am by Fleeting Frames »
Logged

Nagidal

  • Bay Watcher
    • View Profile
    • My gaming channel
Re: Advanced logic for triggering and stopping a magma trap
« Reply #11 on: October 24, 2017, 12:01:03 pm »

You're not quite correct about triggering sequence.

8. 9. 10. only happen after the thing causing the signal - minecart in this case - is removed - by a dwarf, in this case.
Thanks, I have just looked it up in the wiki:

Resetting pressure [...] disengage 99 ticks after their trigger is removed.
Logged
I stream most of my DF sessions: gaming.youtube/nagidal146, they are archived on my youtube channel. (Dwarf Fortress Tutorials)

Nagidal

  • Bay Watcher
    • View Profile
    • My gaming channel
Re: Advanced logic for triggering and stopping a magma trap
« Reply #12 on: October 24, 2017, 12:12:14 pm »

If a bridge gets same signal type as it already has or is already queued to do something, the signal is ignored. You can take advantage of this with minecarts that pass over pressure plates in single step to have pressure plates toggle the bridges (as the close is sent 99 steps after minecart leaves the plate, but bridge takes 100 steps to get ready).

Are the words same signal in there somehow crucial? It looks like you could only toggle a bridge by a minecart riding over a pressure plate if the bridge would also ignore the opposite signal to what it is about to do:

Tick 0: Minecart triggers pressure plate, sends OPEN signal, Bridge receives OPEN signal. Bridge delay (100 ticks) starts
Tick 1: Minecart releases pressure plate, CLOSE timer starts (99 ticks)
Tick 100: Bridge opens (100 ticks after OPEN), bridge receives CLOSE (ignored?)
Logged
I stream most of my DF sessions: gaming.youtube/nagidal146, they are archived on my youtube channel. (Dwarf Fortress Tutorials)

Fleeting Frames

  • Bay Watcher
  • Spooky cart at distance
    • View Profile
Re: Advanced logic for triggering and stopping a magma trap
« Reply #13 on: October 24, 2017, 12:21:36 pm »

Open bridge, all open signals are ignored. Closed bridge, all closed signals are ignored. (The sole weird exemption to this is floodgates which are blocked from closing by an item in the way, which will close the moment an item is removed.)

Your summary is essentially correct, but you'll have to sometimes mind that minecarts, specifically, go later in build order than earlier-built buildings, so a minecart will always depress the pressure plate visually 1 step after it touches it (by which time it is also already gone, ofc).

Nagidal

  • Bay Watcher
    • View Profile
    • My gaming channel
Re: Advanced logic for triggering and stopping a magma trap
« Reply #14 on: October 24, 2017, 02:16:15 pm »

I have some unpleasant news. We should have consulted the wiki about how bridges behave with regards to signals:

Bridge
On: Turns the bridge into either a raised drawbridge, or a retracted bridge, depending on which option was chosen when the bridge was constructed.
Off: Returns the bridge to normal.

This means, whenever the minecart drops on the pressure plate, this pressure plate sends the ON signal which makes my magma bridge raise (which it is)

How could we negate this whole thing? I need to trigger a signal which would lower a raised bridge.
« Last Edit: October 24, 2017, 02:33:47 pm by Nagidal »
Logged
I stream most of my DF sessions: gaming.youtube/nagidal146, they are archived on my youtube channel. (Dwarf Fortress Tutorials)
Pages: [1] 2