For reasons unknown to me, I have found myself this year posessed of a much-improved capacity to write code. I always spend a few weeks out of every year trying to improve that faculty, but the gains in ability tend to be quite small, and the resultant programs tend to be of fleeting utility. This year, however, while the latter clause will likely remain true, the former, as a trend, seems to have been temporarily bucked.
In addition to minor improvements to this site's message board (now blog) scripts, and my usual tomfoolery with HTML/CSS/JavaScript, I have written a peculiar interactive MIDI console sequencer in Perl; a graphical, modular MIDI step-sequencer and generative music device in Squeak; a primitive (and abortive) paint application, also in Squeak; and an implementation of Asteroids in VRML/Javascript. That last one is the one we'll concern ourselves with for the moment.
Last year, I put about a week into working on a 3D play-alike of the game Juno First (under the higly satisfying name Ronju Fist). I didn't finish it, and the reasons were these: 1) my infatuation with the game, Juno First, fizzled; 2) faith in my program design and coding skills faltered and, ultimately, failed; 3) I began to seriously doubt the suitability of my chosen platform (VRML/JavaScript) for the task then at-hand -- the execution and distribution of a video game. While my fickleness with regards to video games, as well as my chronic self-doubt are matters beyond earthly control, the third consideration is something I could approach with a modicum of logic, and my reasoning on the matter was thus:
VRML and Javascript are two technologies I'm familiar with. I've been tinkering with them for, literally (and quite surprisingly) about a decade. This familiarity made them instantly attractive to me for the project. In addition, the technologies are web-oriented, facilitating easy distribution of the game once complete. Also, they are platform-neutral, so any VRML/Javascript game would be equally accessible to Windows, Mac, or *Nix users. Lastly, VRML and JavaScript (ECMAscript, really) are standards (ISO, and ECMA, respectively) and I hang onto a naive idealism about the importance of standards-based approaches to software solutions (sounding, now, like a makerting stooge for Sun Microsystems or something).
That was the positivist thinking that got me started on making the game in VRML, but the whole time I was acutely aware of my own dangerously high bullshit level. The fact is, standards are only as good as their implementations, and there are no implementations of VRML/Javascript that meet all of my expectations. For the game I would need keyboard control, a facility that is absent from the VRML97 standard (though present in X3D, but that's another blog entry) which means that I would be relying on an implementation-specific extension to get the job done, and no two implementations are alike in their keyboard-support features. That alone destroys the illusion of cross-platform accessibility. On top of that, I had performance concerns as VRML/JavaScript is a very high-level approach to 3D, meaning lots of overhead would be incurred for a relatively little bit of code. Those performance concerns played out before my eyes as I started putting the game together and met difficulty getting the thing to run above 30fps (on a gigahertz system, though I was quick to explain this away with my assumed inability to write fast code). Aggrivated by the issue of poor performance was the tendency for the browsers I was working with to drop keyboard events during game-play (a totally unacceptable circumstance for game applications). And lastly, I was put-out by the recent practice of the leading VRML browser vendors of prominently displaying their corporate logos in the lower-right corner of the content window. That could be resolved by paying a modest (ha!) registration fee, of course, but I'm a cheapskate. And broke.
So, when the desire came 'round this last week to make an implementation of Asteroids with subtle 3-D enhancements, what did I choose as my platform? Yes! VRML/Javascript!
The overriding factor, obviously, was familiarity. I wanted something I could jump into immdiately and get a working game going, and that's exactly what I did. Faced again with the issue of poor performance, this time around I invested great effort in streamlining my Javascript as much as possible, to get all the extra few frames-per-second I could manage. I'm surprised to say, I think I did a very good job.
So where's the link to play the game? Well, it isn't done yet. This is sort-of a look-what-I've-been-up-to post more than anything else. I'm at a stopping point in development right now because I'm trying to decide whether I want to keep working on this as a VRML project, or whether I need to knuckle-down and educate myself in a more robust development environment. I'm leaning toward the second option. What I've come away from this last week with is a cautious confidence in my ability to put a game together well -- something I've not had before. So, I wouldn't hold your breath or anything, but I think an Apocalyptek version of Asteroids may well be in the works. Perhaps I can plan for a release sometime next year, coincident with Asteroids' (as well as my) 30th anniversary. We shall see.
(-respond-)