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 4691 times)

Quietust

  • Bay Watcher
  • Does not suffer fools gladly
    • View Profile
    • QMT Productions
Re: Water Clock
« Reply #30 on: August 06, 2009, 09:51:42 pm »

The good news is that I just tested my suggested improvement, and it appears to work - with 2 screw pumps pressurizing the repeater's input, the water covers the pressure plate the instant the bridge lowers, which would reduce the period to exactly 300 ticks.

The bad news is that when I set up my repeater in the middle of the embark region, the raising bridges are now taking 101 ticks to lower and 102 ticks to raise (with a floor hatch also linked, which appears to respond exactly 1 tick after the pressure plate changes state), so getting a perfect 300-tick period may depend on the position in which the repeater is built on the map.

I also tested and verified that if you build the repeater close enough to the surface, you can simply pump the waste water directly back into the brook since there'll always be room for it (as the drain tiles at the edge of the map will never be 7/7).

The actual layout is as follows:
Code: [Select]
   Z+0       Z-1       Z-2       Z-3
~║║║~~~~~ ≈≈≈≈≈≈≈≈≈ ▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓
..║._.... ▓▓▓▓.▓▓▓▓ ▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓
..║...... ▓▓▓▓_▓▓▓▓ ▓▓▓▓__▓▓▓ ▓▓▓▓..▓▓▓
..║...... ▓▓▓▓.▓▓>▓ ▓▓▓▓%%┼<▓ ▓▓▓▓▓▓▓▓▓
..☼.ò.... ▓>o▓.▓▓.▓ ▓Xo▓%%▓▓▓ ▓<☼═☼..▓▓
..║...... ▓▓▓▓.▓▓.▓ ▓▓▓▓..▓▓▓ ▓▓▓▓▓▓.▓▓
..☼═☼.... ▓▓▓▓%▓▓.▓ ▓▓▓▓≡▓▓▓▓ ▓▓▓▓▓▓.▓▓
......... ▓▓▓▓%▓▓.▓ ▓▓▓▓#▓▓▓▓ ▓▓▓▓▓▓.▓▓
......>.. ▓▓▓▓╥┼X.▓ ▓▓▓▓^┼X▓▓ ▓▓▓▓▓▓<▓▓
......... ▓▓▓▓╨▓▓▓▓ ▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓
......... ▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓

Most of the symbols should be self-explanatory.
« Last Edit: August 06, 2009, 10:30:14 pm by Quietust »
Logged
P.S. If you don't get this note, let me know and I'll write you another.
It's amazing how dwarves can make a stack of bones completely waterproof and magmaproof.
It's amazing how they can make an entire floodgate out of the bones of 2 cats.

Shakma

  • Bay Watcher
    • View Profile
Re: Water Clock
« Reply #31 on: August 07, 2009, 12:52:51 am »

Shakma: In the end I managed to test your design, and as far as I've seen, it only works once. I think it's because I had to set the PP to 4-7 to ensure the bridge would act correctly, and that screws the floodgate. It requires an inverter between those two elements, I think. Back to the drawing board for me. This is fun ;D

Just tried mine.  Seems to work just fine.  Definitely repeating and I think it's accurate but don't have the time to test it for that right now.  I think it's probably around 302 or 303.

Code: [Select]
Side view:
#X<< ####
####_<< #
#### >>B#
WWWWW####

B is a drawbridge
_ is the pressure plate to the bridge and floodgate.

How I started it was to make sure the PP is linked to both, start with the FG closed and the drawbridge up.  Flipped a lever to the drawbridge. 

One thing playing around with this stuff that I didn't realize is that when a gear is hooked to a PP, the "off" signal from the PP doesn't wait until the PP changes state like it does for bridges and FGs.
Logged

Shakma

  • Bay Watcher
    • View Profile
Re: Water Clock
« Reply #32 on: August 07, 2009, 12:59:47 am »

Code: [Select]
Side view:
# <<b####
# ##_<< #
#W## >>B#
#WWWW####

B is a drawbridge
b is a retractable bridge
_ is the pressure plate to the bridge and floodgate.

I think mine could be switched to this to make it work without infinite water.
Logged

Flashzom

  • Bay Watcher
    • View Profile
Re: Water Clock
« Reply #33 on: August 07, 2009, 02:09:52 am »

To remove the pain of an accurate repeater, why not just embark by the ocean? The tide rises, the tide falls.
Logged
And as the fires licked and roared over his skin, Urist realized that the hustle and bustle of being on fire really tired him out.

