The Glitchhouse · Pokemon Red, Blue and Yellow

Glitch City

Walk off the edge of the world in Pokemon Red or Blue and the game does not stop you. It just runs out of map, and builds you a city out of whatever it finds next.

Decoded from a Pokemon Red ROM · part of The Glitchhouse

Every town in the game is a grid of blocks, and every block is a small square of tiles the game keeps in a list. When you step past the last real map, through a gap the Safari Zone can open, the game keeps reading blocks anyway, straight out of memory that was never meant to be a map. What it draws is Glitch City: real streets and walls and water, shuffled into a place that was never designed, sometimes beautiful, often a trap.

The way in

You do not stumble into Glitch City by accident. It takes a specific, well-known trick with the Safari Zone's timer, worked out and shared by the glitch community over many years. Tick through the route.

The Safari Zone runs on a 500-step timer, and the exit gate is a warp. Trigger the "leave?" prompt at the exact step the timer expires and your position desyncs, letting you walk through walls, off the map, and into the garbage. Practice it on an emulator with save states; on a cartridge, save first.

How a map is built

To understand Glitch City you have to know how a normal map is made. It is not drawn pixel by pixel. It is a grid, and every cell holds one block, a four by four square of tiles chosen from a set. Here is the real Kanto overworld block set. Pick a block, paint the map, and see a town take shape, or hit Random and watch it become a Glitch City.

THE BLOCK SET (128 real blocks)
YOUR MAP (tap to place)
Every real map is a tidy arrangement of these blocks: grass here, a house there, a path between. Glitch City is the same block set with the cells filled by whatever bytes the game finds in memory, which is why it looks like a town that no one designed.

Why it breaks

So where does the garbage come from? The game keeps one pointer to where the current map's blocks live in memory. Walk off the end of a real map, through a bad connection, and that pointer keeps advancing into memory that was never a map. It reads those bytes as block numbers anyway. Slide the pointer and watch a clean map slip into Glitch City.

The pointer does not know where the map ends. Every step past the real data, it reads the next bytes in memory and draws them as blocks, so the town dissolves tile by tile into a place made of leftovers. That place is Glitch City.

Walk around in it

This is a real Glitch City, not a mock-up: every block below was pulled byte for byte out of an actual Safari-Zone-glitch save state, exactly as the game read it out of bounds. Try to walk through it. The game only lets you stand on its short list of walkable tiles, and Glitch City is mostly everything else, so you bounce off nearly every block and pick your way through a maze that was never meant to be one.

Every block here is a real piece of Kanto, a wall, a rooftop, a patch of sea, placed by whatever was in memory. There is no exit on foot, only more of it, which is exactly why it can trap a save. Use the pad or the arrow keys.

Solid or air

Here is the cruel part. The game has a short list of tiles you are allowed to stand on, grass, floors, a few paths, and everything else is a wall. Glitch City is mostly everything else. Tap any block to see its tiles checked against the real list, and count how few let you through.

Tap a block to test it against the game's walkable-tile list.
Green tiles are on Pokemon's short list of walkable tiles; red tiles are solid. A block only lets you step onto it if the tile under your feet is green. In a random field of blocks almost everything is a wall, so you inch through a maze with no way out. That is how Glitch City eats a cartridge save.

Where you stand becomes what you fight

Here is the deepest cut, and it is why Glitch City is more than scenery. The game keeps one pointer, wMapViewVRAMPointer, aimed at the top-left corner of the screen so it knows where to draw as you scroll. Ordinarily that is housekeeping. But trip a glitched map script out here and the game goes hunting for a trainer that does not exist, reads clean past the end of the trainer list, and lands on that very pointer. Its low byte becomes a trainer class. Take one step and you have changed who you fight.

wMapViewVRAMPointer = $9800
low byte read as class 0
The pointer starts at $9800, the top-left of the visible map. A step sideways moves it by two, a step up or down by sixty-four, wrapping inside a single byte. When a glitch map script reads a trainer that is not there, that low byte is the class it fights you with. Classes past 47 have no real trainer, so your position summons a glitch one, the same family as ZZAZZ. Mechanism documented by the Glitch City Research Institute.

How to get out

If walking will not save you, what will? A few moves force the game to throw away the garbage and load a real map again. Try each one and see which actually works.

Fly and Teleport are the clean way out: both drop you in a town and load a real map over the corruption. Dig and Escape Rope only work if the glitched map counts as a dungeon. A reset costs you everything since your last save. On foot, there is no exit at all.

Is it dangerous

Glitch City has a scary reputation, and most of it is a misunderstanding. It rarely scrambles your save on its own. The real hazard is simpler and meaner: getting stranded with no way out and no recent save. How bad that is depends only on where you are playing.

The block system is identical everywhere the game runs, so Glitch City appears on all of them. What differs is your safety net: an emulator's save states make it a harmless playground, the 3DS has restore points, and a cartridge has nothing but the save you made before you went in.

From the ROM

One last look under the hood, straight from the cartridge. Every block in the game, real map or Glitch City, is exactly sixteen numbers, each one pointing at an 8 by 8 tile. Slide through the real block set and watch a block break into its tiles.

Sixteen tile numbers, nothing more. A real map arranges them into towns; Glitch City fills the same sixteen slots with whatever bytes happen to be in memory. Same pieces, no plan. That is the entire glitch, decoded from the block set.

Where to go next

Glitch City is one of a family of glitches where the game reads memory it should not. Here are its closest relatives.

MissingNo.The coast twinThe same idea one door over: memory read as a Pokemon instead of a map, on the very coast you reach it from. Super GlitchMemory as a moveA move with no name that reads raw memory and writes it back, corrupting the game from the inside. The GlitchhouseEvery specimenThe full collection of Gen 1 glitches, each one decoded from the ROM and made playable.

Go deeper: arbitrary code execution | the Gen 1 battle engine | browse the Glitchhouse.

Go deeper: MissingNo. | Super Glitch | browse the Glitchhouse.