Author Topic: Minecraft Clock  (Read 2161 times)

Offline Cobra951

  • Gold Member
  • *
  • Posts: 8,934
Minecraft Clock
« on: Thursday, August 13, 2015, 05:31:07 PM »
In a conversation in the Rare Replay thread, W7RE showed me how easy it is to upload video from the Xbox One DVR to Youtube.  This is a longterm project of mine, which started in the 360 version of MC.  I was always afraid it would be too much for the 360, so I never went all the way with it.  It involves hundreds of pistons and redstone components.  It's not a new idea, and has been done years ago in the PC version.  The principle involves rotating a "cylinder" of blocks akin to the drum in a music box.  Opaque blocks conduct redstone current while transparent blocks do not.  Each cylinder is programmed with the data required to drive a 7-segment display, and bump the next cylinder when the display rolls over.  The 5th cylinder also drives a "half" digit--a 1 or a blank, so that 10, 11 and 12 can be displayed.  Then the final rollover bit drives the AM/PM flip-flop.  The 7-segment display works because of the shading when blocks in the white wall get retracted by sticky pistons behind it.



I completed it recently, and then added the ability to run either real time or Minecraft time (72x the speed of normal time).  I'm surprised how well it runs.  Running normal time is easy, since each tick of a repeater or redstone torch is 1/10th of a second.  Running at 72x speed was trickier.  Driving the minutes display at the speed of seconds gets it to 60x.  Dropping the clock cycle to 8 ticks from 10 gets it to 75x, which is close.  To go the rest of the way, I had to figure out how to interrupt one clock cycle out of every 25.  That's where this gadget comes in.  (I cut away the floor to show it.)  



The big L-shape of repeaters is a clock running at 1/25th the speed of the main clock.  It sends a pulse to block the output to the display once per 25 main-clock pulses, which is why the display hesitates every so often in MC-time mode.  The main clock is a little thing toward the lower-left, with a gold block, a redstone torch, 2 repeaters, and a redstone wire going off to the right.  The repeater facing down at 90 degrees to the other repeater (center-bottom) is what locks the redstone at the right time.

Anyway, definitely nerd stuff.  Just thought I'd share.  :)

