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.

Workprint – April 2015

Since the last one seemed to go down reasonably well, here’s another update from the Cosine Laboratories – Because You’re Worth It. The subject this time is going to be Hammer Down since that’s occupied most of my programming time since the last update. One of the pending jobs for a while was finalising the maps but, since they were originally produced in Cartograph and the newer revisions broke compatibility with the work files, that meant converting everything to a new format.

In the end I spent a weekend writing some quick and disgustingly dirty tools in BlitzMax (I have some prior in this area, the level editors for Co-Axis and Warflame were completely devoid of “user friendly” features like load and save and most of my self-built cross dev tools work with fixed filenames and Windows notifications rather than opening a GUI window!) to shovel data into and then out of Tiled‘s TMX file format. Here’s how the map looks when nestled into its new home:

This editor isn’t designed for 8-bit style tile editing like Char Pad or Tile,medo are, but it’s not too difficult to “persuade” it using a cropped screenshot of the characters produced by a small program running in VICE.

We’ve been thinking about mastering as well and now have working images with test data for both disk and tape, using the Covert BitOps and Sean’s Powerload loading systems respectively; Powerload was originally written in the 1990s and, to our knowledge at least, the first tape fastloader to open the upper and lower borders whilst working; it was supplied with an auto mastering tool with Reaxion when we sent it along to Commodore Format but they decided to freeze the game on the intro and use their own loader instead, neatly undoing a lot of work on our part… and then a few months later, a game turned up on their covermount with some remarkably familiar loading stripes and the borders open!

I’m still hesitant about calling Hammer Down as “done” just yet because the loading screen is a placeholder right now, we haven’t finished the bonus music demo for the disk version and there’s a few game elements that might need a tweak, but these will all be dealt with during April. Promise!

Workprint – March 2015

Since the blog has been a bit quiet of late and because I get asked once in a while what I’m currently working on, this is hopefully going to be the first of a series of monthly project updates. But, since even on a good day I have the attention span of a bag of amphetamine-dosed squirrels, there will probably be lots of random changing of priorities and things will get forgotten so this might turn out to be futile but fingers crossed and all that.

So first off is Hammer Down for the C64, the top down, multi-directional collect ‘em up inspired by Action Biker on the C64 and Atari 8-bit along with a couple of other budget titles. As it stands the game is pretty much complete now barring some cosmetic tweaks and we’re already thinking about the cassette and disk mastering. It also stands as one of the biggest games I’ve ever written, taking over 60K of memory and using nearly all of the available processing time during play, so it’ll be going out as PAL only and I’ll be interested to see if anyone gets an NTSC fix up and running.

Once Hammer Down is out of the way the 64K version of Vallation for the C64 should get picked up again. The current state of play is that it has six of the nine levels with two out of three graphical styles pretty much done (the screenshot above features the second graphical set which will be used for levels four to six) and it also bolts in extra enemy types and graphics as well.

Blok Copy on the Plus/4 is just waiting on music and Sean is already thinking about it; since he feels that getting the tune down to two TED channels is a non-starter we’re instead aiming for a SID card-equipped, 64K machine as a minimum – the game will run without a SID present but either be quiet or perhaps have TED-powered sound effects. There was some discussion on the Plus/4 World forums about running a competition similar to the yearly RGCD or ABBUC ones which would’ve provided a nice incentive to get this out the door but the thread dried up before it properly got started.

Speaking of ABBUC, I haven’t decided on a project for it this year; I did have something in mind but it requires a lot of trial-and-error testing and may well be unworkable in the long run. There is something of a “plan B” which won’t be anywhere near as involved technically, so if the time can be found that might step up instead. The remixed version of Co-Axis which was back-burnered late last year for a couple of reasons (the most obvious being a lack of free time) should hopefully be done and dusted for the next RGCD competition. After that, there’s some other projects being prodded at but nothing solidified enough to write about.