Terrain

From ZeldaMods (Breath of the Wild)
Revision as of 19:27, 31 August 2026 by Torphedo (talk | contribs) (Add lots of known terrain info)
Jump to navigation Jump to search

BOTW's terrain is a heightmap, with up to 2 blended ground textures at any given point. There are separate heightmaps for liquids (water/lava/mud) and grass. The heightmap files are found in SSTERA (Yaz0-compressed SARC) files in content/Terrain/A/[map name] (the map name being MainField or AocField). Each SSTERA contains 1-4 tiles of only 1 type of the 4 tile types:

  • HGHT (ground heightmap)
  • MATE (Ground texture assignments and texture blending)
  • grass.extm (Grass heightmap & color)
  • water.extm (Liquid type & heightmap)

File structure

HGHT and MATE tiles are always 256x256 pixels, while water and grass tiles are 64x64 pixels. There are 9 levels of detail (from 0 to 8), each covering the whole map with 4x the resolution of the last level. Level 0 is a single tile covering the entire map, while level 8 is a grid of 256x256 tiles. Levels 0-5 are completely filled out, but higher detail levels have holes or are mostly empty in vanilla (only about 10% of the level 8 grid is used).

Tiles are organized in a Z-Order Curve (see TSCB), which ensures that every 2x2 area of tiles have contiguous IDs (e.g. tiles 400-403 are all next to each other in a 2x2 area), and makes nearby tiles more likely to have similar IDs. Each SSTERA file is a compressed SARC containing one of these 2x2 areas, which is why their filenames are always a multiple of 4. Each tile has a world position and size listed in the TSCB, but the filenames are consistent enough that you can reliably calculate this from the filenames alone. It's believed that the game uses the TSCB data to place tiles, but this hasn't been tested. At least some of the TSCB data is used, because the min/max height values affect culling.

How tiles are used at runtime

Terrain
Subsystem
Official name Yes
Description -
Init function Switch 1.5.0: 000000710114961C
Wii U 1.5.0: ???
Debug only No

In normal gameplay, HGHT tiles are only used for rendering and IK (for Link, NPCs, and possibly monsters). The collision actually comes from static Havok files in Content/Physics/TeraMeshRigidBody , but it will be regenerated from the HGHT tiles if those files are missing or invalid. It's unclear which detail level(s) are used to regenerate the collision.

MATE tiles are also used to determine the footstep sound, and particle effects (e.g. snow or dust clouds when riding the motorcycle). When up close, the grass height automatically matches the HGHT tiles, and its color automatically matches the ground textures. Presumably, the grass tiles override these defaults[check].