Sir Pseudonymous

  • Bay Watcher
    • View Profile
Re: Water Clock
« Reply #34 on: August 07, 2009, 03:58:48 am »

Well, I tested my theory while away from an internet connection, and it seems the number of pumps required to get a constant flow of 7/7 water for one pump when fed from an aquifer is just too fucking large. I got up to 54 pumps feeding one from two troughs cut in the aquifer, and still got an inconsistent flow out of the top.

However, I scrapped all of it, and rebuilt a similar design next to it, only adapted to work as a repeater. Four sets of four pumps each feed another pump on the level above to produce a constant set of 7/7 water for another pump to draw off of, so long as it doesn't run long enough to drain the lower reservoirs. The repeater at the top is... hmm. A pump feeding a one tile reservoir with a pressure plate attached to a gear to turn on another pump that drains that square into a five tile reservoir, with a pressure plate set to 0-5 at the start and a drawbridge next to the other four squares. That pressure plate links to the drawbridge and a gear that controls the first of these pumps. I think the first pressure plate is superfluous, but I'm not sure. It seems the top pump always runs, and that reservoir is only empty for one click anyways. I'd try to make a little ascii graph of it, but I can neither make nor make sense of those...

It *looks* like it runs at a constant interval, and it should, logically. But when I built it my mind was too foggy to count right. I built it this afternoon based on designs I came up with in the morning, but was too tired to understand while working with them, I even screwed up the top pressure plate the first time around, and had to destroy it and the bridge and redo all of that. Every part linked to a pressure plate was also linked to a lever, allowing fiddling around until it starts working right.

Hmm... just tried counting cycles, and I got 114 from when the bridge has closed to when it opens again :/ . I'm thinking there's a bit of randomness introduced by water draining off the pad. Or something like that. Or I'm counting wrong. Well, I'll see if I can't figure this out... The down tick seems to be a perfect 100, though it should be 101, shouldn't it?

Edit: Yeah, it's a delay while water leaves the pad. A 7/7 column of water just stands on it, so it doesn't get triggered for ~10 cycles. :/ Need to make a design that alternates between two repeaters then. Or something like that.
« Last Edit: August 07, 2009, 05:03:54 am by Sir Pseudonymous »
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 #35 on: August 07, 2009, 05:03:31 am »

Yay! You guys have really been active while I was away  ;D

Let's take it from the top:

Quatch: According to the wiki, 1200. Not sure if it's a 100% accurate figure, or if it's changed in the latest versions, but it's what I'm going with.

Shakma: I must have done something wrong when building it, then. I'll try again when I have some time. Your new design seems like it'd work pretty well, and it's pretty similar to what I'm finally doing myself. I just made all the bridges raising, and added another one in the input of the lowest pump. I have a question, though: how do you make sure that the bottom pump only sucks a single tile, instead of flooding the whole circuit? Or does it not matter? In my case, I've added a pressure plate at the exit of the pump that toggles the gear for the bottom pump only.

Quietust: floor hatches do indeed respond the next tick after they're activated. That the timing for the bridges is dependant on location is bad news if true, and makes no bloody sense (then again, this is DF :P ). Any chances you might have counted wrong, or did you confirm it already?

Flashzom: Where's the fun in that? Also, I've yet to embark near an ocean, so I'm not sure how accurate tides are in DF. I didn't even know there were tides! ;D

Sir Pseudonymous: That's a pity on the constant flow, but not unexpeced, sadly. I'm glad you managed to find an alternative. I'm not sure if it should be 101 or 100 ticks, since I haven't really seen your design, but I'll tell you that if a bridge (or hatch) opens at the input of a pump, the water in the tile is sucked on the same tick, not on the tick after. That might explain what you see. Also, a PP activates immediately, but it takes a few ticks to deactivate. Not sure if that's affecting your design or not, but if it does, it might explain those extra 14 ticks you're seeing.





Logged

Shakma

  • Bay Watcher
    • View Profile
Re: Water Clock
« Reply #36 on: August 07, 2009, 06:21:36 am »


Shakma: I just made all the bridges raising, and added another one in the input of the lowest pump. I have a question, though: how do you make sure that the bottom pump only sucks a single tile, instead of flooding the whole circuit? Or does it not matter? In my case, I've added a pressure plate at the exit of the pump that toggles the gear for the bottom pump only.

The drawbridge after the bottom pump will stop any water flow unless it's down.  When it's down, the retrac bridge at the top keeps water from passing to the last bridge.  So it's always 1 tile of water.

