Common Data Types (Burnout Paradise)

From Burnout Wiki
Revision as of 07:13, 2 November 2021 by Burninrubber0 (talk | contribs) (Created page.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Some of the more commonly seen data types in Burnout Paradise. This list is WIP.

Set/Array

A Set or Array is a contiguous series of elements of a specified data type, followed by the number of elements. Though technically separate, Set and Array have the same structure.

Typically, the element count is succeeded by 4 bytes of padding; however, as seen in Profile 1.9, it may have no padding.

As an example, the below is the structure of Set<uint16_t, 8>.

Offset Size Type Name Description
0x0 0x10 uint16_t[8] maElements The elements in the array
0x10 0x4 uint32_t muLength The number of elements in the array
0x14 0x4 padding

BitArray

As the name would suggest, a BitArray is an array of bits. Unlike an Array, the element count is not part of the structure, making it hardcoded.

Note that a BitArray is stored as a series of uint64_t. This can be confusing if the data is in little endian byte order. Due to this, every BitArray, even when below 64 bits in length, is padded to 64 bits.

The below is the structure of BitArray<200>. Notice how even though the bits only take up 0x19 bytes, 0x20 bytes are allocated.

Offset Size Type Name Description
0x0 0x20 uint64_t[4] maxBits The elements in the array

CgsID

A CgsID, though technically just a typedef of uint64_t, is heavily used across the game. Its original intent appears to be as a new moniker for GtID, Criterion's in-house compressed string type, and it sees extensive use in this role. However, at times, it is also used to store the IDs colloquially referred to as GameDB IDs. Conversely, GameDB IDs are not always stored as a CgsID, commonly being a normal uint64_t or uint32_t instead.

Name Type Size
CgsID uint64_t 0x8

Vectors

Criterion used several vector formats, including Vector3, Vector3Plus, and Vector4. Todo.

Matrices

Criterion used several matrix formats, including Matrix33, Matrix44, and Matrix44Affine. Todo.

Hashes

Criterion used several hash formats, including HashInt/TypeID (AttribSys), ID (Bundle), and CgsSound::PlayBack::Hash (Registry). Todo.