Common Data Types (Burnout Paradise): Difference between revisions

Hashes, page refinement
(Vectors and matrices.)
(Hashes, page refinement)
Line 1:
Some of the more commonly seen data types in Burnout Paradise. This list is WIP.
 
= SetCgsSet/ArrayCgsArray =
A <code>SetCgsSet</code>, or <code>ArraySet</code>, sometimes calledand <code>CgsSetCgsArray</code>, andor <code>CgsArrayArray</code>, is a contiguous series of elements of a specified data type, followed by the number of elements in use. If the elements are 64 bits long, the element count will usually (but not always) be succeeded by 4 bytes of padding; otherwise, it will have no padding.
 
Though technically separate, <code>Set</code> and <code>Array</code> have the same structure.
Line 18:
|}
 
= CgsBitArray/CgsFastBitArray =
= BitArray =
AsA the name would suggest<code>CgsBitArray</code>, aor <code>BitArray</code>, sometimesand called<code>CgsFastBitArray</code>, or <code>CgsBitArrayFastBitArray</code>, is ana contiguous array of bits. Unlike an <code>Array</code>, the element count is not part of the structure, making it hardcoded.
 
Note that a <code>BitArray</code> is stored as a series of <code>uint64_t</code>. This can be confusing if the data is in little endian byte order. Due to this, every <code>BitArray</code>, evenhas whena belowlength 64which bitsis in length, isa paddedmultiple toof 648 bitsbytes.
 
The below is the structure of <code>BitArray<200></code>. Notice how even though the bits only take up 0x19 bytes, 0x20 bytes are allocated.
Line 40:
|}
 
= VectorVectors =
Vectors in Burnout Paradise are structures made up of floats. They are primarily used for positional values but have been used in other cases, such as colors and gear ratios. Though a number of types besides floats are technically supported, they are seemingly never used.
 
Line 84:
| 0xC || 0x4 || float || w || W value
|}
= MatrixMatrices =
Matrices are structures made up of vectors. They see similar use to vectors but are three-dimensional rather than planar.
=== Matrix33 ===
Line 136:
 
= Hashes =
Burnout Paradise uses several different forms of hash. This section is meant to give a brief synopsis of them; their parent pages contain more information and context.
Criterion used several hash formats, including <code>HashInt/TypeID</code> (AttribSys), <code>ID</code> (Bundle), and <code>CgsSound::PlayBack::Hash</code> (Registry). Todo.
 
This list is incomplete and will be added to as time goes on.
=== CgsResourceID ===
A <code>CgsResourceID</code> is a 64-bit field storing a CRC32 hash of a given Bundle resource name. The 4 bytes preceding the hash are unused in Bundle 2 V2 and older, though later versions add fields which make extensive use of them.
{| class="wikitable"
|-
! Offset !! Size !! Type !! Name !! Description
|-
| 0x0 || 0x8 || uint64_t || mHash || CRC32 hash
|}
=== HashInt ===
<code>HashInt</code> is a typedef of <code>uint64_t</code>. It is used in AttribSysVault resources to refer to GameDB IDs which have been [https://bpr.bo98.uk/lookup8/ lookup8 encoded]. This type has several aliases, including <code>ExportID</code>, <code>Key</code>, <code>AssetID</code>, <code>Type</code>, and <code>TypeID</code>.
{| class="wikitable"
|-
! Name !! Type !! Size
|-
| HashInt || uint64_t || 0x8
|}
=== CgsSound::Playback::Name ===
This type is used in Registry resources and anything accessing streams through a Registry resource.
{| class="wikitable"
|-
! Offset !! Size !! Type !! Name !! Description
|-
| 0x0 || 0x8 || uintptr_t || mHash || Custom hash
|}
=== LanguageResourceHash ===
A <code>LanguageResourceHash</code>, though not explicitly defined as a type, is a bit inverted CRC32 hash (i.e., CRC32 with an output XOR of 0 instead of 0xFFFFFFFF) of the name of an entry in a Language resource. This name can usually be determined via the game's executable.