Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Giving away idea: Traffic counter  (Read 660 times)

Grey Goo

  • Bay Watcher
    • View Profile
    • The Metallic
Giving away idea: Traffic counter
« on: September 13, 2013, 10:13:50 am »

Few days ago I got idea for somebody to try. The traffic counter! Ever wanted know how much traffic goes through your more important passages or how many goblins through meat-grinders? Sure this can be doned with those adders, but more mechanical ones are probably much more dwarfier. Bonus if counter is both very fast and very small. Probably you need fast one anyway. No, I am not going do this, but surely one of you can try and see how this will works...
Logged

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: Giving away idea: Traffic counter
« Reply #1 on: September 13, 2013, 10:35:12 am »

Probably with pressure plates linked to floodgates that open shortly to let 1/7 of water through for each dwarf that steps on the plate.
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

Anathe

  • Bay Watcher
    • View Profile
Re: Giving away idea: Traffic counter
« Reply #2 on: September 13, 2013, 10:55:18 am »

Probably with pressure plates linked to floodgates that open shortly to let 1/7 of water through for each dwarf that steps on the plate.

Wouldn't evaporation make this troublesome?
Logged

Larix

  • Bay Watcher
    • View Profile
Re: Giving away idea: Traffic counter
« Reply #3 on: September 13, 2013, 11:01:47 am »

Easiest and most reliable would be powered minecarts. Just use a circuit with two 'passage' events - one switching a blocking roller off on an 'off' signal, another opening a door (and turning a forward-pushing roller on) on the next 'on' signal.

(cart moves from left to right)
Code: [Select]
╔╗  ╔╗
╚╚--╚╚--
╔╗  ╔╗
╚RrD╚RrD
 *   *

These are two counting cells, above only the paths, below the constructions.

R - roller pushing E->W, r - roller pushing W->E, D - door linked to input signal, * - gear linked to disengage on an off signal. One roller powers the other, because they're both 1x1, so they're on/off at the same time.

The R roller, when on, keeps the cart in the 2x2 loop. Once an 'off' signal is received, the rollers turn off and the door closes, the cart passes over 'R' and comes to rest on 'r', stopped by the door. Once the next 'on' signal arrives, the rollers turn back on and the door opens, letting the cart into the next counting cell. Add pressure plates to taste to keep track of where you are in the count, build it circular and send one signal per round to another counter cycle so you can count in multiples etc.

Very fast counters aren't really called for, because pressure plates can only send signals at least 100 steps apart (they'll only accept a new activation signal when the plate has reset and sent an 'off'); although this design, with a long enough primary counter loop, could also count lever activations sent on repeat, with periods down to 10 steps or so.

EDIT:

(cart moves counter-clockwise)
Code: [Select]
╔-╗╗      DRr╗
╔╗╚╝      ╔╗╚╝
╚╚-╝      ╚RrD

Free bonus - this is a binary counter. On each signal pair, the cart moves from one half of the circuit to the other. If you have a pressure plate in one half, you can use that as input for another binary counter. Ten of these can count to 1023.

EDIT2: I'm not sure how to proceed with a counting mechanism not held back by pressure plate delays. You could have a four-wide passage with four pressure plates and count them individually; just have some machine to add the results up somewhere down the line; this would at least avoid the problem of twenty dwarfs crawling over each other and only sending a single signal - this way, you'd get four, maybe even five signals!

You could try to build a sort of waterflow clock: traffic must pass through doors in a one-wide corridor. Above the door, there's a cistern with water (or lava, but that's not so useful for counting citizen traffic) and the tiles on top of the door are tunnelled out, so opening the door lets water flow down. The cistern would need to be regulated to a moderate water depth and should not be pressurised, or you won't get any actual traffic - everyone will be swept off their feet or cancels movement because of dangerous terrain. On both sides of the door, there'd be floor grates letting inflowing water through to another cistern below. Once the cistern there is full enough (measured by pressure plates, probably), it gets drained to a defined level and the counter advanced by one.

I've no idea if this'd be at all feasible. You'd measure amounts of water as a measurement of how long your doors remained open, although i'm not at all certain that the amount of water pouring through would be at all proportional to the length of time the door stayed open. Very fast or slow units would let wildly different amounts of water through anyway, and if anyone dropped an item or crushed a butterfly in the door, it'd remain open for a very, very long time. Not to mention that inflowing water could push units around and maybe even through the grates.

EDIT3: well, you could, by splitting up the traffic routes, spread out traffic enough that one passage would more or less mean one signal and count signals from pressure plates. You could even link all pressure plates to the same counting circuit, as long as the circuit was long enough - counting to 32 or so.

To further separate signals, you could use a 'borg logic' gate:



The bit in the south separates incoming/outgoing traffic into two one-way routes. If you put another hatch-over-a-pit right behind each pressure plate (in the example, only the northwestern plate could be configured like this, hatch would go north of the plate, connected to it), only one unit can pass at a time and the passage will only become available again when the signal has timed out and the pressure plate re-set, closing access hatch, crossing hatch and exit door.

It would not count passage of lightweight and trapavoiding units, but there'd be no counting them apart from waterflow tricks (cf. EDIT2; i have strong doubts if this'd really qualify as 'counting'). If a clump of units converged on a passage, followers can well get dumped down the hatch, with hilarious consequences.

So in sum - use logic gates to separate traffic into single passers, let them send signals via pressure plates, count signals with fluid/minecart/whatever logic (powered minecarts are very quick-reacting and accurate, so that's my recommendation). Problem theoretically solved. Do i get a cookie?
« Last Edit: September 14, 2013, 05:24:54 am by Larix »
Logged