The overworld (field) is the layer players explore between battles. It is driven byDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/pret/pokeemerald/llms.txt
Use this file to discover all available pages before exploring further.
src/overworld.c and composed of maps, tilesets, event objects, scripts, weather, and field move effects.
Map structure
Each in-game map lives in its own subdirectory underdata/maps/. A map consists of:
data/layouts/ and point to the two tilesets the map uses:
Every map uses exactly two tilesets: a primary tileset (terrain, water, ground) and a secondary tileset (buildings, decoration, map-specific tiles). Both are defined under
data/tilesets/.Metatile behaviors
Metatile behaviors control how the player and NPCs interact with each tile. Constants are defined ininclude/metatile_behavior.h as MB_* values.
src/field_player_avatar.c and src/metatile_behavior.c.
Event types
Events are defined per-map in theevents.inc file and fall into four categories:
Object events (NPCs)
Object events (NPCs)
Object events are sprites placed on the map. Each has a movement type, script pointer, flag, and trainer sight range (if applicable).Object event graphics and movement types are defined in
include/constants/event_objects.h and src/event_object_movement.c.Warp events
Warp events
Warp events teleport the player to another map and position when stepped on.Warp processing is handled in
src/overworld.c and src/field_control_avatar.c.Coordinate events
Coordinate events
Coordinate events trigger a script when the player steps on a specific tile. Used for invisible triggers, zone transitions, and forced camera pans.
Background events
Background events
Background events are scriptable tiles the player can interact with by pressing A while facing them (signs, bookshelves, item balls, hidden items).
Field move effects
HM and field move effects are implemented in dedicated source files:| Source file | Field move |
|---|---|
src/fldeff_cut.c | Cut — removes cuttable trees (MB_CUT) |
src/fldeff_dig.c | Dig / Escape Rope — warps player out of dungeon |
src/fldeff_flash.c | Flash — reveals dark cave lighting |
src/fldeff_rocksmash.c | Rock Smash — breaks MB_ROCK_SMASH boulders |
src/fldeff_strength.c | Strength — enables pushing MB_STRENGTH_PUZZLE_BOULDER boulders |
src/fldeff_sweetscent.c | Sweet Scent — triggers a wild encounter immediately |
src/fldeff_teleport.c | Teleport — warps player to last Pokémon Center |
src/fldeff_softboiled.c | Soft-Boiled / Milk Drink — field HP restore |
src/fldeff_misc.c | Miscellaneous field effects |
src/fldeff_escalator.c | Escalator movement effect |
Overworld engine
src/overworld.c is the main field game loop. It manages:
- Loading and transitioning between maps
- Player input routing (movement, menu, interaction)
- Field object (NPC) step-cycle updates
- Script context execution each frame
- Camera and background scrolling
Map load
On a map transition,
LoadMapFromCameraTransition or LoadMap sets up tileset data, object events, scripts, and BGM.Field loop
FieldCB_ContinueScriptHandleMusic runs every frame: it updates objects, checks coordinate events, and steps the script engine.Weather
Weather state is managed by two source files:| Source file | Role |
|---|---|
src/field_weather.c | Weather type tracking, transition scheduling, palette fade |
src/field_weather_effect.c | Per-weather-type particle effects (rain drops, snowflakes, sandstorm tiles, etc.) |
include/constants/weather.h as WEATHER_* constants. The current weather is set via the setweather and doweather script commands.