magazine logo
Welcome to the official Attitude website - Europe's #1 C64 scene disk magazine
The Making Of Metal Warrior 4
by Cadaver/Covert BitOps

Cactus asked me to write something about making of MW4 for "Attitude #7", so I was naturally delighted by this opportunity. :)

I've already written a development history for "Domination" mag, but that doesn't matter: it simply means that this time I can go even more into the actual chaos and confusion of creating this game, and write in more freeform fashion...

I hope that after reading this, you see how incredibly confused I was at times and it's somewhat of a wonder that this game was eventually finished, being as cohesive as it is. :)

Beginning: ideas and lack of them

MW3 was released in January 2001. I don't remember much of that time except that I immediately had a fourth part in mind, but was totally devoid of ideas regarding how to continue (storyline-wise): I actually went as far in lameness as to publicly ask for story ideas on Lemon64 forum. :)

Of course I needed something to anchor and focus on, and like with my previous projects, this something was a bunch of technical ideas and improvements, and especially scrollroutine ideas. Yes, that's right, every MW game has actually started from a scrollroutine. :)

This time the plan for improvement was to scroll the whole screen, with a status panel made with sprites (either within the playfield or in the vertical border). Actually that still didn't get implemented in the game...

Another unused plan from already a few games back was to finally have friendly AI characters that could for example fight alongside you, instead of just sitting in one place and giving information. :) This wouldn't be a piece of cake to implement, especially with all 1MHz of power, but I thought it was a much needed twist/addition, like the idea of a "team" was in MW3. To simply make the same game again would be boring, of course!

The final idea was to, at last, take the fighting/adventure into space (I had this idea already for MW3, but sadly it was again left unimplemented in MW4). :)

Intervention by Agents

Of course, it would have been easy to invent tens more or less cliched/indifferent story ideas, for example something along the lines of "Ian & co. go to Japan for tour and fight ninjas" or "Attack by reptilian aliens is imminent". But the question was, what kind of story would actually be worth implementing and bring some variety, as well as a logical continuation to MW1-3? This is a very good and a hard question and it actually remained somewhat a mystery until April-May 2003, year after the game project's announcement (more of this in later chapters)!

But back in Spring 2001, the idea of "Agents of Metal", a covert and independent organization that would fight the conspiracies of the ruling elite, first came to me, in collaboration with a French tracked metal (XM/IT) artist Lionel Gendre (aka Malekith), who has nothing to do with the C64 scene. :)

Anyway, me and Malekith started composing songs that revolve around the Agents, their ideology, and their sworn enemies, the SCEPTRE. At some point it occurred to me that the Agents+SCEPTRE would lend themselves to a game excellently, and more specifically, to have some MW character to join these "Agents" in MW4 would lead to an interesting adventure.

If interested, check out these links: - tracked metal community, now quite inactive. MW3+MW4 music was done by these guys. - Agent Metal project, with song downloads and other information. Sense of humor might be required.

Story confusion pt.I

Even though that it was now quite clear that MW4 would contain Agents, the confusion was far from over. In fact, in some ways it was even worse than back then when I had no ideas. One point of confusion was that whether the game would be:

Agents of Metal - allow the player to create an own Agent (roleplaying-like), with no references to the earlier MW games or their characters at all!

MW4: Agents of Metal - after extraordinary events, Ian (protagonist of the first MW game) is left lost and alone, in a some kind of my own variation of Mulder-Angst :) and feels compelled to join the Agents...

Having a fixed character gives better possibility for a "stronger" story and perhaps more emotional depth plus recognition from the earlier games, but player-creatable character of course gives much more freedom. This was something that I debated right up to announcing the MW4 project officially in May 2002.

Story confusion pt.II

Though I felt that the "Agents of Metal" idea was very strong, I was still (up to project announcement) debating also other options for MW4.

One idea was that of a sinister "Wormcult" that would haunt the player (*), another was to take the adventure far into the future. But one by one these had to be abandoned, and I'm sure it was for the best of mankind. :)

(*) Actually, the names/personalities of main villains in MW4 came from this idea, so it wasn't entirely wasted!

Story confusion pt.III - finale

