Missingno. A Tale of Data Management From the 8-bit Era.

Will Avery
6 min readOct 19, 2020

If you’re anything like me you were obsessed with Pokémon in the late 90s and early 00s. You could name all the original 151, how they evolved, what their types were and what the best moves for them were. You probably didn’t take it as far me and try to develop a Pokémon clone on the TI-84 though.

Being the intrepid (and wildly distracted) youth I was I set about trying to replicate the magical Pokémon experience on the venerable TI-84 from the back of my algebra class all in TI-Basic. In the process I learned a lot of cool things.

Pictured above the Pixelated aberration known as Missingno.

There’s a pretty infamous glitch in Pokémon wherein, through a series of exploits, you can find and catch a glitched Pokémon called Missingno. To all the programmers reading this you likely immediately picked up on something. It looks suspiciously like an error check. Missingno is what the game spits out when it calls on a lookup table for Pokémon, and cannot find one with the id given. This is normally not a problem because the player can usually only catch Pokémon with specific IDs, but under certain circumstances this can change. Using what is called the “Old Man Glitch” the player can flub the data in the game, and encounter Pokémon not meant to be encountered. The interesting thing is why this happens.

The first thing to know about the Gameboy is the fact that it’s a miracle anything ran on it at all. The Gameboy had a whopping 8 kb of internal memory meant for running the games, 8 kb of video memory meant for displaying sprites on its green 160x144 pixel screen and a Intel 8080 and Zilog Z80 hybrid chip clocked at a whopping 4.19 MHZ to push all the necessary logic around. Thankfully, via clever partitioning and hardware use, the internal memory can be ballooned to 32kb when you insert a cartridge. Suffice to say that memory management was of paramount importance to the folks at Gamefreak when they made the original Red and Green versions (Red and Blue to us US folks.)

The entirety of the original Pokémon games were stored in a 1 MB rom (With some room to spare!) and the game is constantly shuffling information in and out of RAM to make room for all of the complex logic that is happening in the game. Here’s the rub. Each Pokémon in your party has 21 attributes (Side note, this is explained from a point of reverse engineering. Do not expect these points to hold up completely against the actual Pokémon code base. This is all speculation.) They are as follows.

  1. ID
  2. Current HP
  3. Max HP
  4. Attack Stat
  5. Defense Stat
  6. Special Stat
  7. Speed
  8. Move 1
  9. Move 2
  10. Move 3
  11. Move 4
  12. Move 1 PP
  13. Move 1 Max PP
  14. Move 2 PP
  15. Move 2 Max PP
  16. Move 3 PP
  17. Move 3 Max PP
  18. Move 4 PP
  19. Move 4 Max PP
  20. Status
  21. Accuracy

Accounting for the fact that every Pokémon team has a potential of 6 Pokémon per team, just the data for the Pokémon alone occupies 252 bytes of the available 32000. Then we add the Sprite data. Each of the two Pokémon on screen has a 56x56 sprite representing them with each pixel taking up 2 bits of data. Meaning 1568 bytes for just the images on screen. This is not factoring in the game’s logic, or the other sprites present or the text, which eats 1 byte for each character in RAM, along with the text sprites. Either way, combined Pokémon data alone eats nearly 2 KB of the 32 available. So you have to be clever about how you use it.

Enter the Old Man glitch.

The harbinger of doom himself.

Early in the game an Old Man will stop the player and offer to help them learn how to catch Pokémon. Seeing as the Gameboy was wildly incapable of reasonably storing video data, the cutscene that follows had to be rendered using in game logic. This means swapping out the player’s party of Pokémon for the Old Man’s Pokémon. The cut scene plays, and the next time you encounter a Pokémon or a trainer the ROM is reshuffled and your Pokémon data is pushed back into memory. Life goes on. Unless you go somewhere where there are no preprogrammed encounter variables.

The last things your Gameboy sees before it freaks out.

Cinnabar is an interesting place. Pictured above is the small nondescript island you come across later in the game. The player can cross water using a Pokémon move called surf. You spend most of the time surfing in water tiles which have a trigger that allows you to encounter Pokémon, but if you notice, at the edge of the island, there is a tile set that indicates the end of the land and beginning of the water. This is the cause of all the trouble. Cinnabar island itself has no data for Pokémon encounters (a trait it shares with the location you find the Old Man in.) When you surf into any of the water tiles surrounding Cinnabar island a different area’s Pokémon encounter data is loaded and you can now find Pokémon. However, if you stay strictly on the border between the land and the water that data never loads. You can now encounter Pokémon, but where in the world is that data coming from?

The same memory that the Old Man encounter used to store the Pokémon information for the encountered Pokémon. If the player uses the Fly ability to visit Cinnabar island without ever entering an area with data for Pokémon encounters then that data is never changed. The game is essentially checking Garbage data looking for encounter information. What it sometimes spits out is an incorrect number pertaining to the Pokémon ID. Enter Missingno.

Catching this garbled mess of a Pokémon fills up the memory your Pokémon team is stored in with all sorts of interesting and unintended data. The stats can be funky, the level is usually wildly out of scope and generally it throws off a ton of other triggers that the game uses to execute its logic. This can lead to awesome effects, such as duplicating the ever valuable Master Ball ad infinitum, and detrimental effects like bricking your entire save file.

The 8 and 16 Bit eras of gaming are chock full of stories like this one of small optimizations creating wild glitches, and while the days of needing to shave KBs off of our projects is thankfully, mostly at a close, it’s important to remember how thankful we should be for the 8 GBs or RAM present in most modern machines. I encourage anyone reading this to dabble in the art of 8 bit programming. It’s a fun challenge and can often lead to greater knowledge about the advancements we’ve made in this age of computing.

--

--

Will Avery

Student at Flatiron School, Chicago. Former musician, current nerd, former dork.