Bay 12 Games Forum

Dwarf Fortress => DF Dwarf Mode Discussion => Topic started by: ohgoditburns on June 10, 2011, 01:17:58 pm

Title: Serial entrances
Post by: ohgoditburns on June 10, 2011, 01:17:58 pm
On my latest fortress, I'm working on a new entrance trap.

Code: [Select]
==================
G.............^..G
G.............^..G
G.............^..G
==================
G.............^..G
G.............^..G
G.............^..G
==================
G.............^..G
G.............^..G
G.............^..G
==================

G=raiseable drawbridge
^=pressure plate
==wall
.=floor

I've actually got 8 of these entrances. What I'd like to do is make it so that only one entrance is open at a time. When a goblin or other invader reaches the pressure plates, the bridges raise, trapping him and his allies inside and the next hallway opens. There should only be one hallway open at a time.

Any ideas on how to make this happen? I have a two level aquifer for easy power and repeater setups. I figure I need some sort of registry or flipflop logic to properly automate this.


I'm planning on having a floor grate installed above each entrance for dwarves to pondfill. I figure the slow drowning is more terrifying than water instantly rushing in.

Title: Re: Serial entrances
Post by: NecroRebel on June 10, 2011, 01:33:04 pm
Have a series of pumps that pump in a circle. Each pump pumps into another pump's intake tile. Each pump is powered separately. In each pump's output tile, there is a pressure plate that switches off that pump and opens one of the entrances. The pressure plates in the entrances themselves switch on one of the pumps. You'll either have to use retracting bridges, lines of floodgates, or a signal inverter to have the pump-side pressure plates open the entrances when triggered, but this should work.

What will happen is this: there is water on one of the pump-side pressure plates, so all of the pumps are off and one entrance is open. Enemies enter, causing the pump that draws out of the water-filled tile to turn on. The previously-active pressure plate switches off due to the water getting pumped out, closing the entrance that the enemies just used. Then, the next pump-side pressure plate turns on due to the water from the pump falling into it, thus the pump switches off again and the next entrance opens. Then, the process repeats.

You might need additional computing components to make it so that the enemies in the entrances don't just rapidly toggle the power to the pumps, but as long as you kill everything in an entrance before it comes time to open it again it shouldn't be a problem.
Title: Re: Serial entrances
Post by: Lectorog on June 10, 2011, 01:33:53 pm
Wouldn't the bridge just open back up if anyone stepped on the plate again? If so, escape would be likely; the other activated bridge would change position too, screwing up the entire process.

On the other side, great idea. I suppose the first pressure plate set would control the top 2 bridges and both of the next, the middle would control the its own and the next, and the last would control just its own bridges. Kind of complex to set up correctly, but worth it if it can work. Very effective (just watch out for those swimming masters).

EDIT: I'm not entirely sure what NecroRebel is saying, but it sounds like it could work.
Title: Re: Serial entrances
Post by: Arkenstone on June 10, 2011, 02:00:32 pm
No, it wouldn't; not if I understand what he's saying.  How I understand it is that there's only seven units of water in the entire system, which means that only one gate could possibly be open at once.

Example:
Code: [Select]
~->.
^##|
|##v
.<-.

There's only one water availible to use, and it moves around from one spot to the next.  You'll need to hook up a failsafe or two though; I suggest you put a manual override to flush the system by using pumps to remove all water, then measure and dispense fresh water. This can all be done step-by-step with lever pulls, hopefully you won't need it. (But if you need it, you really will...)  Also, I'd recommend that you set the plates to 4-7 or even 3-7 or 2-7, so if the water does get spread out then you'll still be able to operate the gates.  Whichever way you do it though, there isn't any chance that all four gates will be open at once (although 2-3 might be open at the same time).


Your biggest challange will be pathfinding though; the computer doesn't know that if it walks onto that plate it can keep moving forewards!
Title: Re: Serial entrances
Post by: ohgoditburns on June 10, 2011, 02:25:30 pm
Wouldn't the bridge just open back up if anyone stepped on the plate again? If so, escape would be likely; the other activated bridge would change position too, screwing up the entire process.

On the other side, great idea. I suppose the first pressure plate set would control the top 2 bridges and both of the next, the middle would control the its own and the next, and the last would control just its own bridges. Kind of complex to set up correctly, but worth it if it can work. Very effective (just watch out for those swimming masters).

EDIT: I'm not entirely sure what NecroRebel is saying, but it sounds like it could work.

Thanks.

The pressure plates are meant to be reuseable, but not toggle when the creature steps off. I know this can be done by attaching the pressure plate to a hatch with 7/7 water on top of it so that when the pressure plate triggers, the water falls onto a new pressure plate. This pressure plate is attached to the barrier bridges. So basically, a manual reset *very* simplified version would be easy to put together.

Right now I'm trying to work this in using a 2-step repeater with a hatch blocking its completion, but I'm thinking there's probably a much better way.
Title: Re: Serial entrances
Post by: Girlinhat on June 10, 2011, 02:44:51 pm
As you previously mentioned the hatch+water setup for holding a pressure plate, you just need to mod that further, so that its drainage mechanism is controlled via another pressure plate.  This is getting heavily into logic gates, particularly the XOR gate, but I'm not familiar with any three-way XOR gates.

