Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: First complicated mechanical system  (Read 963 times)

Lukas

  • Bay Watcher
    • View Profile
First complicated mechanical system
« on: March 14, 2010, 11:34:36 am »

(I wasn't sure which forum to put this in, so I put it here)

Hi! So I've been playing DF for a while, and have continously used a simple mechanical approach to trap setup (i.e. pressure plate triggers bridge to raise). However I've become interested in more complicated mechanics - where a pressure plate causes a series of events which leads to a trap, or something else. I've also been bugged by the fact that sometimes creatures retrigger plates, which for example leads the bridge to go back down again. So I decided to try this. I would like your opinion on this - I know many of you have been doing this type of mechanics for a long time, while others have not. Either way, I would appreciate it if you could point out flaws in this simple design, give suggestions on better designs, etc.

Here's the basic principle (which I will outline in more detail in just a second). An unwanted creature triggers a pressure plate. This pressure plate allows a small room to fill with water. The water triggers another pressure plate, which allows (for the time being) a bridge to be raised, preventing the creatures from entering. There will be a manual reset system, which will allow the water flow to stop, the small room to drain, and the bridge to be lowered. The glory in this system is that if a creature retriggers the pressure plate, the bridge won't come back down since the plate only activates the water pump, and the room will already be filled with water (which will have triggered another pressure plate)

Here's the setup of the water based system (forgive me if you read this and the diagram looks really messed up; once I post this I'll fix it):
Code: [Select]
(z-level)
############$$$
W###*----%%$$$
W*##|######$$$
W|##|
W*--*----------*
W*
W
Code: [Select]
(z+1 [bottom right gear from z attaches to bottom right gear in z+1)
%%PH
**
#*

W - water wheel
* - gear mechanism
%% - pump
|, - - horizontal shafts
$ - water (or water chamber)
P - pressure plate
H - ground hatch
# - extra space (unimportant)

So here's how it goes:
1. creature triggers pressure plate
2. this activates pump 2 (on level z+1), which quickly fills up the above room using the water provided below
3. this water activates a pressure plate, which raises the bridge. The  pressure plate also closes the hatch.
4. all parts that have been altered will be reset by a series of levers (manual reset)

Here's a more detailed version of what I just sayed, for those who are interested:
These should be the normal conditions:
pump 1 (z) - ON
pump 2 (z+1) - OFF
hatch (z+1) - OPEN
bridge (z, not represented in daigram) - DOWN

- If pressure plate 1 (z, not represented in diagram. creature triggers this), is ON, then:
pump 2 (z+1) - ON
hatch (z+1) - CLOSE
- If pump 2 (z+1) is ON:
pressure plate 2 (z+1) - ON
- If pressure plate 2 (z+1) is ON:
bridge 1 (z, not represented in diagram) - UP

- to reset:
lever 1 - pump 2 (z+1)
lever 2 - hatch (z+1)
lever 3 - bridge 1 (z)
« Last Edit: March 14, 2010, 11:42:21 am by Lukas »
Logged

EliDupree

  • Bay Watcher
    • View Profile
    • Eli Dupree's Web Page
Re: First complicated mechanical system
« Reply #1 on: March 14, 2010, 12:15:12 pm »

Either way, I would appreciate it if you could point out flaws in this simple design, give suggestions on better designs, etc.
I'm afraid I can't point out flaws in that simple design. You see, the flaw in that design is that it's not simple. :P Another flaw is that your initial pressure plate - the one the enemy steps on - is going to have to be some distance back from the bridge, because bridges don't operate immediately. I'll show you the automatic enemy blocking mechanism my last fortress used at its gate. Here's the main gate (approximately):

Code: [Select]
#...#
#...#
#^^^#
#¢¢¢#
#╔═╗#
#╚═╝#
#...#

Each of the pressure plates (^) is directly connected to all of the hatches (¢) and to one more hatch elsewhere. Elsewhere, you see this:

Code: [Select]
#.#
#.#
#┼#
#^#
###
Directly above the pressure plate in this diagram is the hatch, and directly above that hatch is water fed from my reservoir. That is, there will always be 7/7 water above that hatch. The pressure plate in this diagram is connected directly to the bridge in the above diagram (and also to other defenses that should kill the enemies who stepped on the gate's pressure plates in the first place - otherwise they just disabled your gates completely.) The door in this diagram leads to a drain; it is the only reset needed.

Inside my fortress you see this:
Code: [Select]
╔═╗
║ò║
O^O
The lever does nothing - it's just to trick the dwarves into walking across the pressure plate. The pressure plate is connected directly to the door in the above diagram. (I do this so that I only have to manually designate pulling the lever once, instead of twice.) In short, the entire system can be reset by ordering a single lever pull.

So, when an enemy steps on one of the gate's pressure plates, the following sequence happens:
1) The gate hatches open instantly and the enemy is stopped. Meanwhile, the lasting-effect pressure plate gets 7/7 water dumped on it, and almost immediately triggers the drawbridge to start closing.
2) The enemy steps off the plate, but by the time the plate deactivates and closes the four hatches, the bridge is up.
3) The other defenses kill the enemy.
4) I notice that some enemies have set off the defenses and allocate the pulling of a lever. The door opens, the water clears out, and the lasting-effect pressure plate turns off after 100 frames. The bridge closes another 100 frames after that, and the violent defenses turn off. Everything is back to normal.

With a bit more cleverness, you could add overrides and/or prevent the system from wasting water if you pull the all-clear when there's an enemy on one of the pressure plates.
« Last Edit: March 14, 2010, 12:17:34 pm by EliDupree »
Logged

Nobbins

  • Bay Watcher
  • Dustland
    • View Profile
Re: First complicated mechanical system
« Reply #2 on: March 14, 2010, 12:34:29 pm »

Someone needs to make some system that, whenever a hostile or anything steps on a plate, one of four bad things happen, then the trap cycles to the next bad thing.

IE:
1st: Drowning in water.
2nd: Burning in magma.
3rd: Mauled by animals.
4th: Dropped into a 10z pit.
Logged
Nobbins's Tileset Shoppe
It would mean that once a year, all of your female cats suddenly explode if there are any male cats around.

Lukas

  • Bay Watcher
    • View Profile
Re: First complicated mechanical system
« Reply #3 on: March 15, 2010, 12:42:30 pm »

EliDupree - I like what you did there! that is actually more of what I was looking for than what i came up with, I believe - i thought of trapping invaders in a room with floodgates, but those also take time to close. i like how the hatches slows the enemy down, giving you time to allow the room to fill with water. its nice and simple, thanks for the ideas

Nobbins - hahaha, yeah they really should. or make an overkill thing, where first invaders are almost drowned in one room - then dropped down to burn in magma - then dropped down into an animal pit - then finally whoever/whatever remains is dropped into the final pit. that would be incredible.
Logged