I don't think toggling the gear works as it will kick back on too soon (sooner than a bridge will close).
Logged

DeathOfRats

  • Bay Watcher
    • View Profile
Re: Water Clock
« Reply #37 on: August 07, 2009, 06:34:56 am »

It does, but there's one bridge that has to open for that gear to toggle (so the water drains from the PP) + the time until the pad deactivates. That should keep it working, I think.
Logged

Sir Pseudonymous

  • Bay Watcher
    • View Profile
Re: Water Clock
« Reply #38 on: August 07, 2009, 07:31:02 am »

Hmm... My dual repeater design looks like it runs, but it jams up every few seconds, requiring dorf intervention to jump start it again :/ . I blame not having a fucking clue what I'm doing when I hook up pressure plates being a lazy idiot who forgot to link the plates up to the atom smasher at the top, and didn't feel like tearing down walls to set it up for a simple test, instead using a dorf and a lever set to repeat :/ . Hmm... an initial count suggests... that the period for each repeater is different :/ . I'm not getting conclusive results, so something is wrong...

The repeater: (bottom level on the left, top on the right; underworks and gears/axles not shown, assume all pumps have power when not turned off by a pressure plate, and that there is always a 7/7 block of water for the pumps to draw from)
Code: [Select]
###    ####
#1#   pPBB#
#B#    #BB#
#P#    #BB#
 p     #BB#
       #BB#
 p     #BB#
#P#    #BB#
#X#    #BB#
#2#   pPBB#
###    ####
Where 1 and 2 are pressure plates, both linked to the floodgate (X) and both bridges (B). The pumps (pP) face in the direction of (P). 1 is set to trigger on 0-4 water, 2 on 5-7. Or else that's backwards :/ . It's whichever way leads to it repeating, as I believe the other would make it stall. 1 is linked to a gear that controls power to the southern second level pump, 2 to a gear controlling the northern second level pump. The top pumps line up to drain the squares the pressure plates are on.

I'm going to modify it a little to see if I can't get better results.

Edit: Modified version works! Both counts came up with a period of exactly 310 cycles, divided between four states. I'll see if I can't come up with a decent diagram of it. It's not doing what I expected, and I'm not sure on the initial settings of its various pieces, but the design is working, and appears to be working perfectly! :D :D :D :D :D
« Last Edit: August 07, 2009, 09:33:33 am by Sir Pseudonymous »
Logged
I'm all for eating the heart of your enemies to gain their courage though.

Quietust

  • Bay Watcher
  • Does not suffer fools gladly
    • View Profile
    • QMT Productions
Re: Water Clock
« Reply #39 on: August 07, 2009, 10:25:13 am »

Just retried my design in another region, and this time the bridges are taking 100 ticks to lower and 101 ticks to raise, giving a 301-tick period. 300 ticks would be 100% ideal, since that divides evenly into the number of ticks per day and thus would not drift and require occasional resynchronization.
Logged
P.S. If you don't get this note, let me know and I'll write you another.
It's amazing how dwarves can make a stack of bones completely waterproof and magmaproof.
It's amazing how they can make an entire floodgate out of the bones of 2 cats.

Sir Pseudonymous

  • Bay Watcher
    • View Profile
Re: Water Clock
« Reply #40 on: August 07, 2009, 10:31:21 am »

Spoiler (click to show/hide)
Where θ and ω are floodgates, numbers are pressure plates, letters are gear assemblies, and YAY! is the atom smasher. The list shows which plates are connected to what. The levers are connected to whatever they're closest too, but the displayed states are meaningless as once the machine starts they cease to be relevant.

The periods I recorded are from θ closed; ω open -> θ open; ω open: 100 -> θ o; ω c: 99 -> θ c; ω c: 103 -> θ c; ω o: 8. These might not be wholly accurate, but I arrived at those numbers both times I counted it all out, and there doesn't appear to be room for randomness to enter into the equation. There may be a way to alter the periods to be closer to ideal, possibly by changing the size of the atom smashing tank, but I haven't tested anything, and I'm kind of afraid to touch it as I had a hell of a time getting it started.

Edit: I'm also not sure how to adapt this into a useful output. But it works anyways :/ .
« Last Edit: August 07, 2009, 10:33:37 am by Sir Pseudonymous »
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 #41 on: August 07, 2009, 10:36:53 am »

On bridges: A simple side-by-side comparison with retractable and raising bridges shows that they take exactly the same number of ticks to open and close.

Somebody is mis-counting.

