The Castle Doctrine Forums

Discuss the massively-multiplayer home defense game.

You are not logged in.

#1 2014-02-19 16:35:50

Mortalfiend
Member
Registered: 2014-02-19
Posts: 17

Easiest/most compact way to make a counter?

I don't need a clock because I don't want a "square wave".  I want certain traps to activate after 70 moves.  Would the easiest way be to just stack a load of delay gates until I have the desired timing?  Thanks for any suggestions in advance!

Offline

#2 2014-02-19 16:44:53

Mortalfiend
Member
Registered: 2014-02-19
Posts: 17

Re: Easiest/most compact way to make a counter?

Well now I've just read about the cycle limit so I assume it wont be possible to stack that many delay gates and have the desired effect.  So I suppose I would need to use a clock?

Offline

#3 2014-02-19 17:02:24

iceman
Member
Registered: 2013-11-09
Posts: 687
Website

Re: Easiest/most compact way to make a counter?

All the discussion about clock cycles is more on an in-between step basis.  For stuff over several steps like you want, clocks are the only way (well, at least the most efficient way).

The closest (simple) method for what you will give you 64 (well, 63) steps.  Since each 64 = 2^6, and each clock counter takes twice as long as the counter before it to change, you'll want 6 counters.  Probably the best is to use this threadas a basis.  Since there's only 5 counters there, you'll need one more.  To make everything stay "stuck" after 63 steps, add a "latch" to the final counter.

The end result will look something like this:
http://castledraft.com/editor/lMxtx5

You can squeeze that in closer - I just wanted to make sure you could see the different parts.  The thing sticking out of the bottom is the "latch" - if it receives power once, it keeps power for the rest of the robbery.


Fortress Theory Mod - New objects, tools, and paintings!

I keep dying of a natural cause - Stupidity
The biggest thing that Castle Doctrine has taught me is that the price of your house is proportional to the stupidity of the mistake that kills you.

Offline

#4 2014-02-19 17:18:14

Mortalfiend
Member
Registered: 2014-02-19
Posts: 17

Re: Easiest/most compact way to make a counter?

Thanks for the help that makes sense.  I could then just add delay gates to the latch to add a few steps to that, correct?

Offline

#5 2014-02-19 17:22:06

Mortalfiend
Member
Registered: 2014-02-19
Posts: 17

Re: Easiest/most compact way to make a counter?

Offline

#6 2014-02-19 17:23:00

iceman
Member
Registered: 2013-11-09
Posts: 687
Website

Re: Easiest/most compact way to make a counter?

What do you mean by delay gates?  Things like power switches only delay something for 1 *clock* step, of which there are 32 in a normal step.  The best way I can think of to add a few more steps to that is to add a whole new clock, that only starts when the previous clock powered the latch, but that will take up even more space.  Is it really that vital to have exactly 70 steps?


Fortress Theory Mod - New objects, tools, and paintings!

I keep dying of a natural cause - Stupidity
The biggest thing that Castle Doctrine has taught me is that the price of your house is proportional to the stupidity of the mistake that kills you.

Offline

#7 2014-02-19 17:26:11

Mortalfiend
Member
Registered: 2014-02-19
Posts: 17

Re: Easiest/most compact way to make a counter?

Ohhh.  I see what you were saying.  I misinterpreted something from the wiki.  Very well.  No, it's not that important, I'm just trying to get a better understanding of how the electronics work here

EDIT: Thanks again for your help(and patience!)

Last edited by Mortalfiend (2014-02-19 17:27:24)

Offline

#8 2014-02-19 17:35:25

colorfusion
Member
Registered: 2013-04-02
Posts: 537

Re: Easiest/most compact way to make a counter?

iceman wrote:

What do you mean by delay gates?  Things like power switches only delay something for 1 *clock* step, of which there are 32 in a normal step.  The best way I can think of to add a few more steps to that is to add a whole new clock, that only starts when the previous clock powered the latch, but that will take up even more space.  Is it really that vital to have exactly 70 steps?

Or add another counter bit, and run a wire underneath with voltage switches to detect when it has counted to exactly 70.

Also it should be noted that even if you have 32 "delay circuits" it will not add up to one full step. Currently it breaks electricity everywhere in the house, next version that'll be fixed but it still won't add up to a full step.

Last edited by colorfusion (2014-02-19 18:30:22)

Offline

#9 2014-02-19 18:09:48

Mortalfiend
Member
Registered: 2014-02-19
Posts: 17

Re: Easiest/most compact way to make a counter?

Yes I've just caught up in the current thread about wireless propagation and that also helped me understand.  There was somewhere in the text where my eyes crossed or something and I ended up associating a 'cycle' with everything that happens in a single robber's step.

Offline

#10 2014-02-19 18:43:20

joshwithguitar
Member
Registered: 2013-07-28
Posts: 538

Re: Easiest/most compact way to make a counter?

I'm pretty sure this will achieve what you want:
http://castledraft.com/editor/wYBwj7

The bit-storage unit at the end will power after 70 moves (71 iterations of the clock as it ticks once when you first enter). The final counter bit is smaller as it doesn't have to switch itself off again and after that we have bit storage to indicate that it has passed 64 turns. It will then pass power though when the first 3 bits are on (1+2+4 = 7 turns later).

Offline

#11 2014-02-19 18:52:08

Mortalfiend
Member
Registered: 2014-02-19
Posts: 17

Re: Easiest/most compact way to make a counter?

Thanks that is a clever solution!

Offline

Board footer

Powered by FluxBB 1.5.8