Yesterday evening I submitted 1.23 for Windows Phone and Amazon. All that remains now is waiting.
In the meantime, I’d like pick up what I had to postpone a few days ago and continue to explain briefly how new electric elements work.
Today’s element is a real time clock.
This is a simple device that has 5 outputs and provides you with real time via analog signals.
What is real time? It is the time that passed since you started playing your world. The moment when the ship sails away is the zero point of this clock.
The unique feature of real time clock is that it is always correct. It runs continuously, even if you are far away, and will give you the right time when you come back. If you craft a new real time clock, it will still show time since the ship sailed, no matter when it was constructed. There is no way to reset it. I say “show”, but of course you need other elements connected to the clock to see it. The clock itself just provides electric signals.
On the above picture you can see that there are 4 outputs on all sides of the clock, numbered 1 to 4 (using dots). The final, 5th output is at the back and is accessible when you place the clock on a wire-through-block element.
The clock is setup to increment its value by exactly 4096 each day. That means the clock “ticks” roughly every 0.3 seconds.
Because there are 5 outputs and each has 4 bits, the total size of the counter is 20 bits. It will overflow after 256 days.
Here’s a table showing periods of all 5 outputs. Remember each output is 4 bits.
|1st (top)||0.293s (1/4096 of a game day)|
|2nd (right)||4.69s (1/256 of a game day)|
|3rd (bottom)||75s (1/16 of a game day)|
|4th (left)||1 game day|
|5th (back)||16 game days|
In fact, real time clock is just a giant 20 bits counter with a fixed period of 0.293s. 4th output is useful for counting entire days. 3rd output for determining time of day.