How RG Rampage works

RG Rampage is a platform-based collect ’em up which was put together over a couple of weeks for issue 100 of Retro Gamer magazine, where it appeared as a type-in listing. And, at least according to the changelog kept in the game’s original source file, the final build was on the 11th of January 2012 which was a day over six years ago and that doesn’t make me feel old and decrepit in the slightest! So let’s take a look at what’s going on “under the hood” – a more human-readable version of the source code and some work files have been pushed up to GitHub – in order keep the game under 3.9K uncompressed.

Most of the savings come from the graphics which are optimised in a couple of ways to keep the overall size down; the character set is just cloned from the C64’s ROM whilst skipping the third byte of each character to make it look different, whilst the platform tiles – sixteen characters in total with one more for the titles scroller – are copied into that same 2K block of character RAM. Similarly, any object which can point in either direction like the player or some of the drones is actually stored just the once in the sprite data where it’s looking to the right, with the flipped version being generated on starting up.

Another place where things are reasonably compact is the level data; each platform uses five bytes for X and Y start position, character pair, colour and width and an entire screen only needs about a hundred bytes in total when adding the player start position, enemy patrol data – basically just another five bytes per nasty saying which object to use and giving two sets of X and Y positions to track back and forth between – and a stream of coordinates for the pick-up items. The level layouts were rather arduously worked out on printed sheets because getting a bespoke editor done would’ve taken too long.

I couldn’t include music because it would’ve added too much to the program’s length, so my (t)rusty “Roundasound” engine was dragged out of storage and given a bit of a dusting down; this is pretty much the same routine which was used for Quota by Chris Young and, with some modifications from Sean Connolly, in Flair Software’s Turn ‘N’ Burn so if anyone fancies a laugh they can have a prod through the source code for that. The routine is almost painfully primitive looking back and there’s a far better version now which is the base of my Atari 8-bit sound routine too, but it was compact and did the job.

The final “trick” was creating a BASIC listing for publication which, to keep the chance of errors sneaking in to a minimum, was handled by a truly hacky piece of BlitzMax code that yanked the assembled binary file in, generated a simple checksum by adding all the bytes together and then wrote out a text file containing the game as DATA statements and a small BASIC program with a FOR/NEXT loop which the code out to memory. That text file could then be tested by copy/pasting the contents into a freshly-loaded emulator and, when everything was deemed complete, sent off for publishing.

When Darran asked me to produce a type-in for issue 100 it seemed like a fun thing to try programming but I honestly didn’t expect anybody to actually type it in! There were a few brave souls who surprised me though and, judging by the feedback, they seemed to enjoy the experience of playing it as well. Going back to RG Rampage this afternoon for the first time in a couple of years to grab screenshots, I can’t help feeling with the advantage of hindsight that the balancing was a little off – almost certainly due to the dash for the finishing line – but it still feels fun to play.

How Co-Axis works – part 2

Continuing where we left off previously with the meandering through Co-Axis, there are a worryingly large number of references and homages in there to document. So lets pootle level by level through the entire game to cover as much as I can remember over a quarter of a century on.

Level 0 – Here Goes Nothing
This is meant as a “welcome” to the game. I had to do a little research to remember that the nasties were based on a sprite animation from Hugh Binns’ Subterranea and I think the backgrounds were meant to be either clouds or possibly stone blocks but I just wasn’t good enough artist an to draw that! The C64 conversion of Nemesis was the visual cue for the player’s spaceship (which received a positive response from C64 legend Paul “Dokk” Docherty at a computer show despite my teenage self extracting urine over his Flying Shark loading screen) and the explosions were based on Sanxion by Stavros Fasoulas.

Level 1 – Blue Monday
This name mostly comes from the level itself being blue but was also because New Order’s track was popular at the time even if my own exposure was limited to the various C64 covers doing the rounds rather than the original. On the graphics front, the backgrounds borrow liberally from Sanxion and the aliens were inspired by the blinking robotic eyes in Jeff Minter’s demo DNA.