Edit: And of course, I can't leave well-enough alone.  I've been doing a lot to this thing.  I totally revamped the clocks that drive the display.  Now a 1-tick pulse circles forever in a loop of repeaters, and drives the display at the appropriate intervals.  I moved those behind the display mechanism, to their own chunks (a Minecraft term for a 16x16x256 volume where processing is considered "local", and thus faster/better-behaved).  The result was the virtual disappearance of glitches in the digital display.  Yes!  I also added chimes, complete with half the Westminster tune to lead them off each hour.  Haha!  I'm using fireworks and beacons in addition to 6 noteblocks to make them so.  The mechanism for that is those rows of  red and yellow blocks behind the display.  There's a 1-12 counter in front of them made possible by repeater locking.  (Won't get into that here.  It just works.)

Here's a lousy vid of it.  The glitches are in the video, not the machine.


« Last Edit: Wednesday, October 14, 2015, 09:50:37 AM by Cobra951 »

Offline W7RE

  • Post-aholic
  • *****
  • Posts: 2,780
Re: Minecraft Clock
« Reply #1 on: Friday, August 14, 2015, 03:55:58 AM »
You have far more patience than I do. I can't imagine how long this must have taken.

I've tried making complicated switches just for automatically opening/closing doors and such, and given up without finishing. Of course, I've never actually messed with creative mode, so I've always had to deal with material limitations when making something complicated.

Offline Xessive

  • Gold Member
  • *
  • Posts: 9,918
    • XSV @ deviantART
Re: Minecraft Clock
« Reply #2 on: Friday, August 14, 2015, 04:33:14 AM »
It's pretty amazing.

I was taken aback when I first watched some of Cobra's videos in the Xbox One app. I was overwhelmed at first until I grasped the rhythm of his machine.

Offline Cobra951

  • Gold Member
  • *
  • Posts: 8,934
Re: Minecraft Clock
« Reply #3 on: Friday, August 14, 2015, 06:38:40 AM »
Patience?  I suppose.  It was fun.  It sort of takes me back to my college days in EE, where we had to make different circuits using nothing but NAND gates.  ICs were starting to really make a difference in electronics back then.

I was mostly curious about all the different creative contraptions from the beta version of MC on PC that kept popping up on Youtube.  What are the rules of redstone, and how do they combine to make just about anything?  This particular clock mechanism was an eye opener, and I sort of dove into it.  I wanted to work the whole thing out, and then improve on the implementations I'd seen.  I spent more time refining it than building it--minimizing lag and preventing it from ever self-destructing.

The 360 version got as far as a 3-digit counter (0-999).  Afraid of wasting my time because of the older hardware (I don't mind spending it; I hate wasting it), I never took it any further.  On the new system, it really didn't take long to flesh it out the rest of the way.  I had already worked out all the issues.  The 2nd cylinder went from 10 to 12 digits, with 0-5 repeated twice and 2 rollover bits to go along with the zeroes.  The 4th and 5th cylinders have the same design as the 2nd, with the 5th handling 1-12.  AM/PM came last, and that's straight out of something I'd seen before too.  A single piston changes the 'P' to an 'A'.  Haha!

I first messed with it in Survival mode, but didn't get far.  I had mined the materials by then, but it was just too cumbersome to build, and climb around makeshift scaffolding and such.  Creative mode came later to the 360, and that's when I really got into it.  Anyway, thanks for the feedback, guys.  I'm glad you found it worthwhile.

Offline scottws

  • Gold Member
  • *
  • Posts: 6,602
    • Facebook Me
Re: Minecraft Clock
« Reply #4 on: Friday, August 14, 2015, 09:23:57 AM »
I'm never at a loss for amazement when I see what people come up with in MC. Hard to believe the game is like 10 years old and still going strong.

Offline Cobra951

  • Gold Member
  • *
  • Posts: 8,934
Re: Minecraft Clock
« Reply #5 on: Saturday, August 15, 2015, 07:31:15 PM »
The alpha release is 6 years old, according to Wikipedia.  The 360 version came out in 2012, and this was my first experience with it.  It totally hooked me.  I do understand the longterm appeal.

Some of the stuff being done in the PC version now is truly remarkable.  It has a lot more flexibility and power with command blocks.  Who knows if those will ever make it to the console versions.

Offline Quemaqua

  • 古い塩
  • Administrator
  • Forum god
  • *
  • Posts: 16,498
  • パンダは触るな。
    • Bookruptcy
Re: Minecraft Clock
« Reply #6 on: Sunday, August 16, 2015, 12:40:51 PM »
That's super cool, Cobra. I always love seeing this stuff, but I also sort of hate it. Because it makes me feel really, really stupid.

天才的な閃きと平均以下のテクニックやな。 課長有野

Offline Cobra951

  • Gold Member
  • *
  • Posts: 8,934
Re: Minecraft Clock
« Reply #7 on: Monday, August 17, 2015, 03:11:16 PM »
Thanks, man.  I'm sure you could have done it too, if this was something you enjoyed putting a lot of spare time into.  That's most of what it was, really--taking the time to figure out all the little details, and just having fun with it.  I still keep finding things I could have done better.

Offline Quemaqua

  • 古い塩
  • Administrator
  • Forum god
  • *
  • Posts: 16,498
  • パンダは触るな。
    • Bookruptcy
Re: Minecraft Clock
« Reply #8 on: Monday, August 17, 2015, 07:22:39 PM »
Well, only if I understood things remotely related to engineering and math and all that jazz, which I do not. I wish I enjoyed it more and took to it more naturally, believe me. The fact that I don't love that stuff enough to get into programming and such means I'll almost assuredly never have a job in games localization like I really wish I could. I do really well with programming, or at least I should say I got A's in the few classes I took in school (Visual Basic back in 98, and a stupid intro C++ class last year), but it's just not something I enjoy all that much. At least not in a structured environment. Part of me wonders whether or not I shouldn't just start programming on my own and see if I can't learn, but trying to do that on top of investing so much time and energy into Japanese itself just seems like an impossibility. Though programming would almost certainly be more lucrative ... I just don't think I'd want to do it if it wasn't in service to localizing or maybe making games (and the latter job ... yeesh—the market is crowded enough already).

Wow, sorry. Talk about off-topic.

SO YEAH, BOY, LOOK AT THEM MINECRAFTS

No seriously though, how long did it take you to put all that together? I know you're big on tinkering and making stuff that works, like in that one Banjo Kazooie I never got to try ... any plans to do some more stuff like this?

天才的な閃きと平均以下のテクニックやな。 課長有野

Offline Cobra951

  • Gold Member
  • *
  • Posts: 8,934
Re: Minecraft Clock
« Reply #9 on: Wednesday, September 23, 2015, 01:50:32 PM »
Shit.  Sorry, I didn't mean to ignore you.  I've been having a hassle with public links to my image files in my Onedrive public folders (which should NOT expire, but apparently they are, for the latest files--dammit).  So I came in here to try one more time to get the image link to stay put.  We'll see how that goes.  In the process, I saw your post.

This thing took me months of calendar time, tinkering off and on in MC, across 2 consoles.  I couldn't say how many hours went into it, but I'm sure they were many.  It all looks so obvious now, but I had a hell of a time working out the details.  The timing on the pistons has to be exact, or it self-destructs, and there can be no (unintentional) crosstalk between the redstone wiring/components.  This last part can be a headache, because there are a lot of quirks involving what powers what under which circumstances.  Then there are the basic concepts which at first had me scratching my head.  Pulse limiters are the perfect example.  They shorten a long power pulse to 1 or 2 ticks (tenths of a second), and they are crucial to the works.  I tried some ridiculous things at first, like a minecart going around a short loop of track, running over a couple of detector rails.  Each of those would send a pulse to a linked pair of piston banks, one horizontal and one vertical.  That worked, but was extremely awkward and unreliable.  That's when I decided to learn more about the workings of redstone, including proper pulse limiters.  The ones in the video are the double-inverter type (the yellow pairs of blocks behind the piston-powered data drums).  I have since replaced them with popper-type piston limiters.  When a current hits a block on top of a sticky piston, the piston extends, pushing the block up, and breaking the circuit with the block.  That lets a 1-tick pulse get through to the wiring on the other side of the block (that got pushed up).  When the current to the limiter dies, the piston retracts and brings the block back down, ready to work again on the next clock pulse.  That 1-tick pulse is fed first to the vertical piston banks, and then (3 ticks later--delayed by repeaters) to the horizontal piston banks.  This makes the piston banks extend and retract very quickly, at exact intervals, which is key to reliability.  Otherwise, think old mechanical typewriter where you press several keys at once.  :)

Anyway, that went on way into more detail than I intended.  I have no other projects in mind now.  Something will tickle my fancy sooner or later.  The B-K carousel contraption I may be able to show working after the backward compatibility goes live on the XONE.  They screwed it up when they added it to that DLC.  Mine is perfectly balanced.  Theirs wobbles horribly.

Offline Quemaqua

  • 古い塩
  • Administrator
  • Forum god
  • *
  • Posts: 16,498
  • パンダは触るな。
    • Bookruptcy
Re: Minecraft Clock
« Reply #10 on: Wednesday, September 23, 2015, 03:05:17 PM »
Very cool stuff. Would love to see anything else you get up to in this vein.

天才的な閃きと平均以下のテクニックやな。 課長有野

Offline gpw11

  • Gold Member
  • *
  • Posts: 7,180
Re: Minecraft Clock
« Reply #11 on: Wednesday, September 23, 2015, 05:12:34 PM »
This is super interesting and I really wish I had the intelligence and patience to pull something like this off. Great job