Oh man, the future!

My Aunt and Uncle did not have children so when we used to go and visit them my brother and I would have to take something with us to keep us entertained. This all came to a halt in the late 80s after my Uncle, for reasons unknown to me – as he’d never shown any interest in the subject up to that point – decided to purchase a home computer. He’d bought a Commodore C64.

Doubling down on this with a disk drive, printer and freezer cartridge, he’d also managed to obtain a large box of copied disks from someone he worked with. If this wasn’t exciting enough for us, the disk drive and printer combination added an extra frisson. If you powered the C64, disk drive and printer in the wrong order, you could end up damaging the C64. Pocket money crippling woes aside, this new acquisition posed another problem. Although we now had something to do, we were technically sleeping with the enemy.

Back in the 1980s home computer wars, you picked a side and stuck to it. I’d bought myself a ZX Spectrum 48k+ in 1984 as I wanted in on the home computer craze. The C64 wasn’t even on my radar due to the sheer cost of the machine. The Spectrum held sway at my primary school. There were a couple of people with Amstrad CPC 464s and a few Commodores. A friend of my mother who went to a different local school had bought their child a BBC Micro which we got to play on when we went round to visit.

Parents did not buy the Beeb for games. It was for far nobler pursuits like education or running a small business from. Even the big ticket games for it like Elite (fiddly space based ship simulator with you having to run a business in space) or Revs (fiddly Earth based race car simulator) seemed to revel in being difficult for small kids to play and required you to memorise at least fifteen different keys. The lack of games for the Beeb saw it off as a rival. In our eyes, any machine that didn’t have a version of Ghostbusters was a spent force. This combined with the lack of a proper joystick – from memory, a weird non centring analogue contraption – sealed the fate of the Beeb as an also-ran in the playground games scene.

The C64 was a different proposition. It did have proper joysticks. It did have Ghostbusters and it played the music from the film all the way through the game. Coming from the ZX Spectrum, the first thing to note about the C64 is how loud and musical it is. This is thanks mainly to it’s SID chip. In game music on the Spectrum was do-able but was tricky. Manic Miner and Jet Set Willy play single note beeper music throughout the game but the full on musical riot of the soundtrack provided by Rob Hubbard to Thing On A Spring was in another league.

The disk drive, at the time was a revelation too. Yes, even the notoriously slow C64 disk drive seemed nippy after spending minutes loading (or not loading) game in from tapes. Full games loading in under a minute and not having to rewind or turn tapes over for multi event titles like World Games left a mark. The graphics were more colourful – if a little chunkier and browner in places – and didn’t clash.

These occasional forays into the C64 did not cause major problems. I managed to get a 3rd party disk drive for my Spectrum +2 (my original 48k Spectrum had met a grisly end having a Kempston joystick interface knocked out of it’s expansion port with the power on which spelt insta-electra-death to the internals) and all was well with the world. But not for much longer. A storm was coming.

As the 80s ticked into the 90s, the old guard of home computers was under attack. The 16 bit machines released in the mid to late 1980s were now becoming more affordable and were becoming the machines of choice. The move up to secondary school had widened the social circles I moved in and while there will still C64s, Amstrads and Spectrums there were other, more affluent kids who had Atari STs and Commodore Amigas.

My first experience of the 16 bit world was near Christmas 1990. Not in a computer shop but in a music lesson at secondary school. As it was the last lesson before Christmas, the music teacher had brought the Atari ST that lived in the ‘music studio’ opposite (a soundproofed broom cupboard with a MIDI keyboard) into the classroom as a treat. I got to play a conversion of Metrocross.

Sir, are you sure this is a legitimate games compilation?

Like that old magazine advert from FAST, the teacher was running copied software on the school’s Atari. The following Christmas, he was taking copies of disks that a classmate had bought in, including a James Pond & Lotus Esprit Turbo Challenge compact disk. I didn’t get much time on it as once you were killed, someone else was let on to have a go. But the future seemed certain. I’d be getting an Atari ST at some point as my next computer and I’d be able to swap games easily as there seemed to be groups of people chucking out disks full of games.

This was a revelation coming from a tape based machine like the Spectrum. Although there were ‘cracked’ versions of software available for it these tended to originate from outside the UK. Most of the time you could copy a game with a twin cassette deck or using a freezer interface to snapshot the entire game to tape or disk. Even my dad managed to circumvent the colour code protection on Jet Set Willy by writing out all the colour codes as numbers on an A4 piece of paper.

So as I started to plan how many future Christmases I’d have to mortgage to get an ST, fate intervened in the shape of my Uncle. Again, for reasons that were never massively clear, he’d bought a new computer to replace his C64 – the Commodore Amiga 500. I don’t think it was brand new new as again, it came with a disk box full of hand labelled games. Labels that read ‘Xenon II’, ‘R-Type’, ‘Stunt Car Racer’ and ‘Shadow Of The Beast’.

