Terrain: Difference between revisions
Add lots of known terrain info |
Add SSTERA filename info |
||
| Line 10: | Line 10: | ||
Tiles are organized in a [[wikipedia:Z-order_curve|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. | Tiles are organized in a [[wikipedia:Z-order_curve|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. | ||
The SSTERA filenames look like <code>5XYYYYYYYY.[type].sstera</code>, the X being the detail level and the 8 Y digits being the first tile ID in hexidecimal. For example, <code>580000C0A0.hght.sstera</code> has HGHT tiles <code>0xC0A0 - 0xC0A3</code> at detail level 8 (some of those tiles might not exist). | |||
=== How tiles are used at runtime === | === How tiles are used at runtime === | ||
{{Subsystem infobox|name=Terrain|is_name_official=1|description=-|init_addr_switch150=000000710114961C}}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. | {{Subsystem infobox|name=Terrain|is_name_official=1|description=-|init_addr_switch150=000000710114961C}}In normal gameplay, HGHT tiles are only used for rendering and IK (for Link, NPCs, and possibly monsters{{Check}}). 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}}. | 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}}. | ||
Latest revision as of 19:34, 31 August 2026
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.
The SSTERA filenames look like 5XYYYYYYYY.[type].sstera, the X being the detail level and the 8 Y digits being the first tile ID in hexidecimal. For example, 580000C0A0.hght.sstera has HGHT tiles 0xC0A0 - 0xC0A3 at detail level 8 (some of those tiles might not exist).
How tiles are used at runtime
| 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[check]). 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].