Astro Wars

My Astro Wars project has a bit of an odd heritage, starting as it did in an Oxfam charity shop window.

I happened to spot an original Astro Wars game on display on my way to work one day. I recognised it with a certain fondness because I had one when I was a teenager back in the 80s.

Naturally the shop was closed when I passed by in the morning and evening, so after a couple of days looking in on it I decided to pop in on Saturday morning and buy it. But by Saturday it had gone.

Rather than track down another original vintage Astro Wars, I pondered re-writing the game myself, and then I figured that if these things were still out there, perhaps there’d be a broken one on Ebay that I could gut and replace the innards with some new hardware, and of course my own game code.

This lined up nicely with the point to which I’d got my Elite Arcade game – most of the core mechanics were working and I was about ready to begin extracting those out into a stand-alone game engine, and Astro Wars would be a nice, simple and lightweight game to use as a testbed for the engine.

So where to start? Finding a broken example of the Astro Wars hardware hadn’t taken long at all. The example I bought was a second generation version, with Astro Wars text printed in white across the top of the screen, as opposed to the earlier model which ran the text in red. That was in a pretty clean condition, at least on the outside and, as advertised, was completely dead. It had obviously had batteries left in it for far too long, probably when the electronics died.  It was covered in the brown battery goo that sticks to everything when alkaline batteries expire and are left to decompose.

I also bought a Raspberry Pi Zero W, a small colour screen, and a Pi Hat Arcade interface board to handle the connections between the joystick and buttons and the game code. I ran through a quick test-fit, and decided that those components would be good enough. At this stage I had a wireless keyboard connected to the Pi and got it running my Elite Arcade game, just to get a sense of how it’d look and feel when properly integrated.

And so, with the hardware pretty much settled, and after a few weeks of effort to extract Eccentric Engine from the Elite Arcade code, I set about prepping the Astro Wars project.

What I really wanted from this was an accurate reproduction of the original game, in terms of visuals, animation and sounds. Which is when I realised that I couldn’t describe the game’s look and feel or level progression and scoring accurately from memory. I’d need a working example from which to draw my references.

So I bought another one, this time in full working order. Actually, the first of the “working” ones sadly turned out to be DOA, so that had to go back to its Ebay seller, but the second was all good. And for the first time in about 35 years, I played Astro Wars and so very nearly clocked it, but the pressure beat me and I ended up a couple of hundred points short of the magic 1999 winning score.

Anyway, I made copious notes about the game’s mechanics, level progressions, alien movements, the bonus phase and so on. I also recorded videos so that I could step through frame by frame to work out whether the aliens passed behind one another or not, how the display behaved when a significant event occurred etc.

I also scanned the original VFD display that I cut out of the broken hardware so I could see what the layout of the display was like, and how to recreate the aliens, earth ship and command ships, explosion effects and missiles.

With all this information on hand, and a new sense of appreciation for what the game’s original designers had achieved, I set about writing my own version.

Of course I made it much more complex than it really needed to be because I was testing and tweaking the capabilities of the Eccentric Engine code at the same time as creating the new game code. Even now, I look back into parts of it from time to time and have to refresh my own memory of how some parts work and that’s definitely not an indicator of well-structured code!

But I am reasonably happy with the way the game elements move on screen, honouring the strict grid layout of the hardware-bound original. At the time of writing this, the graphics are still only rough placeholders and the sounds are simple beeps until I find a waveform editor with which to recreate the unpleasantly harsh sounds of the original.

It turns out that even when it comes to yet another Space Invaders clone, game dev can be quite tricky.

If you want to try the game out, the latest build is generally available at my github.io astro wars page. And the source code is naturally available directly from github. If you do go and play it, bear in mind that it was written to run on a five inch screen, not whatever monster resolution your current tech may provide. And it’s still picky with some browsers, but Chrome seems to be the most forgiving.