After May 2002 I never faltered in the sense that I knew the game would be called MW4: Agents of Metal - i.e. Ian joins the Agents and the game follows his adventures, but even this provided limitless possibility for variation and confusion. The MW4 preview that was released in Summer 2002 was very vague (10 years in the past, with another main character) just because of this confusion...

I began by writing an about 150kB long "script" - very heavy, quite linear, mission-oriented, very much inspired by the PC game "Deus Ex". Slowly I realized that it likely wouldn't be very enjoyable to play and would be hard to implement on C64 (a diskside required just to hold all text!)

This realization was somewhere in Autumn 2002. After this I experimented with various less ambitious but still very linear stories, but nothing really satisfied me. Meanwhile I worked more on the game engine, but being unclear on the story postponed starting any leveldesign work well into 2003 (and I had thought the game would be ready about a year after announcement!).

It was April or May 2003 when I finally realized what the game would need. It was actually very simple. Strip away the controlled linearity, remove all mission-briefing stuff, instead give the player the freedom to explore a bunch of enemy installations. The enemy installations would be arranged in a "ring": think of Impossible Mission II for example. Then, possible story events/encounters could happen in each of these installations, in a more or less free order, and optional "sidequests" could be added. I think this idea was very important to getting the game done, and it was also true to the exploration feeling in MW1-3!

Target platform?

Some might remember the period when I was quite totally disillusioned with the possibilities of C64 (Autumn 2001), and announced my "quitting". :) During this time, I actually strongly debated making MW4/Agents of Metal a portable game, for example on Win32/Linux platforms. However, the ideas I got for a fast C64 playroutine (as seen in GoatTracker) got me back on track...

Weapons and Violence

When I look back at my C64 games I actually find that they're quite disturbing compared to most other C64 titles - instead of happily blowing robots etc. to pieces you are most of the time actually killing humans!

MW4 is of course not much better in this respect - it has about as many lethal weapons than previous MW games combined. :) This time a lot more research went into the weapons, most of them are somewhat based on real world weapons, in terms of for example ammunition, magazine size and weight, thanks to the excellent site

But to my defense :) it's possible, though not so easy, to complete MW4 without killing anyone, as there's also "nonlethal" weapons such as tranquilizer darts to use. This is also shamelessly inspired by "Deus Ex".

MW4 is very much inspired by recent FPS games in general... "Soldier of Fortune 1&2" are not the greatest games around, but I believe that during development of MW3, influences from "SOF1" creeped in, and likewise with "SOF2" and MW4. Shotgun reloading in the game is purely "Half-Life" inspired. :) Whether anyone notices these is another thing...

Technical stuff

OK, now we finally get to actual C64-specific dirty stuff. :)

To start off, MW4 is quite heavily based on a number of routines in MW3. For example, character movement, background collision detection, the coordinate system with subpixel accuracy (smooth movement), and even player inventory handling! So, work definitely didn't have to start from zero.

But the MW3 "engine" had some shortcomings, for example:

- Scrolling strictly limited to 8 directions

- Sprites were still at times sorted incorrectly for multiplexing

- It was easy to run out of sprite frames (what is available in the videobank, after subtracting the charset and doublebuffered screen), so complex enemy animations were out of question

- Every routine in MW3 was very speed-optimized, but still the game would slow down occasionally. Enemy AI in MW3 was quite dumb, but still it was taking too much rastertime. :)

From Autumn 2001 onwards I started to work on these shortcomings, even though I had spoken nothing to the public (I had a heavy belief for secret development at the moment :)).

Inventing an algorithm for freedirectional scrolling was in the end quite easy. As for the sorting, I examined code from the classic Green Beret, and noticed that it had the "perfect" answer: instead of sorting the sprites from scratch each frame, it would need work only when the sprite Y-coordinate order changes (when sprites move in Y-direction, or get added/removed). These things are quite well documented in my CovertBitops rants.

For running out of sprite frames I had a crazy solution: have the sprites packed and unpack only what is needed to display the current frame. This needs of course some logic to check for sprites that have already been unpacked, as to not waste time for nothing :) and of course doublebuffering...

