Archive for September, 2010

Fake Plastic Cubes

Monday, September 13th, 2010

It was internally nagging me all summer that I ought to release something at Sundown, but apart from some brief excitement around a brainwave I had involving three iPhones, Javascript and some cardboard (which sadly didn’t work out in practice), it didn’t really amount to much. Then Evoke happened, and inspired me to decide that, in the words of Haujobb’s invitation, I should make a demo.

Or, to be precise, a Javascript 64K intro. Unfortunately, there was only one week to Sundown by that point, and in a classic case of demoscene project management fail, I spent most of that week building an audio framework, leaving about 24 hours to write the actual demo. The end result is 9K of rather-flaky-performing code, hastily improvised plinky ambient music, and dreadful coder art (except to the extent that I’ve ripped it off from Fairlight demos).

Still, even if the execution this time didn’t work out, I think it’s been a worthwhile exercise in bringing pieces together. Jacob Seidelin’s PNG compression hack (where JS code is stored in a PNG image to take advantage of the compression, then unpacked on a canvas using getImageData) has created a bit of a buzz in the JS development world, but this is the first time it’s been used in an actual demoscene production (which is surprising, given how the demoscene is the spiritual home of size-coding hacks). Ben Firshman’s JSNES has been dynamically generating audio for some time now, ardently chasing the moving target that is Mozilla’s Audio Data API (with a trusty Flash snippet as a fallback), and Mathieu ‘p01′ Henri was experimenting with softsynths long before then. Not even my own code is safe from this cherry-picking exercise of doom – the 3D routines are a mishmash of Gallions Reach / Canvastastic (for the lighting model) and Antisocial (for the full scene / movable camera handling). Finally, node.js makes a cameo appearance, because having an actual web server on hand makes development go a lot smoother.

Put them all together and you have the ingredients for a delicious 64K Intro cake. This time it came out a bit half-baked, but I’m passing on the recipe in the hope that someone else can make it work: