Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: [Computing] I need a repeater!  (Read 1651 times)

Corinthius

  • Bay Watcher
    • View Profile
[Computing] I need a repeater!
« on: May 11, 2010, 08:44:07 am »

Where's a 555 when you need one?

Anyway, I'd like to make a megatrap where alternating bridges drop invaders into a holding pit where I can do devious things to them. I'm looking for a nice repeater to do the bridge drawing for me. I'd prefer one that alternates at about 100 steps, so I could make each alternating bridge 20 spaces long and be very sure that no one would be able to get across.

Any ideas? Most of them seem to be around 400-200, which is too long. :/

Thanks much!
Logged

Dave Mongoose

  • Bay Watcher
    • View Profile
Re: [Computing] I need a repeater!
« Reply #1 on: May 11, 2010, 09:10:30 am »

100 steps is the time it takes a bridge to respond to a signal, so a 100-step repeater would be at risk of synching up with the bridge and it would never activate...

Are you sure you need it that fast?

I'm not even sure it is possible to build one that fast, since almost all mechanical objects have a 100-step reaction delay.
Logged

Corinthius

  • Bay Watcher
    • View Profile
Re: [Computing] I need a repeater!
« Reply #2 on: May 11, 2010, 09:15:40 am »

Oh darn, didn't realize everything had that 100-step delay. Ok well then I suppose I can just do a longer bridge with a longer delay.

Thanks!
Logged

Kidiri

  • Bay Watcher
    • View Profile
Re: [Computing] I need a repeater!
« Reply #3 on: May 11, 2010, 09:19:05 am »

BOOM! It's a nice design and is useful for repeating things. The upside is that it can be modified to have as many steps as needed.
Logged
Veni, Vidi, Pompeii.
Soylent Green is kittens!
Sometimes, when my Dorfs are exceptionally stupid again, I wonder what exactly the [INTELLIGENT]-tag does.

NecroRebel

  • Bay Watcher
    • View Profile
Re: [Computing] I need a repeater!
« Reply #4 on: May 11, 2010, 09:24:21 am »

Very tricky to do; since bridges have a 100-step delay for doing what a mechanism tells them to, and pressure plates have a 100-step delay between when the trigger stops and when the mechanism sends the "off" message, 200-step delays are more-or-less the minimum.

What you're going to have to do is make a "standard" repeater, then set it up so that the first trigger of it triggers a second repeater (so the second one triggers 100 steps after the first). The second repeater then has to trigger a third repeater (so the third one triggers 100 steps after the second), and the third to a fourth (so the fourth triggers 100 steps after the third). Put an inverter on the second and fourth repeaters, and link the first repeater and the inverters both to your bridge trap. Using 202-step repeater designs, you'll have a trigger/untrigger every ~101 steps, which is just what you want.

You need 4 repeaters because it'll go like this: Repeater 1 sends on message, bridges retract; 100 steps later, Inverter A (connected to Repeater 2) sends off message, bridges reappear; 100 steps later, Repeater 1 sends off message, which is ignored; ~5 steps later, Repeater 3 sends on message, bridges retract; 100 steps later, Inverter A sends on message, which is ignored; ~5 steps later, Inverter B (connected to Repeater 4) sends off message, bridges reappear; 100 steps later, Repeater 3 sends off message, which is ignored; ~5 steps later, Repeater 1 sends on message, bridges retract; then it should repeat from the beginning if I'm not making any mistakes, which I probably am.

Fewer repeaters will end up not having the bridges trigger and untrigger regularly; they'll have both 100-step and 200-step intervals. You might only need 3 repeaters, though... regardless, you'll need more than 1 and/or a complicated mechanical- or fluid-logic computing system to figure the whole thing out.
Logged
A Better Magma Pump Stack: For all your high-FPS surface-level magma installation needs!

Dave Mongoose

  • Bay Watcher
    • View Profile
Re: [Computing] I need a repeater!
« Reply #5 on: May 11, 2010, 09:28:45 am »

BOOM! It's a nice design and is useful for repeating things. The upside is that it can be modified to have as many steps as needed.

I think that's 'steps' as in stages, not steps as in timesteps...

Pressure plates don't trigger fast enough to fire every timestep.
Logged

Corinthius

  • Bay Watcher
    • View Profile
Re: [Computing] I need a repeater!
« Reply #6 on: May 11, 2010, 09:32:11 am »

@NecroRebel WOW, I didn't expect it to be quite that complicated, but what you say does make sense. Sadly I'm no where near competent enough to make something like that yet, still being fairly new to this whole deal. Maybe I need to rethink my methodologies here... ;-)


