Map Organization
Maps are organized into three categories defined inconstants/map_constants.asm:
Map Constants
Themap_const macro defines each map with its ID, width, and height:
The
map_const macro automatically generates three constants:PALLET_TOWN=$00(map ID)PALLET_TOWN_WIDTH=10(width in tiles)PALLET_TOWN_HEIGHT=9(height in tiles)
Map Dimensions
Maps vary significantly in size:| Map Type | Typical Width | Typical Height | Example |
|---|---|---|---|
| Small Town | 10 tiles | 9 tiles | Pallet Town |
| Large City | 20-25 tiles | 18 tiles | Celadon City |
| Small Route | 10 tiles | 18-27 tiles | Route 1 |
| Long Route | 10 tiles | 36-72 tiles | Route 2, Route 17 |
| Wide Route | 30-45 tiles | 9 tiles | Route 4 |
| Indoor | 4-7 tiles | 4-9 tiles | Red’s House |
Route 17 (10×72 tiles) is the tallest map, representing the long bike path. Route 4 (45×9 tiles) is the widest route.
Indoor Map Groups
Indoor maps are grouped with their outdoor locations usingend_indoor_group:
Map Data Files
Each map has associated data files:Block Data (.blk)
Tile layout stored inmaps/*.blk as binary block data:
Block vs Tile System
Block vs Tile System
Maps use a two-level tile system:
- Blocks: 4×4 tile groups with a single ID
- Tiles: Individual 8×8 pixel graphics
Map Headers
Map headers indata/maps/map_header_pointers.asm point to:
- Tileset ID
- Map dimensions
- Block data pointer
- Text pointers
- Script pointers
- Connection data
Map Connections
Large outdoor maps can connect to adjacent maps:When the player walks to the edge of a connected map, the game seamlessly loads the adjacent map without a transition screen.
Map Headers Structure
Each map header contains:Tilesets
Tilesets define which blocks are available on a map. Fromconstants/tileset_constants.asm:
- Block definitions (which tiles make up each block)
- Collision data (which blocks are walkable)
- Graphic tile pointers
- Animated tile data
Sprite Sets
Maps reference sprite sets that determine which overworld sprites can appear:Map Scripts
Maps can have scripts that execute when:- Player enters the map
- Player presses A on an object
- Player walks on specific tiles (script tiles)
- Special events trigger
Map Objects
Each map can contain:NPCs
NPCs
Trainers, Gym Leaders, shopkeepers, and other characters with dialogue and behavior.
Items
Items
Visible Poké Balls containing items, retrievable once per save file.
Hidden Items
Hidden Items
Warps
Warps
Tile-based teleporters that move the player to different maps.
Signs
Signs
Readable signs with text messages.
Warp System
Warps connect maps together:- Fade out current map
- Load destination map
- Place player at warp destination coordinates
- Fade in new map
Wild Encounter Data
Maps with wild Pokémon reference encounter tables fromdata/wild/:
- Grass encounters
- Water encounters (Surf)
- Fishing encounters (Old/Good/Super Rod)
Map Music
Each map has an associated music track stored indata/maps/songs.asm:
Special Maps
Route 23
The longest route in the game (10×72 tiles), with badge requirement gates.Seafoam Islands
Multi-level dungeon with puzzle elements requiring Strength to manipulate boulders.Safari Zone
Multiple connected maps with a step counter and special battle mechanics.Unused Map
Overworld
Player movement and collision
Audio
Map music assignments
Reference
Map constants and data
Architecture
Map data organization
Key Files
constants/map_constants.asm- Map IDs and dimensionsconstants/tileset_constants.asm- Tileset definitionsmaps/*.blk- Binary map block datadata/maps/map_header_pointers.asm- Map header pointersdata/maps/map_header_banks.asm- ROM bank organizationdata/maps/sprite_sets.asm- Sprite set assignmentsdata/maps/songs.asm- Music track assignmentsmaps.asm- Main map assembly file