The world system is the outermost layer of Paper Mario’s game logic. It divides the overworld into areas — each a collection of related maps (rooms) — and manages loading, unloading, and transitioning between them. All world-facing source code lives underDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/pmret/papermario/llms.txt
Use this file to discover all available pages before exploring further.
src/world/, while the structs that describe areas and maps are declared in include/map.h.
Area and map naming convention
Every overworld location maps to a three-letter area code. The area directories undersrc/world/ follow the pattern area_<code>/, and individual map IDs use the format <area>_<room> (e.g. kmr_02).
| Directory | Area code | Location |
|---|---|---|
area_kmr/ | kmr | Goomba Road and surroundings |
area_mac/ | mac | Toad Town and Shooting Star Summit |
area_nok/ | nok | Koopa Bros. Fortress |
area_trd/ | trd | Dry Dry Ruins |
area_iwa/ | iwa | Mt. Rugged |
area_sbk/ | sbk | Dry Dry Desert |
area_isk/ | isk | Dry Dry Ruins interior |
area_mim/ | mim | Forever Forest |
area_arn/ | arn | Boo’s Mansion |
area_dgb/ | dgb | Gusty Gulch |
area_omo/ | omo | Shy Guy’s Toy Box |
area_kgr/ | kgr | Koopa Village |
area_jan/ | jan | Jade Jungle |
area_kzn/ | kzn | Mt. Lavalava |
area_flo/ | flo | Flower Fields |
area_tik/ | tik | Tubba Blubba’s Castle |
area_sam/ | sam | Shiver Region |
area_pra/ | pra | Crystal Palace |
area_kpa/ | kpa | Bowser’s Castle |
area_kkj/ | kkj | Peach’s Castle |
area_dro/ | dro | Dry Dry Outpost |
area_hos/ | hos | Shooting Star Summit |
area_gv/ | gv | Goomba Village |
area_obk/ | obk | Boo’s Mansion library |
area_osr/ | osr | Oscar’s Ship |
area_mgm/ | mgm | Mini-game island |
area_end/ | end | Ending sequence |
area_tst/ | tst | Test maps |
extern AreaConfig gAreas[29] in include/map.h and is zero-terminated.
Core structs
include/map.h defines the two structs that describe the static layout of the overworld.
AreaConfig
MapConfig
MapSettings
MapSettings is populated at runtime when a map loads. Its most important authored fields are:
The
main EVT script is the first thing that runs when a map loads. It typically spawns NPCs via MakeNpcs, sets up collision triggers, starts ambient audio, and launches any map-specific scripts.Map overlay structure
Each map is loaded as a DMA overlay. When you enter a room, the engine copies the overlay from ROM intodmaDest in RAM. The overlay contains:
- The compiled map geometry and collision (shape/hit files)
- The
MapSettingsstruct with themainEVT script - All per-map NPC data, item data, and entity spawn calls
- Area-specific texture and model assets
isAreaSpecificEntityDataLoaded in src/entity.c.
World state machine
The overworld game loop runs insrc/world/world.c. It manages a mode variable that selects between states such as WORLD_STATE_NORMAL (player in control), WORLD_STATE_CHANGE_MAP (transition in progress), and battle entry. The world state machine calls update_npcs, update_entities, and the per-map scripts every frame.
Map transitions
When Mario reaches an exit trigger, the engine picks a transition type based on the exit’s configuration. The transition EVT scripts are declared ininclude/script_api/map.h:
EntryList — a zero-terminated array of Vec4f values encoding the position and facing direction where Mario spawns for each entry index.
EVT map scripting API
The following callables frominclude/script_api/map.h are available to map EVT scripts:
| Callable | Purpose |
|---|---|
MakeNpcs | Spawn an NpcGroup into the world |
BasicAI_Main | Run the standard enemy patrol and chase AI |
MakeShop | Initialise a shop with item list and prices |
MakeShopOwner | Spawn the shop owner NPC |
CreateMapRoom | Register a room sub-area for sound zone control |
CheckActionState | Query the player’s current action state |
CreatePushBlockGrid | Initialise a grid of push blocks |
SetPushBlock | Set the state of a push block cell |
GetPushBlock | Read the state of a push block cell |
TeleportPartnerToPlayer | Move the partner NPC to Mario’s position |
Partner in the overworld
Active partner NPCs are managed separately from map NPCs. Their overworld logic lives insrc/world/partner/ and src/world/partners.c. The active partner follows Mario using NpcFollowData attached to its Npc::blur field.
Battle system
See how battles are loaded from area encounter data and how the state machine runs.
NPCs and entities
Learn about the NPC and entity structs that populate every map.
