Terrain subfiles

From SC4D Encyclopaedia
Revision as of 02:10, 18 December 2024 by Seba (talk | contribs) (Created page with "= 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...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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

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 (0x0xc9b84e10)

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