Actually, wiki'ing fluid logic, it looks like you could expand the existing XOR gate setup one further, and make it a triple-way to achieve the desired effect.  This would allow one or no gates to remain open.  You'd just need to further complicate the design by linking the gate plates to a permanent holding plate like you describe, link the holding plate to the logic gate/bridge, and then link the final plate at the end of the logic to the surface bridge.  You may or may not have to build the logic portion 3 times to function differently for all 3 gates, I'm too mind-boggled to figure out that last bit right now.
Title: Re: Serial entrances
Post by: Daetrin on June 10, 2011, 03:20:09 pm
What I do is attach the hallway trigger plate to a floodgate.  That allows water to fill a one-square room with a pressure plate. It's that pressure plate that triggers the hallway closing. You can then drain it manually with a second floodgate attached to a lever, or whatever trigger you want. The water pressure plate can also be attached to the drain pressure plate of another, identical setup that's attached to your next hallway. You'll have to manually charge bits of it but oh well.
Title: Re: Serial entrances
Post by: Girlinhat on June 10, 2011, 04:34:07 pm
Both of us mentioned those, but that doesn't cycle them.  There's no logic gates or computing involved with a simple holder like that.  The issue is, he wants to rotate gates, and that will require some dwarfputing.
Title: Re: Serial entrances
Post by: ohgoditburns on June 10, 2011, 04:54:07 pm
Have to test this later today. Here's the basic switch unit from a side view:

Code: [Select]
|#@> | n2
|^<@ | n1
||||^| n0

|=Wall
#=Hatch
@>=pump with direction
^=pressure plate

The pump on n2 is always powered, but the hatch prevents it from drawing water.

n0 plate activated: the bridges are raised, blocking off the hallway. This plate also engages the gear that drives the n1 pump on the next unit, pulling the water of its n0 plate and lowering its bridges.
n1 plate activated: disengages the adjacent pump so that it doesn't continually reset itself when the hatch gets triggered.

I'm skeptical that I can get the gears to work this way. I haven't used gears with switches before, and I need to do some science to refine this design.
Title: Re: Serial entrances
Post by: Darkmere on June 10, 2011, 04:56:46 pm
Have you considered machine-logic and designing the entire control process to function as a sort of self-populating binary list?

Actually... you might get finer individual control by manipulating a third set of bridges as gateways that function separately from the chambers, and just allow the dropping floors to close on their own. Then you could have an infinite number of goblins that keep getting dropped into the slow-drowning pits without potentially clogging the system when all chambers are full. drown, drain, and recover/incinerate at your leisure.
Title: Re: Serial entrances
Post by: Girlinhat on June 10, 2011, 05:09:44 pm
I've always wanted to see how deep I could pack invaders...  Use Stupid Dwarven Tricks to shunt them all into a 1x1 tile, capturing entire sieges year after year.  But that's aside the point.

To cycle your entrances so that one, and only one, is open at a time, you'll need a series of XOR gates and some great fluid logic.
Title: Re: Serial entrances
Post by: Darkmere on June 10, 2011, 05:21:37 pm
Cyclic pumps blocked by hatches linked to the pressure plates that raise the trap bridges would do it. Pressure plates under the pump intake tile trigger at 3-7 water; when water is pumped to the next plate, off signal registers for the current bridge-gate as its water gets pumped down the line. You'd have to prime the system manually once.

At least if my reasoning is sound.
Title: Re: Serial entrances
Post by: Girlinhat on June 10, 2011, 05:42:47 pm
Depends on the usage.  Fast-firing sequencer will do that very easily, but holding one switch state indefinitely and being able to switch upon further input, is a tad more difficult.
Title: Re: Serial entrances
Post by: ohgoditburns on June 10, 2011, 05:43:58 pm
The state is stalled by means of a hatch (assuming hatches block pump flow).
Title: Re: Serial entrances
Post by: ohgoditburns on June 10, 2011, 05:49:35 pm
Cyclic pumps blocked by hatches linked to the pressure plates that raise the trap bridges would do it. Pressure plates under the pump intake tile trigger at 3-7 water; when water is pumped to the next plate, off signal registers for the current bridge-gate as its water gets pumped down the line. You'd have to prime the system manually once.

At least if my reasoning is sound.

Definitely thinking this is the way to go. Unfortunately it will have to be a little more complicated than the cycle pumps. The hatches will stall the cycle state... but they also block the water from falling into the next catchment.

Code: [Select]
|#@>#@>#@>
|^||^||^|
Title: Re: Serial entrances
Post by: Darkmere on June 10, 2011, 06:03:22 pm
I knew I was missing something. What about using machine logic to only power the cycling pump, and using the trap pressure plates to open both hatches on each side of the pump? Closing delay is 100 steps, should be plenty of time for the pumped water to fall in the catchment. Have the trap triggering plate toggle a gear assembly powering (current pump-2) in a cycle, so the water doesn't shoot through the whole system with bot hatches open.
Title: Re: Serial entrances
Post by: Girlinhat on June 10, 2011, 07:25:31 pm
The idea was to either flood them, training them in swimming OR drowning them.  If needed, then toss them into an arena, possibly a flooded arena for underwater fighting.  Or just release them all at once, and watch 500 goblin swordsmen run for map's edge.