Bay 12 Games Forum

Please login or register.

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

Author Topic: Water Clock  (Read 4685 times)

DeathOfRats

  • Bay Watcher
    • View Profile
Re: Water Clock
« Reply #45 on: August 08, 2009, 05:59:45 am »

When I set up my first repeater, I had both a raising bridge and a retracting bridge connected to the same pressure plate, and when the pressure plate got water on it, the raising bridge raised on one tick and the retracting bridge opened one tick later. When I replaced the retracting bridge with a second raising bridge, they both activated simultaneously.

Oookay, I just did this same test, and the retracting bridge opens one tick earlier for me. There's some variable here we're not taking into account.

EDIT: And yes, pressure plates add one tick to raise times. It's because a lever starts the "Open" order at t=0 after activation, but a PP starts it at t=1.
Logged

Sir Pseudonymous

  • Bay Watcher
    • View Profile
Re: Water Clock
« Reply #46 on: August 09, 2009, 07:54:23 am »

When I set up my first repeater, I had both a raising bridge and a retracting bridge connected to the same pressure plate, and when the pressure plate got water on it, the raising bridge raised on one tick and the retracting bridge opened one tick later. When I replaced the retracting bridge with a second raising bridge, they both activated simultaneously.

Oookay, I just did this same test, and the retracting bridge opens one tick earlier for me. There's some variable here we're not taking into account.

EDIT: And yes, pressure plates add one tick to raise times. It's because a lever starts the "Open" order at t=0 after activation, but a PP starts it at t=1.
Just did the same test, and got them both opening on the same tick :/ . Hmm... Does the size of the bridge have any effect? Distance from the trigger? Mechanic skill of the dorf connecting them? It doesn't seem like any of these have any effect, from what I've seen while testing different designs, but I wasn't explicitly watching for it then.

It seems more that pressure plates, at least when using fluids, require that it sit on the plate for one tick before they count as triggered. I could be wrong there, but that would explain the delay.

The best design I came up with so far ends up at 301 ticks. 101 off, 200 on. That doesn't make sense to me, but that's what I got every time I counted, watching a door that was also linked to the plate. It uses two pumps, a retracting bridge, a raising bridge, and one plate, and could theoretically be run with only a single 7/7 block, if you added more pumps to bring it back to the start rather than letting it be destroyed by the raising bridge.
Code: [Select]
   1   2
  XXX  XXX
R>>PX >>DX
  XXX  XXX
Where R is the retracting bridge, D is the drawbridge, P is a pressure plate set to trigger on 0-4 water (magma should work just fine as well). P is linked to both bridges.

Of course, that only works assuming both bridges switch at the same time. Which is all I've observed on my testing map :/ .

I tried altering the period of that repeater, by switching out the bridges for hatches and doors, and building a small inverter operating on the same principles, except I wound up with all the doors opening on the tick it was triggered, with the hatches closing three ticks later, even though it should have all happened simultaneously :/ .
Logged
I'm all for eating the heart of your enemies to gain their courage though.

DeathOfRats

  • Bay Watcher
    • View Profile
Re: Water Clock
« Reply #47 on: August 09, 2009, 08:40:44 am »

Just did the same test, and got them both opening on the same tick :/ . Hmm... Does the size of the bridge have any effect? Distance from the trigger? Mechanic skill of the dorf connecting them? It doesn't seem like any of these have any effect, from what I've seen while testing different designs, but I wasn't explicitly watching for it then.

It seems more that pressure plates, at least when using fluids, require that it sit on the plate for one tick before they count as triggered. I could be wrong there, but that would explain the delay.

Hmm, dunno. The retracting bridge was 1x1, the drawbridge 2x1. Both the same material, set up by the same mech. One of the bridges was further away from the PP than the other, but I can't remember which. Does number of devices connected to a single trigger change anything? In theory, none of that should have any effect, but...

I think you're correct on the PPs, btw.
Logged

Quatch

  • Bay Watcher
  • [CURIOUSBEAST_ GRADSTUDENT]
    • View Profile
    • Twitch? Sometimes..
Re: Water Clock
« Reply #48 on: August 09, 2009, 12:49:57 pm »

Code: [Select]
   1   2
  XXX  XXX
R>>PX >>DX
  XXX  XXX
Where R is the retracting bridge, D is the drawbridge, P is a pressure plate set to trigger on 0-4 water (magma should work just fine as well). P is linked to both bridges.

Ok, trying to build this, but having a spot of trouble reading the diagram.
1 is Z level 0, 2 is Z level +1?
are they directly stacked, or offset?
if directly stacked, they both have a source of water? Is the water source pressurized?
Logged
SAVE THE PHILOSOPHER!
>>KillerClowns: It's faster to write "!!science!!" than any of the synonyms: "mad science", "dwarven science", or "crimes against the laws of god and man".
>>Orius: I plan my forts with some degree of paranoia.  It's kept me somewhat safe.

