Details of Mario Kart 64’s Catchup AI

It’s information I’d much rather see in text, and I find the video a bit annoying from a construction standpoint (the speaker has a bad case of Youtube Voice), but it’s really interesting information regardless. This video from Abyssoft contains a deep explanation of MK64’s opponent driving algorithm, and explains that the game selects two rivals for your character on each cup, and that opposing drivers pick one of three paths through the course, and can clip right through walls if needed to continue driving around the circuit.

Explaining the Ways in Which Mario Kart 64 CPUs Cheat (Youtube, 12 minutes)

Identifying Luck in Mario Party 8

ZoomZike’s back with another epic-length exhaustive examination of the hidden mechanics and math behind a Mario Party title, this time the Wii game Mario Party 8. At three hours and 34 minutes it’s not as long as the nearly five-and-a-half hour video on Mario Party 7, but it’s not any less detailed.

I can’t think of any more detailed descriptions of the hidden mechanics of such a complex game as these. The time and effort it takes to make them suggests mania on the part of the creator, but I’m still glad they do! It’s fascinating the care that these apparently-chaotic games were made with, and how their secrets were discovered by attentive players. I suggest not watching it all in one sitting, but in segments over several days. If you care about the subject at all, that is. But as should be evident, I do care, and I think you might as well if you’re interested in game design and give it a chance.

Identifying Luck in Mario Party 8 (Youtube, 3h 34m)

Behind the Code Examines The NES Punch-Out!! Boxer Engine

Here’s another of those deep-dive NES internal videos from Behind the Code, possibly the most complex one they’ve done to date. Most game engines, when you examine their basic logic, are basically physics simulations, with some AI included to determine how actors behave.

Not so with the Punch-Out!! games. They are essentially entirely different kinds of games from that. You have certain things you can do moment to moment, and opposing boxers do too. Each of those opponents basically runs a big script, made out of byte code, that determines their behavior throughout each round of each fight. I am struck both by the simplicity (no need to simulate gravity) and the complexity (boxers take all kinds of things into account) of the system.

One of the interesting things shown is that the engine can affect more than just the boxers, but can also subtly affect the crowd, which is how the previously-revealed fact that a specific camera person in the crowd uses his flash right at the moment the player must counter Bald Bull’s charge move. It turns out that this isn’t the only instance of this happening in the game!

You don’t need to know 6502 assembly code to get what the narrator is talking about, but a lot of code is shown, so those of you who understand it may get a bit more out of it. Here are a few basics to help you follow along.

The 6502 has only three registers (bits of memory internal to the CPU that can be accessed quickly), the Accumulator (sometimes called just A), the X register, and the Y register. Each is only one byte long. The Accumulator is by far the most flexible, but all three are general-purpose registers. The most common instructions are Loads (LDA, LDX, LDY), Stores (STA, STX, STY), Transfers between registers (TAX, TAY), Incrementing and Decrementing (INX, INY, DEX, DEY), Adding (ADC), Subtracting (SBC), Comparing (CMP), Branches (some of them, Branch Not-Equal to Zero: BNE, Branch Equal to Zero: BEQ, Branch of Carry Set: BCS, Branch on Carry Clear: BCC), Jump (JMP), Jump to Subroutine (JSR), and Return from Subroutine (RTS). While some instructions are just one byte long, the longest any 6502 instruction can be is three bytes, and the opcode (the command itself) is always just one.

(I wrote all of that from memory. I figured, I have all of this in my head from my coding youth, I might as well use some of it.)

The 6502 can only address 64K of memory, so often systems will use bank switching to connect various memories to it within that space. The great majority of NES/Famicom games had to do this. Punch-Out!! was unique on the NES in that it was the only game to use Nintendo’s MMC2 chip. (I wonder if the chip was designed ahead of time, and they made this game as an excuse to use it?) Punch-Out!! uses MMC2 to bank in each boxer’s large data script as needed.

Behind The Code: How Do Boxers Work in Mike Tyson’s Punch-Out!!? (Youtube, 20 minutes)