pokeplatinum/docs/maps/README.md
Kuruyia eab4f9a4ad Start Markdown documentation of the maps system
This starts a human-readable documentation of the various subsystems
used in the game's map system. The following files are included in this
commit:

- `maps.md`: a general overview of maps
- `bdhc.md`: an overview of the BDHC subsystem, which is used to provide
  height information on maps
- `loading_maps.md`: an overview of how maps are loaded by the game
- `file_format_specifications.md`: specs for the maps data structures

The `file_format_specifications.md` is meant to be a purely technical
document that contains a precise description of the data structures used
by the game's map system.

The other files are meant to be semi-technical documentation, where some
of the nitty-gritty details have been either simplified or left out
entirely.

Some of the maps subsystems were purposefully left out of this commit,
such as map objects and map scripts. They will need to be addressed in
future updates to those documents.

Signed-off-by: Kuruyia <github@kuruyia.net>
2025-03-16 21:40:56 +01:00

3.1 KiB

Map documentation

This section of the documentation aims to provide an overview of the different map-related subsystems, the interaction between them, and how they load their data from the ROM so that, in the end, the game can seamlessly render a world in which the player moves.

Glossary

  • Area: a collection of maps that load the same set of textures and map prop models.
  • BDHC: contains data used to calculate the height of the terrain. Used for collision detection and the map objects height, for example.
  • Map: a 2D grid of 32x32 tiles that form part of the game's world.
  • Map header: a structure that contains metadata about a map, such as its music, its name, whether cycling is allowed, etc. Each map is associated with a map header, and has a specific, well-known ID.
  • Map matrix: a 2D array of maps that form a playable area. This system allows the game to dynamically load and unload maps as the player moves around the world. The overworld is one such example of a map matrix, containing 30x30 maps.
  • Map object: an entity that is placed on the map. Examples include the player and NPCs.
  • Map prop: a 3D model that is placed on the map. Examples include the various buildings encountered throughout the game, but also interior furniture, honey trees, etc.
  • NARC: Nitro ARChive, a file format used by Nintendo DS games to store files. (think archive as in a .tar file, a file that contains files)
  • NSBCA/NSBTA: a file format used to store animations for 3D models for the Nintendo DS. See apicula's documentation for more information.
  • NSBMD: a file format used to store 3D models, textures and palettes for the Nintendo DS. See apicula's documentation for more information.
  • NSBTX: a file format used to store textures and palettes for the Nintendo DS. See apicula's documentation for more information.

What's in this directory?

  • maps.md: a general overview of maps
  • bdhc.md: an overview of the BDHC subsystem, which is used to provide height information on maps
  • loading_maps.md: an overview of how maps are loaded by the game
  • file_format_specifications.md: a more technical description of the different files and their data structures that are used to store map data

Credits

  • Mikelan98 and HumanGamer for their initial work on BDHC (here and here)
  • HiroTDK for their comprehensive documentation on the file formats used in HeartGold and SoulSilver (here)
  • scurest for their work on apicula and the associated documentation (linked above)