Using a lever linked to both bridges and a door, it's easy to demonstrate that doors open on the same frame the lever gets pulled, and bridges get raised 100 ticks later (tick 0 = lever pull/door open/shut, tick 100 = bridges raise/drop)

More testing shows that floodgates also open/shut on tick 100, and hatches open/shut on tick 0.

Gear assemblies also engage/disengage on tick 0.

I've started a fort using ninja-robo-dorfs (no_sleep, no_eat, no_drink, speed:0, noexert, etc.) to build a clock.

I think my aquifer-based water intake plans might be a little overkill right now, with 35 pumps drawing from single-tile holes in the aquifer (each hole is surrounded mostly or entirely by aquifer wall tiles)... but at least I'll never run out!
« Last Edit: August 07, 2009, 12:01:01 pm by Peewee »
Logged

Quietust

  • Bay Watcher
  • Does not suffer fools gladly
    • View Profile
    • QMT Productions
Re: Water Clock
« Reply #42 on: August 07, 2009, 12:20:39 pm »

On bridges: A simple side-by-side comparison with retractable and raising bridges shows that they take exactly the same number of ticks to open and close.

Somebody is mis-counting.

Using a lever linked to both bridges and a door, it's easy to demonstrate that doors open on the same frame the lever gets pulled, and bridges get raised 100 ticks later (tick 0 = lever pull/door open/shut, tick 100 = bridges raise/drop)

More testing shows that floodgates also open/shut on tick 100, and hatches open/shut on tick 0.

Gear assemblies also engage/disengage on tick 0.

I can assure you that I did not miscount. Each time I tested a repeater construction, I checked the timing on no fewer than five iterations to make sure they were consistent, and the discrepancies I saw were 100% consistent.

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.

In my latest several tests, I connected floor hatches to the pressure plate as well, and they opened exactly 1 tick after water covered the plate and closed exactly 1 tick after the plate's color went from 'dark purple' to 'bright purple' (that is, when it disengaged due to the lack of water).

The times you have stated seem to be the "ideal" trigger delays for devices, while in actual gameplay they sometimes take longer as evidenced by my own experimentation (using 40d with the only mod being the aforementioned ninja-robo-dorfs) - the variations are constant for a particular building, and they could vary by region size, region position, build order, or maybe even something stupid like building quality (mechanism quality has been shown to not have any effect, but "masterpiece designed" bridges could possibly change things).
« Last Edit: August 07, 2009, 12:27:24 pm by Quietust »
Logged
P.S. If you don't get this note, let me know and I'll write you another.
It's amazing how dwarves can make a stack of bones completely waterproof and magmaproof.
It's amazing how they can make an entire floodgate out of the bones of 2 cats.

Peewee

  • Bay Watcher
  • Watcher Of Bays
    • View Profile
Re: Water Clock
« Reply #43 on: August 07, 2009, 01:23:06 pm »

Ok then... I haven't had a chance to test with actual pressure pads on my map yet. Perhaps there is a difference in the timing when pressure pads are used instead of levers. Sorry if I offended you, Quietust (or anyone else who counted the ticks, for that matter).



I figured out how I'm going to display the output from my counters!

I'm going to use this binary to BCD converter followed by fiveBCD to 7-segment display converters of these controllers connected to seven retractable orthoclase bridges each.

Good thing I have a lot of z-levels to work with, considering how much room a single gate takes up!

I'll be using gears as much as possible, to make the logic as fast as possible.

EDIT:
Just because 8 bits looked too easy, I've decided to use 16-bit input for the binary -> BCD converter.
OH MY, this is going to be dwarfy! I've been drawing a logic diagram, and it's showing that I'll need 35 of that module in the first link... I think I can probably get away with only using 34, though.

Now I just need to figure out the logic of that module...
« Last Edit: August 07, 2009, 03:36:54 pm by Peewee »
Logged

Sir Pseudonymous

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

I haven't had much progress myself. I scrapped that last design, and put together a repeater with a 410 frame period, 205 to the on state, 205 to the off. It seems like that can be manipulated by altering the size of the tanks involved, the more space is filled, the more frames it takes. So I suppose, to get a useful number out of it, it would have to be inflated to multiply evenly into 1200, 33600, or 100800.

Now, when you chain multiple devices to a single pressure plate, does it alter the time till response? Because the floodgates and bridges involved appear to be taking 202 cycles to switch states :/ .

Peewee, pull that off and you'll have dwarfed us all :3 .
Logged
I'm all for eating the heart of your enemies to gain their courage though.
Pages: 1 2 [3] 4