How Co-Axis works – part 1

This “how it works” is a little different to previous installments because, rather than covering something released recently, I’m going to burble on about Co-Axis, the program I tend to describe as my first proper game. And since I wanted to at least try to remember the story around the creation (my memory being so bad means there’s bound to be some holes) as well as where the inspiration for the backgrounds, enemies, level names and so on originated from.

What I’ve ended up writing ended up too big for a single post, so this is the first half and the second should arrive soon afterwards.

The programming for what would eventually become Co-Axis started whilst I was still at school at some point around the beginning of 1986. Hyperzap was a teensy little vertical shoot ’em up which slung fast-moving but stupid aliens with bow ties (drawn by my co-conspirator Simon Probert, bow ties were cool even then) down the screen at the player.

It was written on a tape-based C64 using the Zeus 64 assembler and complete rubbish as a game! The enemies move incredibly fast but, rather than rewrite the game to slow them down, I tried to paper over that design flaw by allowing the player to temporarily pause the action by holding up on the joystick. That said, primitive as it is, Hyperzap still stands as my first released game since it was uploaded to Compunet by a school friend called Philip Chan and, after a dalliance with Hyperzap 2 (which was lost during a disk failure at another friend’s house after a Saturday’s worth of coding) it began to evolve into something more substantial.

The next phase of that evolution was Orbyt, which was planned to be a fixed speed horizontally scrolling shoot ’em up but without the shooting; the player had a satellite spinning around their craft to wield as a weapon rather like a mace, meaning they needed to get up close and personal with the nasties. Only the basics were done to test the control system before the “design” was changed to add bi-directional scrolling; that version of the code became Protocol, which actually went through a couple of iterations (the earliest one with my own graphics is simpler than the preview online and most likely lost to the mists of time) and was met with remarkable indifference from the publishers Sime and I approached, mainly because they wanted regular guns added which we felt went against what we were trying to do.

So I decided to try doing a “traditional” scrolling shooter since that’s what the publishers said they wanted and, after reverting to the Orbyt source code (since it was geared for fixed speed scrolling), that’s where the project eventually called Co-Axis comes in. And the first step is to add some scrolling backgrounds, but how do you compress somewhere around 50K of level data into a single load but leave space for everything else? The answer is tile compression but in the days before the internet a lone coder had no way to find that out (Andrew Braybrook’s Paradroid diary in Zzap! 64 covered the basic ideas) so snotty-nosed coders like myself were left to make things up as we went along.

Co-Axis ended up using what is essentially a tile-based system but one where the tiles themselves are just a single character wide and the entire play area tall. Since there were no tools for this scheme, an editor was cobbled together for the chunks of level data (each stage is exactly 256 bytes or around six and a half screens wide) whilst the 256 by 20 byte tile map was constructed with an existing tool built originally for Protocol.

At this point I was still coding on tape but had purchased a second hand Expert cartridge which was used for debugging code, recovering from crashes and most importantly of all saving and loading data for those bespoke editors since they didn’t have any I/O support! The Expert was also used at the end of a day to “freeze” the current state of development, dumping the entire contents of the C64 memory out to tape so that I could pick it up simply by reloading the frozen file.

The actual construction of Co-Axis was somewhat erratic; the program itself was spread out over six source files, two for the main game and background scroller, a further three for titles, game over and completion screens and one block of linking code which tied everything together. This fractured nature meant that it was spread out around memory and something of a pain to assemble or debug, even with the Expert!

Co-Axis was also a learning experience and quite a bit of it is basically me seeing something interesting elsewhere, trying to replicate it and then bolting in the results. If something worked it would stay in even if a better solution was stumbled upon later, which is why the bizarre software-based sprite to background collision coexists with the hardware-powered sprite to sprite collision that was already working from Orbyt. The game’s graphics all run from bank 0 ($0000 to $3fff) with everything being handled with a single character set because I’d picked up just enough to get that working and hadn’t needed anything more.

The final release version is a bit more of a mess internally for a couple of other reasons; near the end of development after Hamish Parker had kindly leant me his 1571 disk drive to work with, the main game’s source code was lost when an otherwise reliable Banana branded 5.25″ floppy disk failed without warning; Matthew Young did his best to recover it for me but it wasn’t complete. That taught me a very important lesson about backing up work files, as well as a few things about how to debug target code with a monitor since the final patches were done that way.

The Co-Axis soundtrack came courtesy of Marc Francois and Nia Trinh – founding members of both Cosine and its music offshoot Sonix Systems – and was composed with the budget music editor Ubik’s Musik from Firebird. The earlier versions contained sound effects by myself that didn’t make it into the final game, which is probably for the best because the firing sound was a tad “screechy”.

In the second installment I’ll be going through all the levels to see how much I can remember from over a quarter of a century ago.

2 thoughts on “How Co-Axis works – part 1

  1. Great post, in a different sort of way! I love stuff like this; I still re-read the programmer diaries in ZZAP! now and again. Interesting to read about how you were learning as you went along.

  2. Those diaries were a serious influence on me as well, large chunks of theory came from them (and my want to build a cross assembly rig after reading the Morpheus diary) so I suspect that the Paradroid diary was indirectly responsible for the odd 1×20 tile system in Co-Axis.

    And I’m glad that you and others who saw the link on Facebook are enjoying this because I was a little worried about putting up something so narcissistic! =-) What’s really surprising to me is that I’ve been playing Co-Axis a lot recently to write about it and really got into it… in more ways than one!

    The second instalment will be along over the weekend – it’s pretty much written but needs a few tweaks here and there.

Leave a Reply

Your email address will not be published. Required fields are marked *