This time, my goal was to implement a watch-only demo, because handling user input is costly, and since the instructions are not visible by default on the demo page, one is never sure that the visitors (including the judges) are aware of the controls. Both the subject of the demo and the graphical rendering technique came progressively to my mind, after I started optimizing the rendering of randomly generated 3D voxel octrees. The idea of a mine cart simulation has nothing to do with last year's mini minecraft, even if Minecraft fans have designed some incredible mine cart rides. What they have in common though is that they both try to fit seemingly complex but consistent universes in a small space, with much importance given to details. This is almost obsessive, and I surely would have been a watch maker in other times.
The mine cart idea came with some heavy cinematographic references, which increased the need to produce something as realistic as possible (update: there's also a vintage game I didn't know which uses the same rendering technique). I browsed many of the genre's clichés, keeping some of them (rails, sleepers, stull pieces, turns, slopes, lightbulbs, wooden bridges, stala[ct|gm]ites "what's the difference, Hagrid ?"), while eliminating others (bats, lava, underground lakes, etc.). I had at some point a small particle engine that allowed me to show burning torches and water streams, but its cost was a bit high. To add some story telling to the demo while making use of the last available bytes, I added the eponymous crystals and a few teasing words in the description and the tweets. I like the idea that some aspects of the demo are only discovered if you wait long enough and Math.random() is kind to you, but it was a risky bet, and I'm convinced that many viewers did not wait to see the crystals fly. We'll see that a challenge from the excellent Román Cortés (and some improvements in the compression tools) brought me to improve this in my second and final version.
In the next part, I get technical and describe the tunnel generation algorithm.
Note: the annotated code is available here.