Over at this questions thread - http://www.bay12forums.com/smf/index.php?topic=57090.0, they suggested using dwarf power. Not quite as awesome, but until I get mechanics figured out, maybe a wiser idea?
Logged

NecroRebel

  • Bay Watcher
    • View Profile
Re: [Computing] I need a repeater!
« Reply #7 on: May 11, 2010, 09:42:02 am »

Yeah, dwarf power is much, much simpler, though it of course isn't quite as reliable as a mechanical or fluid system since dwarves need that pesky "sleep" and "sustenance." The simplest form a dwarf-powered repeater is a lever set to pull on repeat. That'll retract and reappear the bridges every 100 steps.
Logged
A Better Magma Pump Stack: For all your high-FPS surface-level magma installation needs!

Sphalerite

  • Bay Watcher
    • View Profile
    • Drew's Robots and stuff
Re: [Computing] I need a repeater!
« Reply #8 on: May 11, 2010, 10:58:24 am »

Here's what you build:

Code: [Select]
W W W          top = connected to infinite water source
WXWXW          W = wall
WbWbW          b = single tile raising drawbridge
W^W^W          ^ = pressure plate
WXWXW          X = floodgate
WWWWW

The two floodgates to the north are connected to your master on/off switch for the system.  They let water into the device.

The pressure plate on the left is set to trigger for water at a level greater than 4.  Connect this pressure plate to both raising bridges and to the floodgates to the south.  This is your main repeater pressure plate.  When it senses water it raises the bridges to the north, cutting off the water input, and opens the floodgates to the south, which lowers the water level in the system to deactivate the pressure plates.

The pressure plate on the right is set to trigger for water at level less than 5.  This pressure plate exists only to give you an inverted output from the repeater, and is not connected to any of the bridges or floodgates that are part of the repeater itself.

When you build your alternating bridge array, connect one bridge path to the pressure plate on the left, and the other path to the pressure plate on the right.  When the device is active these two will alternate on/off at 100 cycle steps.

Disclaimer:  I built and tested this device in 40d.  I'm pretty sure it still works in DF2010, but haven't tested it yet.
Logged
Any intelligent fool can make things bigger and more complex... It takes a touch of genius --- and a lot of courage to move in the opposite direction.

Shoku

  • Bay Watcher
    • View Profile
Re: [Computing] I need a repeater!
« Reply #9 on: May 11, 2010, 01:25:06 pm »

Well if you just want to dump goblins and anything else there's an easy way to do it. rows of pressure plates between the bridges. 3 bridges should be long enough to catch everything but you could go 4 to be safe.

Now obviously this thing isn't going to so easily turn itself back off but that is why you also have them linked to a little machine that turns itself off. A way I know of doing this is to have a gear giving power to a pump, the pump fills a couple of tiles with a plate for high water, and that plate opens a hatch next to the plate so it (or was it a second one?) will send the signal that brings the bridges back out. You could easily work out the timing with a bridge that doesn't do anything and just pulling a lever to retract it and set the whole thing going.
Logged
Please get involved with my making worlds thread.

Reese

  • Bay Watcher
    • View Profile
Re: [Computing] I need a repeater!
« Reply #10 on: May 11, 2010, 06:59:36 pm »

a fast repeater you could use:
Code: [Select]
# %> #
#_<% #
####^#

The plate is connected to separate gears for both pumps.  The plate is set to trigger when it has less than 7/7 water.  The bottom gear is reversed by linking it to a lever and pulling that lever.

fill the lower area, start the power.

the entire repeater will send an open signal followed by a close signal the next tick every 100+x ticks where x is equal to the time it takes your 7/7 chunk of water to fall two z-levels (about 6 steps)

This requires a minimum power of 1 axel, two gears, and a pump (21) in the optimum configuration, which would look something like:

Code: [Select]
+++++ ##### ##### #####
WWW++ ###.# ###+# #####
WWW++ #*=%# ###^# #####
WWW++ #*#v# #*=%# #####
+++++ ###.# ###.# ###^#
+++++ ##### ##### #####

because bridges and floodgates ignore open and close signals while they are opening and closing, this makes a bridge or floodgate open and close with a period of about 212 steps, which is about the fastest it's possible to make them open and close due to delay. with enough gears and fast repeaters like these, BTW, you can create a system that repeats even faster (the best speed is about 50, because upright spikes have a delay of about 40 steps, and can be achieved with two of these repeaters- the trick is getting them offset by 50 or so steps.)
Logged
All glory to the Hypno-Toady!

