Figuring Out Yars’ Revenge Code From Its Graphics

What is Set Side B about? We talk about old arcade and NES games, Nintendo things, weird gaming-related videos, ancient MMORPGs, and other weird and idiosyncratic things largely as they inspire us, much as how beta particles and gamma rays inspire random atoms as they pass through them, causing mutations and cancers along the way. (Alpha particles are too bulky to pass through, but that’s really just highly energetic ionized helium anyway!)

One foundational aspect of what we choose to highlight, though, are the extremely technical things, and wow, in that regard today’s link delivers. The brilliant Youtube channel Retro Game Mechanics Explained, which appears here semi-frequently, did a video on the Atari VCS/2600 game Yars’ Revenge that has to be seen to be believed, if not always quite understood.

It’s been random floating game knowledge for a while that the “Neutral Zone” area in Yars’, a flashing and coruscating band of lights that serves as something of a safe zone for the player’s bug, was the direct result of reading the game’s own code out of memory translated and displayed on screen. After all, machine language opcodes are just data, and the VCS has such a hugely limited address space that any reuse of that data is helpful.

RGME went through the graphics displayed on-screen and tried to see how much of the game’s code could be pieced together using it. The answer was, a fair bit, but not all. The process is really the most interesting part about it. Here it is:

Of particular note, the top comment on the video (because it got pinned there by RGME) is from Yars’ Revenge creator Howard Scott Warshaw himself!

In passing, let me just comment for a moment on what a weird phenomenon Yars’ Revenge is? It’s the best-selling original (non-port or license) piece of software for the old Atari. It’s such a weird artifact. It’s not a traditional style of game design. It’s got atmosphere, and strangely evocative sound. And it has that odd easter egg that can just outright end your game if you’re not careful. It really feels like an object of its time, that couldn’t have both come about and be as popular as it was in any other age. It didn’t inspire many imitators. But, it did come about, and it was popular, and I’m glad that’s true.

I watch this video and I wonder that it seems targeted so directly at me personally, that I wonder if anyone else might enjoy it at all. But then I look at its view count and see it’s approaching 200 thousand in around two weeks, so someone else out there must like it too. So: please watch the video, if you care about bits and bytes, opcodes and operands, and Exclusive-Ors. Or want to learn about those things. If neither is true for you, I’m sure there’ll be something more to your tastes tomorrow.

Reverse Engineering Game Code from the Neutral Zone in Yar’s Revenge (Youtube, 41 minutes)

Frightened Ghosts in Pac-Man: Where Do They Go?

Retro Game Mechanics Explained generally does interesting videos, I find. The details on how the ghosts (monsters) in Pac-Man behave when dangerous are fairly well understood now, thanks to the work of Jamey Pittman in writing The Pac-Man Dossier. RGMEx did a summary video of that work three years ago.

The question of how vulnerable ghosts move, after Pac-Man has eaten a Power Pellet (Energizer), isn’t covered in as much detail. It’s still as accurate as the rest of the information in the document, but its implications are left for the reader to explore. Well, RGMEx has explored it.

Vulnerable ghosts move pseudo-randomly, through an interesting process. The game has a RNG (random number generator) that’s reset at the start of every level, that cycles through a period of 8,192 values. Vulnerable ghost movement is the only thing in the game that it’s used for, but it isn’t applied directly. Instead, it’s used as a pointer into the game’s own code, and the value of the address it finds is used to determine how the ghost moves.

A result of this is that not all directions are chosen equally. But further, and more importantly, if the direction chosen isn’t available, the ghost tries the next direction in a clockwise order. If that one’s not possible, it tries the next, until it finds one that works.

These two facts combine to give a definite bias to the directions that frightened ghosts move. Retro Game Mechanics Explained then ran the numbers and figured out where scared ghosts tend to go. It’s interesting, even slightly useful, information.

Super Mario Bros Level Glitches

The Youtube channel Retro Game Mechanics has done a series of three videos on glitches in Super Mario Bros. One involves using the NES game Tennis, which has a certain property of its code that allows you to load all kinds of funky levels in SMB.

They’re all interesting, but the one that floats my particular boat is the third, which turns into a deep dive in the compressed manner that Super Mario Bros. stores its levels in ROM, and uses to draw them during play in real time.

1. Access Glitch Worlds in Super Mario Bros. via NES Tennis (13 minutes)

2. Exploring Glitch Level Pointers In Super Mario Bros. (15 minutes)

3. Super Mario Bros. Glitch Levels Explained (30 minutes — this is the one embedded above)