KEVIN BLAKE reveals how he wrote his latest arcade game, Spy vs Spy

WHEN Tynesoft asked if I would like to do a major title conversion for them just after I had completed co-writing FutureShock I said "Yes" immediately without really wondering what I was getting into.

Spy vs Spy took around five months to write, which is two months longer than it usually takes me to complete a full priced game - I've written or co-written 12 to date.

The main reason for this extra time is the very complex nature of the game itself. In all I used 131 sprites - game characters - all of which had to be compressed to save memory, then tabulated.

Once this mammoth task had been completed all I had to do was to supply my machine code poke subroutine with the sprite number and x,y position to print it in a particular manner on screen.

The inanimate objects making up the scene such as cupboards and pictures are directly poked, or as I say, plonked, on to the screen, meaning that they wipe out anything underneath them.

The sprite designer used ...

The spy sprites, however, had to use a completely different method so that they didn't wipe out the background. In addition to this, they had to let you see the background around the edge of each sprite.

This means storing the background of the sprite somewhere in memory and then checking the sprite against a mask or template as it is printed. This technique ensures that the sprite isn't surrounded by a blank box and leads to realstic movement when the stored background is replaced and the spy moved to a new position.

Spy vs Spy, being a conversion, had to have the same addictiveness and playability as the original versions. It had already been released on the CBM 64, Spectrum, Atari and Amstrad micros, all of which have at least 20k more memory than the Electron, which for various reasons, particularly speed, would have its version running in Mode 5.

The unique thing about Spy vs Spy is, of course, the simulvision. This is the way in which each spy has his own playing window, but is able to encroach upon his opponent and vice versa. This means each spy has his own room screen most of the time, and also his own set of screen colours.

Without the simulvision the screen would look bland and this is often the trademark of a lot of Electron software. Really the desired effect is to imitate Mode 2 with eight individual colours and yet still have the speed of Mode 5.

White searching for booby traps

The recent BBC Micro titles I have been involved with all use a colour palette switching routine which allows you to have a different palette of colours linked to the machine's VIA interrupts. As these interrupts are missing on the Electron, I had to use the screen sync, which is a perfectly good substitute.

I was then able to individually control the colours in two areas of the screen, without either half affecting the other. This allowed me to turn off the top or bottom half of the screen when a spy wanders into his opponent' s room.

Having now got two areas of screen whose colours I could change, the game still presented me with a problem. The program itself is so large that on the BBC Micro version there are areas of hidden screen memory used for data and a music player.

0n the Electron version, I still had to use some of this code and to leave it on screen would spoil the whole effect - as seen with the Electron version of Superior Software's Citadel. So I decided to add a third colour change section to hide it.

The problem here was that I couldn't put it at the top or bottom of the screen due to technical reasons, so it had to go somewhere in between.

Luckily, due to the program design (the two box simulvision) - I could get away with putting it in the middle.

One of the most eyecatching features of the screen design of the Spy vs Spy series - there are two sequels - is the trapulator, a box that hangs on the side of the playing screen, showing the status of your spy and the traps he is able to use.

No matter how hard I tried, I couldn't get the design of it right, so I enlisted the help of friend and co-writer of many of the games I've written, Jason Sobell.

Between us, we managed to link up my trusty BBC Micro and his Amstrad CPC via their RS232s and passed the screen across from the Amstrad version, which has a screen layout identical to Mode 2. I wrote a short program to convert this to Mode 5, then tidied it up to my requirements.

With all the main technical routines done, other ones could be brought in from previous games I'd done - keyboard scans, score routines and so on, to speed up development.

White placing a booby trap

Spy vs Spy has many little fiddly bits in it. Playing or seeing it for the first time, it looks like a straightforward cute little game - I can assure you it isn't. It took me weeks to work out what everything does. The original instructions weren't very clear, but the Tynesoft ones - which I rewrote especially - are much better.

One of the most interesting aspects of writing games that involve lots of different screens is the actual designing of the screen and the number of them you can fit into your game.

If you can compress your data enough, it is possible to squeeze in hundreds. However, this number is limited by the amount of memory you've got left after all your other routines are in and finished.

I only had four pages left just 1k of memory. This, however, still allowed me to have 64 different screens in any of the seven embassies and there are seven levels, all with different numbers of screens to give varying levels of difficulty.

Well, what more can I say, except that I thoroughly enjoyed writing it and hope you have just as much fun playing it.

Both black and white active

I'm now working on my second US conversion for Tynesoft, this time a sports simulator for the Electron called Indoor Sports. It has already been released in this country on most other computers by US Gold/ Advance and consists of four events - 10 Pin Bowling, Table Tennis, Airball and Darts.

This is my 11th full price program and the seventh for Tynesoft: Caveman Capers, Bugeyes, Frankenstein 2000, Bugeyes 2, lan Bothams Test Match, Winter Olympics, Vindaloo, Commonwealth Games, Future Shock, Spy vs Spy and Indoor Sports: Several were co-written with Jason Sobell and Dave Croft.

This article appeared in the January 1988 edition of the "Electron User", published by Database Publications.

Scanned in by dllm@usa.net