Mike Dailly Tuesday 18th December 2018 Share this article Share

Companies in this article YoYo Games

Why I Love is a series of guest editorials on GamesIndustry.biz intended to showcase the ways in which game developers appreciate each other's work. This entry was contributed by Mike Dailly, head of engineering for GameMaker creator YoYo Games.

There's so much we can learn from the past. You might not think that a 1988 Commodore 64 shooter would be particularly relevant to the contemporary gaming space, with the likes of Red Dead Redemption and Uncharted mesmerising us with beautiful photorealistic graphics and intricate gameplay systems, but you'd be wrong. For the Commodore 64 is a treasure trove of coding knowledge. Back in those days all code was written by hand, so if you picked it apart, you could understand exactly how it would all hang together.

That's what I did with Armalyte back in the day, and that's why it's always held a special place in my heart. It was a fun game, no doubt. Its unique shooting mechanics, varied sci-fi environments, and slick mini-bosses kept it brisk and exciting. But what really wowed me about Armalyte was its technical performance. It may not look like it now, but it was a marvel of coding for something condensed into a mere 64k of ram. Where most games on the Commodore 64 were severely limited to how many sprites they could process at once, Armalyte blasted away the known confines of the platform's hardware, and the secret sauce was in its code.

Allow me to get a bit technical here. Back in those days, on a normal CRT screen, you'd have a little beam that goes across the screen that draws the picture. Figuring out where to place the sprites would cause a lot of stress on the meager Commodore 64 processor, causing a sort of glitchy, ripping effect. It also limited the number of sprites the system could process at a time (usually to 16). But Armalyte's code could dynamically generate what are called "raster interrupts" dynamically, allowing it to position sprites far better than was the case before. This meant a sprite being reused could get much closer to the previous batch than was previously possible, massively reducing glitching. Effectively, it was timed to work faster than the display was rendering it! As such, there was no ripping whatsoever and the game could process more sprites on screen than was typically possible with a mere 64k of ram. It was ingenious!

This influenced how the game could operate. Because of how good the multiplexer was, Armalyte managed to use sprites for the baddies' bullets instead of the usual 8x8 cells. This meant that enemy shots could move slower than your own, without the juttery movement you usually got from shifting these 8x8 cells around at a slow clip.

The funny thing is that this tech wasn't just revolutionary for its time: much of it still holds up today. While multiplexers aren't used these days because we have advanced graphics hardware that can put huge amounts onto the screen, the character map stuff from the Commodore 64 is something that's still being used in GameMaker. That's right: we've actually replicated the Commodore 64's character map screen in GameMaker's tilemap system, because it's still the most effective way of doing it.

That's because tilemaps are still extremely memory efficient. They're much quicker to draw than lots of sprites or 3D things. Because they very easily clip to the screen, you can have massive tilemaps without any performance drops. It's one of those things that has stood the test of time in terms of the old tech. Obviously we can render far more of them at once on modern hardware, but the fundamentals remain the same.

That's what I still love about Armalyte. It's bringing old tech forward again, because old tech was really cool and still has a lot to give. It's so much more efficient. The Commodore 64 was the last time you could really get into a game's code and poke around to see how it all worked. As we moved further forward, you couldn't really get a chance to see how programmers made entire games, because the hardware became so complicated.

On modern hardware, you don't think of these things because you've got so much power. But doing it on a one megahertz machine you've got to eke out every bit of processing power you can. It's such a simple way of working but it's not something that occurs to most programmers these days. The old machines are still great that way. They still drive you to think up new ways of doing things. They're definitely still valid. Armalyte may look like a relic, but its code remains timeless.

Developers interested in contributing their own Why I Love column are encouraged to reach out to us at news@gamesindustry.biz.