The hand that rocked the boat.

The white screen with the hand holding a floppy disk greeted us when my brother and I switched the Amiga on – fortunately a much simpler and less costly operation than the bomb disposal-esque startup routine of the C64. But where to start? Around this time in the Spectrum’s software life cycle it was trying to keep up with these new upstarts with various ports of popular 16 bit games back on to the 8 bit platforms. I’d heard of a game called Shadow Of The Beast from a preview in Your Sinclair magazine, so I popped that in the drive and the drive sprang into life.

I later found out that Shadow Of The Beast was often used by computer shops to draw the crowds in and to show off the Amiga’s music and sound capabilities. In both aspects it performed admirably. The music and graphics as the game loaded were amazing. Then the game started and the parallax scrolling kicked in. In hindsight Shadow Of The Beast is a poor game but my brother and I were suitably impressed punching and kicking waves of smoothly animated enemies.

After this we listened to the Amiga belt out a song from Bomb The Bass in the intro to Xenon II. An actual song, with samples. We hurtled round a roller coaster race track in Stunt Car Racer and winced when we heard the damage we had inflicted on the car. We enjoyed the novelty of playing Rick Dangerous in 1940s cinema serial black and white instead of the black and green we were used to on the Spectrum.

As if this wasn’t enough to take in, there was also the hand eye coordination challenge of using a mouse. This was the first time I’d used a mouse in anger – up until then I’d only ever seen them advertised as peripherals for the Spectrum or during Micro Live on the telly. This in combination with the icons and windows of the Amiga’s Workbench meant I was finally living the blue, white, black and orange WIMP dream!

And then it all came to a grinding halt. We’d gone to visit my Aunt and Uncle on a Sunday evening and tomorrow was a school day. Falling from the dizzying heights of cutting edge 16 bit technology to be dumped back into yesterday’s 8 bit future. What a come down! As the following days turned into weeks and months, I still liked my Spectrum – I even bought a mouse for it to try and recreate that buzz – but this brief foray into the future had been a wake up call.

I didn’t really have much choice but to make do with what I had, as the Amiga was more expensive than the Atari ST I had lined up to replace the Spectrum. My brother managed to save his money and got an Amiga A600 for Christmas some years later. A year or so after that, I managed to get the funds together to buy an Amiga 500 Plus. Ironically by the time I’d managed to jump on the 16 bit bandwagon, the Amiga and ST had been superseded by the Mega Drive and Super Nintendo and the PC was starting to get it’s act together too.

As everything changed in the great switch over from 8 to 16 bit, everything stayed the same. Spectrum vs Commodore C64 was now Atari ST vs Commodore Amiga and PC owners were the new Beeb owners. But for a couple of hours my brother and I travelled in time. And it was exhilarating.

So, about last year…

Turns out that I’m better at writing code than writing about code. Though that’s not too surprising if I’m honest. Documentation is always a chore and my past low tech attempts at chronicling events can be found in various unfinished diaries.

So to start 2019 with slightly better intentions – and yes, I’m aware it’s already mid February – let’s begin with some details on my latest release for the venerable ZX Spectrum, Your crackers, m’lord!

Towards the end of October last year, R-Tape took his special ceremonial horn off the wall, put it to his lips and let out a clarion call for submissions to the second edition of the Woot! Christmas tape magazine . I had an idea for something to do but couldn’t get it together in time as I was struck down with a chronic bout of level designer’s block. With the December deadline rapidly approaching, I went back to the drawing board.

So what to do in a short amount of time? I still wanted to knock a simple game together. I tend to favour writing puzzle games as they can be easier to implement in a short amount of time – especially if the main mechanic isn’t too complicated. Then, it’s just a matter of going through and adding all the levels.

By chance, I stumbled across a Scratch remake of Kiragames’ ‘Unblock Me’ by griffpatch. The aim of the game is to slide the pieces of wood vertically or horizontally to let you move the red block across the screen to the hole on the right hand side. The red block can only slide horizontally and the others can only slide in the direction they are oriented. It had a small level set, was challenging and the cleanly designed graphics would work well on the Spectrum.

griffpatch’s Scratch remake

Over the first weekend in December, I fired up my trusty text editor alongside with the z88dk C compiler and started work on my conversion. By Sunday afternoon, I had this garish prototype:

Crackers on acid!

It had a frontend (recycled from Thoroughly Modern Willy), 4 levels and the code to display the board – but you couldn’t move any of the crackers around or finish a level. Over the subsequent days, common sense prevailed and I settled on a more sedate set of cracker graphics. I also added the code to select a cracker (using the Spectrum’s BRIGHT attribute as an easy way to implement the selection cursor), move the cracker around the board vertically or horizontally and to detect when the red cracker was at the gap in the board which meant the level was finished.

