Terrain subfiles

From SC4D Encyclopaedia
Jump to navigation Jump to search

Terrain Map (0xa9dd6ff4)

This subfile contains the terrain information of a city tile. A completely flat city, as generated by the game when creating a new region, will have 270 as height for every vertex. Default water level of the game is a few meters below.

Structure

Note: the terrain map is one of the few Savegame subfiles that does not include a CRC checksum. This has been used to great advantage: programs like SC4 Terraformer populate this subfile. If this file would have used a CRC checksum, then such tools would not have been possible as long as the CRC checksum algorithm wasn't known (which was only the case 16 years after the game's release!)

WORD       Version (0x0002)
FLOAT x n  65x65 for small cities, 129x129 for medium cities, 257x257 for large cities

Terrain Flags (0x8a91e7e0)

Also known as cSTETerrain::SaveVertexProperties. This file determines what terrain tiles get rendered by the game. It holds values for every terrain vertex, but it actually tells something about the tiles. Each tile is identified by the north-west corner vertex.

Structure

WORD      Version (always 0x0001)
WORD x n  65x65 for small , 129x129 for medium, 257x257 for large.
            0x0000 = terrain tile is rendered
            0x0200 = terrain tile is not rendered. All non-zero values seem to have the same effect though.

Terrain Bounding Box (0x8a91e7e3)

Also known as cSTETerrain::SaveMiscTerrainData.

Structure

WORD      Version (0x0002)
DWORD     X size (65, 129, 257)
DWORD     Z size (65, 129, 257)
FLOAT     Min height
FLOAT     Max height
FLOAT     Unknown (only seen 308)

cSTETerrain (0xe98f9525)

Structure

DWORD    Size (always 22)
DWORD    CRC
DWORD    Memory address
WORD     Version (always 0x0002)
DWORD    Memory address of the cSTETerrainView3D file
DWORD    Type ID of cSTETerrainView3D (0xc9b84e10)

cSTETerrainView3D (0xc9b84e10)

Structure

DWORD    Size (always 15)
DWORD    CRC
DWORD    Memory address
WORD     Version (always 0x0001)
BYTE     0x00 if the grid is turned off, 0x01 if on