At times (like in the MW4 preview) the engine was actually depacking all sprites, but for the final game I settled for a more modest option: only the small objects like bullets would be depacked, while the enemy and player sprites would be "permanently" loaded into the video bank memory.

For the slowness and requirement for better AI, I invented (OK, I'm sure others have also come up with the same idea, but I was unaware of that) the concept of "interpolated movement". Only each second frame would the full AI+movement+collision checking routines be run (25Hz frequency), and the other frame would be created by linearly interpolating sprite movement. It's practically impossible to see the difference between this and true 50Hz, but time savings are formidable.

Musicroutine madness

I started making MW4 music with GoatTracker, which has quite convenient features and editing. The music in the preview is GT-made. But as 2002 came towards its end I thought that maybe the musicroutine could be faster (GT player took about 16 rasterlines) and the player plus music data could possibly be more compact? To answer that question, I created NinjaTracker. It's noticeably harder to use, but allows pretty much every effect I see need for to be created using step-programmed tables, without any "redundant" functionality.

At that time there was no critical significance to this, it was merely my own ambition. But when the game actually was getting close to being finished, memory was getting very precious. That's when I found it had been a very good idea to switch onto NinjaTracker..

Btw. I still used GoatTracker to edit the majority of the tunes, they were then simply converted to NinjaTracker format with an utility, and then further optimization performed in NinjaTracker.


The need for better AI actually crystallized in the problem of pathfinding. If friendly characters could follow the player character anywhere, and enemies would be able to hunt him anywhere (same thing), much of the AI problem would be already solved (things like choosing targets based on "group alliances" and firing at the target in 2D world are fairly easy).

The method that MW4 uses is somewhat weird and bit of a mystery even to me. It doesn't do any fancy calculations or have any complicated state information for pathfinding, instead the AI characters alternate between "horizontal mode" and "vertical mode". Horizontal mode is when the target is at same level with the character. But if the Y-distance grows, the character switches to "vertical mode" to be able to navigate stairs, ladders etc. It's still somewhat guesswork and black magic, but it works for most of the cases. :)

The pathfinding also needs a little bit of "help information" to be encoded into the level data: stair junctions need to be marked so that the characters know when to turn in them. But otherwise they're quite independent!

Engine rework

After getting the preview done, I had started bloating the MW4 engine by adding my own 8-bit bytecode scripting language, the "CovertScript". Bytecode was being loaded in 1KB pages off the disk, and it contained most of the game's deeper intelligence (such as the menu system, and implementing the game story).

It was a neat system, there could be many threads of CovertScript code running at once. My aim was to hardcode as little information as possible to the ASM part of the MW4 engine, therefore making it very easily "moddable". For anyone who actually wants to make use of this system, it's in the "MW4 preview 2" and sourcecode is included.

However, the CovertScript execution slowed down the game and made it load frequently - well, that's something the final game does as well. :)

But the main reason that something had to be done was that even quite trivial things, like going to another level, or checking if player has the correct key to open a door, always needed the writing of a script function. When there was going to be 100's of doors and objects in the levels, it would become painful indeed...

Also, the game was by now (Spring 2003) executing only at 25Hz. This was ugly...

So, in April 2003, roughly at the same time as I was writing the final version of the game story, and after some heavy-duty hesitation, I began an engine rework. The CovertScript interpreter was thoroughly removed, code was slightly optimized, the packed-sprite-system's scope was reduced to make running at 50Hz a possibility (see a couple of chapters above), and a new level editor/leveldata format was designed that would allow creation of doors, objects and level transition points without need for any scripting.

Of course, scripting would still be needed for things like conversations and special events, so what would I do? Simple, make the game load blocks of ASM routines into a specific area at the memory, and trigger execution of these routines as needed. That was my "scripting engine", pure and simple. :)

Where's the game?

When the engine rework was finished towards the end of June 2003, my own "deadline" of May 2003 - Matrix Reloaded premiere :) had passed, and there was still no levels or enemies ready. Only the engine, and all the music, that had been converted/arranged from the work of the tracked Metalscene guys by the end of May.

