Computers in computers - Camera Obscura Adder
March 17th, 2013It's always fun to see people building computer-like circuits in games like Minecraft and Dwarf Fortress. While it's outlandishly impractical to build computers in computers, it's just so much fun and so educational. Well, today I figured out how to do it in the Camera Obscura engine using moving platforms and I was irrationally excited about it, so I built a four-bit adder circuit. It adds two four-bit numbers together and show the results. Check it out:
You can download the level here.
Boring details on how this works: there are several very small sets of logic gates, the basic building blocks of electronic chips, that can be provably used to create every other possible logic gate (trivia: NAND gates alone are sufficient, as are NOR gates). Camera Obscura's mechanics are capable of creating two gates: OR, by simply linking multiple sources to the same moving platform, and NOT (at least as far as I've discovered). Fortunately these two gates together are sufficient. Information can propagate through the system because moving platforms can press buttons that trigger other platforms...and so forth.
This possibility also provides some pseudo-scripting functionality to game levels. Imagine a passcode-protected vault that only opens when you enter the right number, or even a game of Mastermind within the level.