The finished product.

With the game code sorted I set about playing the levels on the original to obtain the level data for the 28 remaining levels. These were pretty straightforward until the last 2, which had been sourced from a harder level of play. After some head scratching, I had the full level set and the skills to play test all the levels. For each level, I took screenshots of the game’s web page on starting and finishing a level so I could check I’d entered the level data in correctly and knew where I needed the crackers to end up to complete the level.

At this point, the only reference to Christmas was the cracker graphics. When you pull a cracker at Christmas, aside from the coloured paper crown you usually end up with a gift of dubious quality – usually a tiny notepad, some impossible joined metal loop puzzle or a red plastic fish with ‘psychic’ powers – and a piece of paper with a poor quality Christmas joke printed on it. I decided to source 32 cracker jokes, one for each level to display on completing a level. Fortunately the internet had my back with various web sites compiling lists of the best worst Christmas cracker jokes.

The main constraint for using a joke was whether I could fit the question and answer parts of the joke on one line. This proved challenging with an 8 x 8 pixel font, so I used Einar Saukas’ fzx font system support in z88dk to use a variable width font which let me squeeze more characters on to the line.

Just one of the 32 pieces of comedy gold strewn between the levels.

The name ‘Your crackers, m’lord’ comes from a sketch by the Two Ronnies (a popular UK comedy double act from the 1970s and 80s whose Christmas show was a big telly event back then). The sketch is in a similar vane to the classic ‘Fork handles / Four candles’ where the property of certain English phrases sounding identical to each other but meaning vastly different things is used to comic effect. In this case, the butler whilst serving courses of a meal to an aristocratic couple is saying nice things to his Lordship’s wife “Your sweet m’lady.” but is insulting to his Lordship “Your nuts m’lord.”Your crackers m’lord”.

This sketch also gave me the bare bones of a story to hang the game off. The reason you’re having to go to all this trouble moving these other crackers around is to satisfy your aristocratic employer’s demand for a red cracker with his festive food stuffs. I’m sure this was one of the sub plots of a Christmas edition of Downton Abbey one year.

For a rush job I was happy with the overall result. I’d like to thank griffpatch for his original Scratch game which provided the inspiration and source material for my conversion and R-Tape for compiling another Woot! tape magazine.

Knockabout, WIP build 107

Knockabout has been available in varying forms for about 3 months now. I’d received next to no feedback on the game after initially making it available on the ZX Spectrum Next forum back in August. Recently, a new forum opened at Spectrum Computing which I joined. It had a section for letting people know what projects you are currently working on. I posted a topic about Knockabout and within a couple of days got a much better response and some proper feedback.

One of the surprising things with the previous releases was the lack of reported bugs (one of the first versions had a typo in the level data which made it impossible to get past level 4). In software there are usually two reasons for this: 1 – the code is perfect and bug free or 2 – no one is using the code. I’m realistic enough to see the latter as the reason for the lack of bug reports. Maybe it will be the former one day. 🙂

Turns out there were some cosmetic glitches and some right howlers. From a rotating switch not being drawn correctly in a certain situation, player tiles being left behind after moving which would block your progress and the undo mechanism which – apart from working intermittently  – would randomly corrupt memory.

I made a number of intermediate builds available on the forum to get to the bottom of the reported issues. After a hiatus of a month or so (I was working on contributions for the upcoming WOOT! ZXMAS 2017 tape magazine but, more on that to come…) I’ve picked up the code again and made a proper new build available.

Level 89 – “We’re gonna need a bigger block array…”

The following changes have been made in build 107:

  • Added levels 83-90.
  • Fixed switch graphics glitch when rotating a 2×2 switch anti-clockwise.
  • Logic fixes to undo system.
  • Undoing a move was corrupting memory.
  • Try and stop issue where a ‘stuck tile’ gets left behind on the level after moving.

knockabout_121017

Knockabout, WIP build 106

My guess at the the number of levels – 136 – has been confirmed. I managed to find a newer version of the Nintendo DS game ‘PuzzleBoy’ – 1.10. rather than 1.04. This had a read me file which states the game has 136 levels and more usefully, the source of the additional levels. PuzzleBoy is a not a direct clone of Kwirk. While it uses the levels, they are interspersed with other levels that I assumed had been written by the author of the DS version. It turns out though that they are from Amazing Tater (a sequel to Kwirk on the Gameboy) and PuzzleBoy, a version of Kwirk for the PC Engine.

Hitting the wall(s) on Level 71 on the DS.

Level 71 on the Spectrum.

This proved rather helpful in getting me past level 71 which I had been stuck on for a while, as I found and downloaded walkthroughs for Amazing Tater and Puzzleboy. I then managed to track down which game the level was from and then used the solution to complete the level. I couldn’t figure out a way to auto convert the levels from the DS so I’ve been adding them in one at a time as I’ve been progressing through the game – which is why they’ve been added in spits and spurts.

