Data types

From Cities: Skylines Wiki
Jump to navigation Jump to search

This page describes common binary data types used by Cities: Skylines, and most modern day computer applications, internally.

Properties[edit]

Endianness[edit]

All data stored in computers are stored in single, small unit of data called a "byte". Larger units of data are split into multiple bytes. The order in which sequential bytes are assembled together to form a larger unit of data is referred to as it's "endianess". All data saved locally by Cities:Skylines is stored in "little"-endian format. For more information about endianness, please see the Wikipedia entry.

Signedness[edit]

Another property of data types is it's signedness. Please see the wikipedia entry. Data types without a u- prefix are signed, and those marked with a u- prefixed are unsigned. The type of signedness is generally abstracted away though native API methods.

Numeric Data Types[edit]

uint16[edit]

2 byte long unsigned integer type. Also referred to as a "short".

uint32[edit]

4 byte long unsigned integer type. Also referred to as a "int". The most common in Cities: Skylines.

uint64[edit]

8 byte long unsigned integer type. Also referred to as a "long".

Other Data Types[edit]

pstr[edit]

Strings in Cities: Skylines are stored Pascal-style – they're a variable length data type with two fields: an integer field describing how many bytes long the string data is, and then the string data itself. This differs from c style strings. In Cities: Skylines, similar to many other modern day software applications, appear to solely use a 2 byte long uint16 to designate the string length.