Antisocial

This is it then… my big comeback to the Javascript demo scene after a two year absence, and also the moment when my demo coding muse returned from a long holiday, I guess. Ladies and gentlemen, I give you… Antisocial, a biting satire on social networking phenomena.

Visit the Antisocial microsite…

With my characteristic lack of organisation, I found myself with two weeks to go to the Sundown party, having promised a demo release, and with nothing specific in the pipeline. So, I decided to take a chance and run with an idea that had been sitting on top of my “demos to write when I have more free time than I do right now” pile for the best part of a year. I had it all planned out in my head, right down to the soundtrack: a mysterious track from an unlabelled CD I picked up at a ZX Spectrum Orchestra gig in 2005 (which turned out to be Round, from their Clive Live^3 EP). A quick bit of permission-getting later, and I was at the point of no return.

I knew it would be an ambitious job, and a bit of a leap artistically and technically from my usual stuff. I pencilled in a rough project plan in my diary. I drew up storyboards. I read up on the maths that was too nasty to contemplate on previous projects. And shockingly enough, I actually enjoyed all of the above.


As it happens, browser technology (as far as the <canvas> element goes at least) has not moved on one jot in the last two years, so I was able to dust off the Canvastastic codebase and found it still pleasantly usable and not too affected by code rot. I gave it a slightly more OpenGL-ish API (within the limitations of my “someone at the pub described it to me once” knowledge of OpenGL) and patched up the more glaring omissions (like Z-plane clipping, so that you can have polygons going behind the camera. Proper frustum clipping would have been a better idea, so that I didn’t end up with it trying to plot 20000×40000 pixel triangles and sending Windows into a stroboscopic flashing fit and having to hack up a fix after the party. Macs are fine with it…).

The demo code was only half the job though; to handle the camera paths and synchronisation and the million other details where hard-coding wouldn’t cut it this time, I joined the big league of the demoscene by building a demo tool (still all in Javascript) that probably only I can understand. (It’s included in the final release, so have a play. I dare you.) As I didn’t have any meaningful experience in 3dMAX, or Flash, or Werkkzeug, or Quartz Composer, or any of the other things I really ought to have been using as reference points, it was a grand exercise in Making It Up As I Went Along. I’d almost forgotten how much fun it is to code that way, but naturally a fair few bad decisions came out of that as well. Firstly, it turns out that organising things around a timeline interface doesn’t really fit all that well; it means that every object and event is treated as independent of everything else, so things get a bit clunky when they have to share resources (such as lots of camera shots of the same scene). Looks like you can’t beat the good old boxes-and-arrows-all-over-the-place approach.

Secondly, and what probably comes as no surprise to anyone but me – Javascript is a bit horrible for building demo tools in. The demo itself, no problem – but for the user interface widgets I found myself constantly wishing for nice, sensible class-based inheritance. Yep, I know the language boffins will say that prototype-based OOP is more powerful, but I guess I’ve just had my mind addled by programming in the real world. I know of a few attempts to graft class-like behaviour onto Javascript, and that should probably be at the heart of any attempted rewrite of this. Alternatively, there’s a growing-but-not-quite-there-yet buzz around alternative scripting languages in the browser (just like there’s a buzz in the opposite direction for server-side Javascript), so perhaps it wouldn’t be out of the question to have a browser demo tool written in Ruby or Python. Or have the browser environment embedded in a ruby/python desktop app – at which point, why stop at browser demos? Could it be designed as a more general tool, where the browser is just one of many platforms that can be swapped in? It’s tempting. Onward and upward!

9 Responses to “Antisocial”

  1. rc55 says:

    The site no worky for me! :S

  2. matt says:

    Up again now (for the moment at least)… stupid falling-over apache server. Server, meet blogosphere…

  3. Tom says:

    Antisocial is phenomenal, mind-blowing, awe-inspiring…

    Re alternative scripting languages in the browser, have you seen pyv8? http://www.advogato.org/article/985.html

  4. Ville says:

    Ha ha, great work! Both the demo and the tool.

  5. Paul says:

    Well I’m for one can’t believe it! Very very impressive. Plus the nfo file was quite funny.

    P

  6. Ronald says:

    Yo! Very nice.

    Is it wrong that I was excited throughout, expecting to find out where the fourth circle of Venn diagram would go :S

    Ronald

  7. I’m afraid your demo doesn’t work for me; it practically murders my system (Firefox 3 on Ubuntu 8.10) and I get about 1 frame/minute.

    Shame since your other material is so good and I expect this would be too.

  8. SamuraiJack says:

    Very cool works, my respect..

    Hey, for “sensible class-based inheritance”, and much more check this project:

    http://code.google.com/p/joose-js/

    especially the mutability branch:
    http://joose-js.googlecode.com/svn/branches/mutability/doc/html/Joose/Manual.html

    Sample code:
    http://github.com/SamuraiJack/test.run/tree/master

    All the best, Nickolay

  9. Chris says:

    Hi gasman, nice satire. little pitty zx spectrum orchestra is out off the picture by now(2015) , nice to see you did some with them.. i am still amazed what some people do with eg the zx spectrum (eg mqm-6rmx ‘honey honey’ i dont believe my ears)

    Keep up the good work and ALWAYS be more stubborn then yr computer
    ps i like wav2ay and mailed karl with a fuzzy idear for ‘tri-tone sample’ player, BUT i cant code/invent the recorder !!
    Would ‘frere jacob’ sound as good as ‘honey-honey from ABBA in Zx?

Leave a Reply