The following changes have been made in build 106:

  • Added levels 71 to 82.
  • Swapped the Restart and Map options around in the break menu.
  • Made the code entry screen look similar to the level info screen.
  • Added support for blocks greater than 1 x 1 starting over a hole.
    Needed for level 74. I think this is an enhancement from Amazing Tater as Kwirk doesn’t appear to have blocks or switches starting over holes.
  • Fixed a bug creating a block when you had two n x n blocks on the same y axis. Spotted on level 71.
  • The initial switch position on level 12 was incorrect.

knockabout_102917

 

Heath Robinson coding

The Incredible Machine is a DOS game that implements a – for the time – quite realistic in game physics engine. This lets you create machines in the style of the British illustrator William Heath Robinson, whose name became shorthand for any over engineered or elaborate, slightly fantastical contraption that performs a simple task. A good example of this is something like the machine you end up assembling in the board game Mouse Trap.

The first stage of The Incredible Machine

I can’t remember how I came across love2d initially. I think it was mentioned in passing on a news article for a free / indie game. It’s a multi platform 2d game engine which uses lua as a basis for development. It also includes box2d which lets you do some quite advanced physics. At that time, I had written some code for a C interface to lua scripting for a project at work, so I had a familiarity with the language.

Partly as an experiment to see if I could get the physics engine to do something interesting, I wondered whether it would be possible to create a clone of The Incredible Machine using love2d. Which brings us to Contraption.

Contraption v001

Version 001, released in April 2011, is just the first level. There’s some nice placeholder graphics too.

Contraption v002

Despite a virtually identical screenshot, version 002 now has three levels, the ability to manipulate the placed objects and a reset button to return a level back to it’s initial state.

Contraption v0021

Version 0021 added some description text for the current object and some minor tweaks and fixes.

Contraption v0025

Version 0025 now has some slightly better visuals thanks to my attempts at pixel art and judicious use of Google’s image search to replace the various coloured shapes of the previous versions.

And that’s sort of where I got to. I started work on adding a level designer which would let you create your own contraptions but was having difficulty getting the love2d physics code to do some of the stuff required for the later levels. My interest started to wane and I moved on to other things.

At some point inbetween major versions of love2d, the interface to the box2d physics engine changed dramatically which meant the code no longer ran (Top Tip: if you’re going to provide a wrapper or API around another existing API, try and abstract or insulate it so that if the internals change, the exposed interface remains the same to the consumer).

Back around August 2016, after a gap of 5 years, I made a concerted effort to get the old code working with version 10 of love2d.

Contraption v0030 title screen

I added a blueprint style design, partly as a homage to the blueprints Wile E. Coyote used to have when designing his latest elaborate trap to catch the Road Runner.

Contraption v0030 level screen

The idea was to extend the blue print styling to the whole game but I never got round to that part (are you sensing a theme here?). The rest of the game is far from finished and will probably never be – but I think it’s an interesting failure, none the less.

There’s not much point providing code for the older versions as they no longer work with the current version of love2d. So here’s a .love file which should work with love2d 10.02. You’ll need to rename it from .zip to .love.

contraption_0030

Knockabout, WIP build 105

Knockabout

Knockabout is a port of ‘Puzzleboy’, a homebrew title by maRk on the Nintendo DS (which in turn was based on the Gameboy title ‘Kwirk’ by Atlus), for the ZX Spectrum.

Puzzleboy on the Nintendo DS

You need to get our heroine to the flag to move on to the next level. You can’t pass through walls but the blue switches can be pushed to rotate them and yourself around – so long as there is nothing in the way of the switch. Yellow blocks also obstruct your path on some levels and need to be moved out of the way. They can also fill in black holes if they are completely consumed by the hole.

Some levels need you to enlist the help of your friends. You can change between players with the ‘Swap/Ok’ button. You can also press the Break key in game to access the game menu (select an option with left, right and swap/ok). This lets you undo your last move, view an overhead map of the level to help get your bearings, restart the level if you get stuck or quit back to the main menu.

Build 105 has improved switch graphics to help make them more distinguishable, implements the overhead map view and now has 70 levels implemented. My investigations lead me to believe Puzzleboy has 136 so at least we’re on the downhill bit.

knockabout_101517

Statement of intent

Hello. This is the first post on my site. If you have high expectations, allow me to dash them quickly. This site will showcase new and current projects as well as  some of the older things I’ve worked on.

I’m currently writing code for the ZX Spectrum (an 8 bit computer from the UK) but have dabbled with 68000 assembly on the Amiga, lua games programming (through love) and homebrew on the Nintendo DS using libnds and gcc.