Level 2 – An Old Favourite
This name is a reference to the level being filled with Asteroids really, although it probably shares more genetic material with those “dodge the background” games written in BASIC that use the PRINT command for vertical scrolling. The titular rocks are an attempt at rendering a particular element from Sensible Software’s excellent Wizball and the attackers are similarly my go at copying one of the sprites from Denarius by Software Creations.

Level 3 – Faulty Plumbing
The pipes are something I liked from the later levels of Wizball and to a degree Subterranea, but the enemies… well, I’m fairly sure they’re based on one of the nasties from Stavros Fasoulas’ second game Delta but there are a few other possibles as well. We’ll call the title another pun for want of a better word.

Level 4 – Getting The Point
Speaking of puns, this is an incredibly weak one even by my “standards” and those spikes were a similarly poor rendering of an idea from either Subterranea or possibly a later stage of Wizball. I forget where the nasties came from, but Subterranea has a rotating shield for the player’s ship and that would be the most likely origin.

Level 5 – Babylon And On
Another musical reference, this time it’s the title of a Squeeze album from the 1980’s which featured a track with the same name. The rather poorly-drawn pyramids which originally lead to that title being chosen were loosely based on the ones in the Atari 8-bit version of Jeff Minter’s Attack Of The Mutant Camels and, looking back at them now, those bubbles (which are a cross between the crystalline ones in Zybex and the animation of the colour droplets in Wizball before they’re shot) really should’ve been in “Faulty Plumbing”, shouldn’t they…?

Level 6 – Late Night Re-run
A reference to the then new late night television services being run by ITV; before the cross-network services like Night Network and similar started with their 2am showings of classics like Adam West Batman or Randal And Hopkirk (Deceased), the ITV stations would actually close down and go off air for the night! The name is also a reference to recycling the asteroid from “An Old Favourite” with a darker blue colour scheme and this time the adversary is a painfully bad attempt at doing something like one of the spinning ring enemies from Bob Stevenson and Doug Hare’s awesome Io.

Level 7 – The Second City
This level went back to the Sanxion-inspired towers which were accompanied by a terrible rotating “spaceship” that must have been inspired by something but the only possible that springs to mind is the far better animated turning yellow ship in Wizball! The name comes from the expansion pack for Paul Woakes’ wireframe epic Mercenary which burnt a lot of Atari 800XL processor cycles during the coding of Co-Axis.

Level 8 – Willow Farm
I was into the earlier works of prog rockers Genesis and in particular an album called Foxtrot which contained a vast piece called Supper’s Ready that in turn had a segment called Willow Farm – the second-hand tape I had of that album took a serious beating during the development of Co-Axis. This name was chosen because of the “weird” nature of the level; the strange bouncing ball nasties weren’t directly inspired by budget blaster Zybex but at least borrowed some ideas, whilst the backgrounds were yet another go at copying Wizball.

Level 9 – The Final Countdown
“We’re leaving together, but still its farewell”. I’ve always thought myself to only be something of a casual music fan but it does seem to have been a major influence. This time it was courtesy of Europe’s biggest hit which friends and I would occasionally “sing” as The Final Cartridge… geeks, eh? The level itself is a mish-mash of elements from all of the other stages and the sprites are based on an animation from an old Compunet demo by the Harlow Cracking Service called Planet Invasion which, along with the character-based starfield from Delta, was what shaped the Co-Axis completion screen.

Other References And Inspirations
The cheat code is another musical reference; The Secret Garden (entered on the title screen) which was one of my favourite tracks from T’Pau’s album Rage. Bigtime Software took its name from Big Time Television, the fictional pirate broadcaster from the original Max Headroom: 20 Minutes Into The Future because, for reasons I’ll probably never get back to understanding, we decided at the time that the name of Blank Reg’s bright pink bus and the television station it contained was similar to how myself (under my school nickname “Bada” which was apparently due to me talking too quickly and sounding like Tony Hart’s Plasticine sideckick Morph), Alan Jesse and Jason Morrell were trying to write games.

