Terrain: Difference between revisions

Torphedo (talk | contribs)
Add lots of known terrain info
Torphedo (talk | contribs)
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}}.