Narmio

  • Bay Watcher
    • View Profile
Re: [Computing] I need a repeater!
« Reply #11 on: May 11, 2010, 09:19:22 pm »

(the best speed is about 50, because upright spikes have a delay of about 40 steps, and can be achieved with two of these repeaters- the trick is getting them offset by 50 or so steps.)

I use a repeater very similar to this design to cycle my hall of menacing spiky doom.  And it is a bit slow, I have roughly a 10x3 hallway of spike traps, and as things travel about ten steps between impalements, it's somewhat less doom-inducing than I'd hoped.  I've been trying to figure out an automated way of generating the offset necessary to get a pair of repeaters both linked up to the spike system to cycle it twice as fast.

My plan, which I haven't implemented yet, is to use a hallway with two pressure plates in it, each one linked up to one repeater, and fill the hallway with water so that they trigger one after the other.  Assuming I can generate water with a fixed pressure (which just involves making sure wherever the water comes from is equally full each time I trigger it), I just then need to figure out how far the water travels in ~50 steps and put that much distance between the plates.  Dwarf pulls the lever, opens the floodgate, trigger hallway fills with water, firing first one repeater, then the other.  The initial wait for the spikes to start firing would be fairly long, but once both repeaters are doing their thing, it should be time for chunky goblin-salsa.
Logged

Reese

  • Bay Watcher
    • View Profile
Re: [Computing] I need a repeater!
« Reply #12 on: May 12, 2010, 01:48:42 am »

(the best speed is about 50, because upright spikes have a delay of about 40 steps, and can be achieved with two of these repeaters- the trick is getting them offset by 50 or so steps.)

I use a repeater very similar to this design to cycle my hall of menacing spiky doom.  And it is a bit slow, I have roughly a 10x3 hallway of spike traps, and as things travel about ten steps between impalements, it's somewhat less doom-inducing than I'd hoped.  I've been trying to figure out an automated way of generating the offset necessary to get a pair of repeaters both linked up to the spike system to cycle it twice as fast.

My plan, which I haven't implemented yet, is to use a hallway with two pressure plates in it, each one linked up to one repeater, and fill the hallway with water so that they trigger one after the other.  Assuming I can generate water with a fixed pressure (which just involves making sure wherever the water comes from is equally full each time I trigger it), I just then need to figure out how far the water travels in ~50 steps and put that much distance between the plates.  Dwarf pulls the lever, opens the floodgate, trigger hallway fills with water, firing first one repeater, then the other.  The initial wait for the spikes to start firing would be fairly long, but once both repeaters are doing their thing, it should be time for chunky goblin-salsa.

water takes a few steps to fall, but a pump will move water on any step where 2/7 or more water exists where it pumps from, and will move all water on its input tile that can be fit into it's output space.  pumps also pump sequentially.  what I mean by that is, if two pumps are pumping from a single tile, the pump that was built last will pump first. 

This can be taken advantage of.

Normally a pump stack is built from the bottom up, and the oldest pump is at the bottom, the newest at the top.  it will take a number of steps equal to the number of pumps in the stack for the water to go from bottom to top.  however, if you built the top pump first and work your way down the stack, each pump will pump in sequence and the water will climb the stack in a single step.  How is this relevant? we want a continuous water feed of one chunk of water per step.

In order to do this, we want a minimum of four driving pumps arranged so the first built is your output and each next built outputs to the next oldest pump's input.

something like:
Code: [Select]
#########^ # <%~~~~~~~~~~~~~#
#          # ##_<%~~~~~~~~~~#
#          # #####_<%~~~~~~~#
#          # ########_<%~~~~#
#          # ###########_<%~#
#_________^X_##############_#

where the <% are pumps and the ~ is water and the two ^ are pressure plates that start your two repeaters, and there are several more z-levels of water stored above the pumps (never mind how they are powered)

the top pump should always be primed because whenever a chunk of water falls in to the input square of a pump it will be moved to the next empty space behind the main pump.  Since the pump at the top is continuously pumping one 7/7 chunk of water every step, it will take 50 steps for the timing chamber to the left to fill and two more for the top pressure plate to trigger.

The floodgate here is so that you can prime the whole thing and get the pumps running without prematurely triggering the lower plate.

alternately, you can set up a clover leaf of pumps to feed the main pump like so:
Spoiler (click to show/hide)

in this case, you don't need to worry about build order, you're just using brute force to ensure that the main pump is always primed.  and if that's not doing it, you can always add feeders that pump in water a level below to the input square of the main pump.
Logged
All glory to the Hypno-Toady!