Sir Pseudonymous

  • Bay Watcher
    • View Profile
Re: Water Clock
« Reply #49 on: August 09, 2009, 01:16:27 pm »

Code: [Select]
   1   2
  XXX  XXX
R>>PX >>DX
  XXX  XXX
Where R is the retracting bridge, D is the drawbridge, P is a pressure plate set to trigger on 0-4 water (magma should work just fine as well). P is linked to both bridges.

Ok, trying to build this, but having a spot of trouble reading the diagram.
1 is Z level 0, 2 is Z level +1?
are they directly stacked, or offset?
if directly stacked, they both have a source of water? Is the water source pressurized?
You've got the z-levels right. The top pump just needs to draw from the square with the pressure plate, and you just need to ensure that every 300 cycles there's at least 5/7 in the square the bottom pump draws from. Or less, I suppose, if the plate had a lower maximum. It shouldn't draw more than one block of water out, so long as the bridges close and open at the same time. Hmmm... Aligned like this:
Code: [Select]
0
XXXXXXXX
~XXXXXXX
XXXXXXXX

1
++XXXXXX
R>>PXXXX
++XXXXXX

2
+++++XXX
+++ >>DX
+++++XXX
Logged
I'm all for eating the heart of your enemies to gain their courage though.

Peewee

  • Bay Watcher
  • Watcher Of Bays
    • View Profile
Re: Water Clock
« Reply #50 on: August 10, 2009, 07:49:43 am »

Peewee, pull that off and you'll have dwarfed us all :3 .
Woo! New sig quote.

Anyway, I've worked out that the "C" block thing will need two parts; one to determine if it's greater than or equal to 0101, one to do the addition.

For the first part, it'll need only three gates.

Code: (? >= 0101) [Select]
3  2  1  0   input
|  |  |  |
|  |   OR
|  |   |
|   AND
|  |
 OR
 |
 A

The second part will need three half-adders and a full adder. Actually, I could do two half-adders, a full adder, and an OR gate, due to the nature of input/output 3. (if the most significant bit is 1, the sum of the other bits can't be more than 0100)

Code: (add 3) [Select]
3     2    1     0    input
|     |    | 1   | 1
v     v    v v   v v
OR<-half<-full<-half
|     |    |     |
v     v    v     v
S3    S2   S1    S0    output

There is actually a third part, the multiplexer, which lets the A output from the first part toggle between outputting the sum or just the input. It has too many crossing wires to put into a simple code box, though. It features 8 AND gates, four OR gates and one NOT gate.

I'm going to build a single 'c' block for testing, then savescum and start with the full version.

I'M NOT WORKING ON A CLOCK MECHANISM, JUST THE OUTPUT FOR IT!!!
« Last Edit: August 10, 2009, 12:04:41 pm by Peewee »
Logged

qwertyuiopas

  • Bay Watcher
  • Photoshop is for elves who cannot use MSPaint.
    • View Profile
    • uristqwerty.ca, my current (barren) site.
Re: Water Clock
« Reply #51 on: August 10, 2009, 09:14:32 am »

From a programming perspctive:

Delay variance *might* be related to machine tick order.

It likely checks all mechanical devices in the order they are built, and all the PP does is set a flag on the device to change next.

That means BUILD THE PRESSURE PLATES BEFORE ANYTHING ELSE, and it *might* fix the 101 delay issue.
Logged
Eh?
Eh!

Peewee

  • Bay Watcher
  • Watcher Of Bays
    • View Profile
Re: Water Clock
« Reply #52 on: August 10, 2009, 03:50:32 pm »

CONFIRMED through a simple, repeatable side-by-side test:
-Bridges do raise at different times based on when they were constructed relative to the pressure pad.

HOWEVER: the bridges built BEFORE the pressure pad were raised first.
-The bridges built after the pad was built were raised one frame after the others.

-Raising bridges and retracting bridges do not take different times to raise.

-The bridges built before the pad rose 100 frames after the water on the pressure pad hit 7/7.
-The bridges built after the pad rose 101 frames after the water on the pressure pad hit 7/7.

-They went down one frame apart in the same way. However, due to the fluctuating water in my test, I didn't get an accurate frame count. I assume it's safe to say it was exactly 100 and 101 again, though.

The completed logic circuit for a single add-3 module for my display:
http://www.neuroproductions.be/logic-lab/index.php?id=459
8 OR gates
13 AND gates
4 XOR gates
1 NOT gate
« Last Edit: August 11, 2009, 08:57:14 am by Peewee »
Logged
Pages: 1 2 3 [4]