CRAP File Format

From Cities: Skylines Wiki
Jump to navigation Jump to search

Cities: Skylines uses an in-house file format called Colossal Raw Asset Package (.crp) to store various data. This document is intended to give an in-depth technical explanation of the file format.

CRP Header[edit]

This is the start of any .crp file.

Type Description
byte[4] CRP File Signature. Equal to "CRAP"
uint16 File format version Currently equals 6.
pstr Package name Encoded using UTF-8.
pstr Author Name The package author's name, encrypted. TODO
uint32 Package version TODO
pstr Main Asset Name A string representing the title of the main asset in this package. Encoded using UTF-8.
uint32 File Count The number of files contained in this package.
uint64 Data Offset The location in this file where the file data starts. This is added to each file's individual offset, and is usually right after the end of the crp header.
asset_entry[file_count] Asset Entires A list of asset entries. The length of this list is defined by the File Count above.

Following the CRP header and until the end of file exists space where each asset file resides.

Asset Entry[edit]

Much like a ZIP archive file, the CRP header contains meta data about each individual file, such as it's name and offset, for efficient file seeking and reading.

Type Description
pstr Name Name of the asset file. Encoded using UTF-8.
pstr Checksum The asset's checksum, encoded in ASCII hexadecimal. TODO.
uint32 Type This determines what type of asset this is, and how it should be parsed. See the Asset Types table below.
uint64 Offset The offset, in number of bytes, of where this asset is located in the CRP. This is added to the offset in the CRP header.
uint64 Size The size of the file, in bytes.

Additional asset metadata is located at the beginning of the file's data.

Asset Types[edit]

Value Description
1 Object
2 Material
3 Texture
4 Static Mesh
50 Text
51 Assembly
52 Data
53 Package
80 Locale
100 User
101 Save Game
102 Custom Map
103 Custom Asset
104 Color Correction (LUT)
105 District Style
106 Map Theme
107 Map Theme Map
108 Scenario