The idea for the titles logo came from a Papillons intro, the colour wash effects on the status bar and game over screen were based on the ones in Kele Line’s Tiger Mission and the idea for the two large double scrollers of the latter fell off the back of a lorry having previously been “procured” from Knuckle Busters by Mat Sneape (anyone who has played Edge Grinder will no doubt realise that I have very little shame since it takes a second bite at that particular cherry).

The titles page greetings are something of a stream of consciousness compared to the “organised” list we use in Cosine now (and yes, that was quite heavy sarcasm) so, after the hellos to people who were influential in Co-Axis‘ creation such as Chris, Matthew and David Young, Alan Jesse, Jason Morrell, Marc Francois and Nia Trinh, there was Steve Chambers (his first name was actually Karl but he didn’t mention it for a few years). Jim (Wynn), Chris (Powley) and Sid (Santer) were computer studies teachers at the Geoffrey Chaucer school whilst Alison (Wells, formerly Barnes and her initials were AEB, which was noted by the C64 gamers who played Uridium since those were Andrew Braybrook’s initials) was part of the history department. The rest of the names were classmates with poor Steve getting more flak about fancying “Genavive” (my bad on the spelling) when it was probably me who fancied her more but was far too immature to actually do anything about it.

Anyway, putting unrequited love aside (and the missing greeting to Hamish Parker, shown below in the W.A.R-inspired font from the preview that RTI released – I think we may have temporarily fallen out), why wasn’t Co-Axis released? Well, I don’t think it could be called “well received” since the only response to the half a dozen or so disks sent out to budget software houses was the one that Alternative Software returned with a huge shoeprint on it (which said far more than the enclosed stock letter) but there was also the issue of that Rough Trade Inc release; I’m still not certain how the preview was leaked, but after it appeared the teenage me couldn’t see the point in trying to flog a game that was already close to complete and “in the wild” despite having upgraded chunks of the code in the meantime.

There are obviously going to be lots of things that could have been done better or at least differently, but Co-Axis was at least a completed project even though I went around several streets worth of houses to get there. I learnt a lot from writing that code and recently rekindled my fondness for it whilst playing through again for these posts. And at this point in the original draft of this post I mumbled something about possibly taking Co-Axis, dragging it kicking and screaming through a cross assembler and giving it an overhaul, but… well, that sort of accidentally happened between the previous post and this one courtesy of Nostalgia’s truly amazing cross disassembler Regenerator:

This is currently called Co-Axis RX (which I quite like so it’ll probably “stick”) and, along with some fairly major internal surgery and a few cosmetic tweaks (the bubbles from “Babylon And On” have finally been swapped with the enemies from “Faulty Plumbing”), the most important changes are that it runs cleanly on PAL or NTSC and the one frame in eight stutter bug has been stamped on! That hiccupping was there in the very first proper versions of Co-Axis and was being caused by the way that the runtime level code which handled sprite movement checked for a specific raster line; it was looking for the value $1a which, if you’re only reading the main raster register $d012 as I was at that time, occurs twice a frame so the game actually shifted the sprites twice each 50th of a second for seven frames until the interrupt used that line for the scroll routine on the eighth and only one instance happened. What will happen to Co-Axis RX when I get it finished is anyone’s guess, but it compresses to less than 15K so RGCD’s annual 16K cartridge competition is always an option and, if there’s any interest, perhaps a future How It Works post too…?

I’ve had quite a few surprisingly enjoyable waves of nostalgia whilst reminiscing about Co-Axis and mentioned some old friends during these two posts, but not all of them are currently in touch so, if Alan Jesse, Jason Morrell, Hamish Parker or indeed anyone else I currently don’t have any contact with happens to be reading, it’d be great to hear from you folks after all these years…

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.