Common Data Types: Difference between revisions

From Burnout Wiki
Content added Content deleted
mNo edit summary
m (Link RW data types where relevant.)
 
(18 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{hatnote|This page is for types used in Takedown-era games. For types used in Paradise, see [[Common Data Types (Burnout Paradise)]]. For types used in Criterion NFS games, see [[Common Data Types (Need for Speed)]].}}
= GtRGB =

{|class="wikitable"
Data types used commonly by the pre-Paradise Burnout games.

= Numeric =
=== CGtV3d ===
A structure comprised of three floating-point component values (x, y, z), bundled into a single unsigned 128-bit value <code>mData</code>. See also <code>[[RenderWare Data Types#RwV3d|RwV3d]]</code>.

Often used to represent a point in 3D space.
{| class="wikitable"
! Offset !! Length !! Type !! Description
|-
|-
| 0x0 || 0x4 || RwReal || X component
!Offset
!Name
!Type
|-
|-
| 0x00 || Red additive || float
| 0x4 || 0x4 || RwReal || Y component
|-
|-
| 0x04 || Green additive || float
| 0x8 || 0x4 || RwReal || Z component
|-
| 0x08 || Blue additive || float
|-
|-
| 0xC || 0x4 || ||Padding
|}
|}


= Matrix3x4 =
=== CGtV3dPlus ===
Very similar to the CGtV3d type, but includes an additional "plus" component. This extra component may be used to represent a different, but related quantity e.g. length.
{|class="wikitable"

{| class="wikitable"
! Offset !! Length !! Type !! Description
|-
|-
| 0x0 || 0x4 || RwReal || X component
!Offset
!Name
!Type
|-
|-
| 0x00 || Right || Vector3
| 0x4 || 0x4 || RwReal || Y component
|-
|-
| 0x10 || Up || Vector3
| 0x8 || 0x4 || RwReal || Z component
|-
|-
| 0x20 || At || Vector3
| 0xC || 0x4 || RwReal || Plus component
|-
| 0x30 || Position || Vector3
|}
|}


= Geometric =
= GtTexture/RwRaster =
=== CGtPlane ===
'''Textures''' on the PlayStation 2 and PlayStation Portable Burnout games are of type <code>CGtTexture</code> and stored as uncompressed bitmaps, with CLUT4 (16-color) and CLUT8 (256-color) palettes.
A structure representing [https://en.wikipedia.org/wiki/Euclidean_planes_in_three-dimensional_space a flat 2D plane in 3D space]. Equivalent to <code>[[RenderWare Data Types#RwPlane|RwPlane]]</code>.

{| class="wikitable"
=== PS2 ===
! Offset !! Length !! Type !! Description
{|class="wikitable"
|-
|-
| 0x0 || 0x10 || [[#CGtV3d|CGtV3d]] || Normal
! Offset
! Name
! Type
! Value
! Notes
|-
|-
| 0x0 || 0x10 || RwReal || Length
! colspan="5" | CGtTexture
|-
| 0x00 || Raster graphic || RwRaster || ||
|-
! colspan="5" | RwRaster
|-
| 0x00 || Parent raster offset || RwRaster* || ||
|-
| 0x04 || Pixels offset || word* || || Pointer to raster's bitmap
|-
| 0x08 || Palette offset || word* || || Pointer to raster's color palette
|-
| 0x0C || Bitmap width || int32 || ||
|-
| 0x10 || Bitmap height || int32 || ||
|-
| 0x14 || Bitmap depth || int32 || ||
|-
| 0x18 || Stride || int32 || ||
|}
|}


=== PSP ===
=== CGtSphere ===
A structure representing a sphere in 3D space, with a position and radius.
The version used on Burnout PSP uses a different header and swizzling method.
{|class="wikitable"
{| class="wikitable"
! Offset !! Length !! Type !! Description
|-
|-
| 0x0 || 0x10 || [[#CGtV3d|CGtV3d]] || Position
! Offset
! Name
! Type
! Value
! Notes
|-
|-
| 0x08 || Palette pointer || word* || ||
| 0x0 || 0x10 || RwReal || Radius
|-
| 0x0C || Bitmap width || int32 || ||
|-
| 0x10 || Bitmap height || int32 || ||
|-
| 0x38 || Pixels pointer || word* || ||
|-
| 0x84 || Pixel mode || int32 || || 0x04 = CLUT4, 0x05 = CLUT8
|-
| 0x8C || Texture name || char[20] || ||
|-
| 0xB0 || Palette count || int8 || ||
|-
| 0xB1 || Palette index || int8 || ||
|-
| 0xB2 || Texture level count || int8 || ||
|-
| 0x104 || Is swizzled? || bool || ||
|}
|}


= GtV3d =
=== CGtLine ===
A structure comprised of two vectors. Used to represent a line in 3D space.
{|class="wikitable"
{| class="wikitable"
! Offset !! Length !! Type !! Name
|-
|-
| 0x0 || 0x10 || [[#CGtV3d|CGtV3d]] || mStartPoint
!Offset
!Name
!Type
|-
|-
| 0x10 || 0x10 || [[#CGtV3d|CGtV3d]] || mEndPoint
| 0x00 || Data || RwV3d
|}
|}


=== RwV3d ===
=== CGtMatrix3x4 ===
A structure comprised of four 3D vectors. Equivalent to <code>RwMatrix</code>.
{|class="wikitable"
{| class="wikitable"
! Offset !! Length !! Type !! Name
|-
|-
| 0x0 || 0x10 || [[#CGtV3d|CGtV3d]] || mRight
!Offset
!Name
!Type
|-
|-
| 0x00 || X || float
| 0x10 || 0x10 || [[#CGtV3d|CGtV3d]] || mUp
|-
|-
| 0x04 || Y || float
| 0x20 || 0x10 || [[#CGtV3d|CGtV3d]] || mAt
|-
|-
| 0x08 || Z || float
| 0x30 || 0x10 || [[#CGtV3d|CGtV3d]] || mPos
|}

=== CGtAxisAlignedBox ===
Equivalent to <code>[[RenderWare Data Types#RwBBox|RwBBox]]</code>.

{| class="wikitable"
! Offset !! Length !! Type !! Name !! Description
|-
| 0x0 || 0x10 || [[#CGtV3d|CGtV3d]] || mSup || Supremum vertex
|-
|-
| 0x10 || 0x10 || [[#CGtV3d|CGtV3d]] || mInf || Infimum vertex
| 0x0C || Padding || word
|}
|}


=== CGtOrthogonalBox ===
= RwBBox =
{|class="wikitable"
{| class="wikitable"
! Offset !! Length !! Type !! Name
|-
|-
| 0x0 || 0x40 || [[#CGtMatrix3x4|CGtMatrix3x4]] || mBox
!Offset
!Name
!Type
|-
| 0x00 || Supremum value || RwV3d
|-
| 0x10 || Infimum value || RwV3d
|}
|}

=== CGtRGBA ===
A structure used to represent an RGBA color. It is an alias of the type <code>CGtV4d</code>.

= Hashes =
=== CGtHash ===
A derivative of CRC-32 — a 32-bit value storing the hash of a given string, generated via a custom hash function. These hashes are used by the Takedown-era games to identify and properly assign values within files such as the [[Value Database]].

=== GtID ===
A data type used in many Criterion games as an identifier for objects. It is an alias of the type <code>uint64_t</code> and is used to store a compressed ASCII string.

For example, the string <code>BURNOUT</code> would be represented by the GtID <code>6226094955724800000</code>.

Latest revision as of 00:36, 28 April 2023

Data types used commonly by the pre-Paradise Burnout games.

Numeric

CGtV3d

A structure comprised of three floating-point component values (x, y, z), bundled into a single unsigned 128-bit value mData. See also RwV3d.

Often used to represent a point in 3D space.

Offset Length Type Description
0x0 0x4 RwReal X component
0x4 0x4 RwReal Y component
0x8 0x4 RwReal Z component
0xC 0x4 Padding

CGtV3dPlus

Very similar to the CGtV3d type, but includes an additional "plus" component. This extra component may be used to represent a different, but related quantity e.g. length.

Offset Length Type Description
0x0 0x4 RwReal X component
0x4 0x4 RwReal Y component
0x8 0x4 RwReal Z component
0xC 0x4 RwReal Plus component

Geometric

CGtPlane

A structure representing a flat 2D plane in 3D space. Equivalent to RwPlane.

Offset Length Type Description
0x0 0x10 CGtV3d Normal
0x0 0x10 RwReal Length

CGtSphere

A structure representing a sphere in 3D space, with a position and radius.

Offset Length Type Description
0x0 0x10 CGtV3d Position
0x0 0x10 RwReal Radius

CGtLine

A structure comprised of two vectors. Used to represent a line in 3D space.

Offset Length Type Name
0x0 0x10 CGtV3d mStartPoint
0x10 0x10 CGtV3d mEndPoint

CGtMatrix3x4

A structure comprised of four 3D vectors. Equivalent to RwMatrix.

Offset Length Type Name
0x0 0x10 CGtV3d mRight
0x10 0x10 CGtV3d mUp
0x20 0x10 CGtV3d mAt
0x30 0x10 CGtV3d mPos

CGtAxisAlignedBox

Equivalent to RwBBox.

Offset Length Type Name Description
0x0 0x10 CGtV3d mSup Supremum vertex
0x10 0x10 CGtV3d mInf Infimum vertex

CGtOrthogonalBox

Offset Length Type Name
0x0 0x40 CGtMatrix3x4 mBox

CGtRGBA

A structure used to represent an RGBA color. It is an alias of the type CGtV4d.

Hashes

CGtHash

A derivative of CRC-32 — a 32-bit value storing the hash of a given string, generated via a custom hash function. These hashes are used by the Takedown-era games to identify and properly assign values within files such as the Value Database.

GtID

A data type used in many Criterion games as an identifier for objects. It is an alias of the type uint64_t and is used to store a compressed ASCII string.

For example, the string BURNOUT would be represented by the GtID 6226094955724800000.