Because of disappointments with the earlier story versions and the game engine as it was earlier, I had hesitated to start any serious game content work. Only a version of the game intro plus the "Agency HQ" level existed. But this was actually quite lucky, as they had to be scrapped anyway. Better that way than even more work being wasted. :)

During July 2003, the levels were designed. All 1000 screens of them...

During August 2003, the enemies plus other sprites were drawn and programmed, and the story implemented by scripting. In that final phase the game actually became a game, at last. :)

There's not that much to say about those 2 months of creativity, it was hard work but I was quite focused and had good plans and a good story to back me up. The funny thing is that I had known what I knew now, say a year ago, the game would possibly have been ready a year earlier. :) But I guess arriving to the final design required going through all the bad ideas first...

The problem might have been that of overdesigning and having too ambitious plans too early. MW1-3 were pretty much designed and implemented "on the run", and therefore they emerged quite naturally and quickly. I remember that MW2 went through perhaps one story rewrite but that was it.

From this we can see an easy warning sign: if you're hesitant to begin actual game implementation beyond the engine (levels etc.) your design or ideas might be faulty. :)

Final squeeze

Of course no C64 game project would be complete without running out of memory, rastertime, diskspace etc. These things happened also with MW4.

Actually this time speed/rastertime issues weren't that bad. I simply had to be content with the fact that anything past 2-3 enemies onscreen would cause slowdown, and plant the enemies/enemy spawnpoints in the levels accordingly. Of course even with Agent armor, the player can't be expected to survive 4+ assault rifle (or some more badass weapon) wielding enemies at the same time, so it wasn't that big of a problem.

Memory problems were much more severe. The game engine grew as the sprite+actor definitions, and movement code for all enemies/characters were being written. First thing to do was to remove the fastloader drivecode from the memory, and make it loadable from disk instead (fastloader needs to be re-initted after saving a file).

Next thing was to move as much game engine code as possible into the loadable "script" code, for example the menu system, and use of player items such as first aid kits. This introduced some more undesirable loading but what can you do?

The last operation was to implement realtime flipping of the packed sprites: this way they'd only need about half of the memory.

When all enemies and characters had been programmed into the game, the engine memory footprint wouldn't grow much anymore, and so I had cleared the memory hurdle. The rest would be about implementing the story through the loadable script code.

Now the final obstacle, diskspace, became apparent. I simply had no diskspace for one "sidequest" where a character from the early MW games would return... And neither was there no space for nice victory screen bitmap graphics or scrolling end credits. So, when you reach the ending and think it's quite spartan, there's a reason. :)

When I was running out of diskspace, I could "buy" some more space by re-using the sprite flipping idea: when loading enemy/other character sprites from disk, only those facing right would be stored, and the left facing characters re-created during the loading process.

If MW4 didn't have savegames, I would have had a majestic 48 extra blocks to use: in that case implementing all my ideas wouldn't have been a problem.

Testing, release & bugs

MW4 was released after 1 week of internal testing and 1 week of open betatesting, on 7th September 2003. During the testing it was played several times to completion by myself and a couple of other guys. Several other betatesters played it also to a lesser degree, but giving valuable suggestions. For example, initially item/weapon names would not appear as you walk over them.

There was one serious hard-to-discover bug in the initial release, that would lead into items disappearing from the gameworld in certain cases (if lots of weapons would be dropped by enemies, and not collected). This was fixed a day or two after release, and also SuperRAM buffering was corrected (the blasphemy is that it was working in the preview, but meanwhile one needless extra instruction had been inserted into the buffering code :)).

Some minor cosmetic annoyances were also fixed during the next weeks from release. What I learned that the bugs you discover (in bigger projects anyway) will always be beyond your imagination, so perhaps no amount of testing is enough...

A special "one-file-data" version was also released for faster data buffering on CMD FD/HD devices. Source code was also released about 2 weeks from the game's release!

My final thoughts regarding MW4 are very satisfied, but it was quite a weird journey. I'm not sure if I would do it again knowing what there'd be in store... And as for future game projects, I can't give any intelligence information, simply because I have no plans now. :)

Thanks for reading!


   Add/view comments on this article (comments: 0)



publication date:
Official Webpage
of Attitude diskmag
Copyright 2004-2023