Data Types: Difference between revisions
Battlepedia>Seil m (→Motion) |
Battlepedia>Seil (→Motion) |
||
Line 126: | Line 126: | ||
|- |
|- |
||
| 0x00 || byte || '''Type''' |
| 0x00 || byte || '''Type''' |
||
* 0 - Extend/Retract |
* 0 - Extend/Retract - Move to one position and back |
||
* 1 - Orbit |
* 1 - Orbit - Move around a center point |
||
* 2 - Spline |
* 2 - Spline - Unused, does nothing |
||
* 3 - Move Point |
* 3 - Move Point - Move along a [[MVPT|Move Point]] path |
||
* 4 - Mechanism |
* 4 - Mechanism - Slide along/rotate around a specific axis |
||
* 5 - Pendulum |
* 5 - Pendulum - Swing from side to side |
||
* 6 - None? |
* 6 - None? - no movement |
||
|- |
|- |
||
| 0x01 || byte (bool?) || '''Use Banking''' - unknown |
| 0x01 || byte (bool?) || '''Use Banking''' - unknown, always 0 |
||
|- |
|- |
||
| 0x02 || short || '''Flags''' |
| 0x02 || short || '''Flags''' |
||
⚫ | |||
* 4 - Stopped - If not set, the object starts moving on Scene Prepare. |
|||
|- |
|- |
||
! colspan="3" | Extend/Retract only |
! colspan="3" | Extend/Retract only |
||
|- |
|- |
||
| 0x04 || [[Vector3]] || '''Retract Position''' - Start position |
| 0x04 || [[Vector3]] || '''Retract Position''' - Start position |
||
|- |
|- |
||
| 0x10 || [[Vector3]] || '''Extend Delta Position''' - |
| 0x10 || [[Vector3]] || '''Extend Delta Position''' - Distance to move from start position |
||
|- |
|- |
||
| 0x1C || float || '''Extend Time''' - Move forward time |
| 0x1C || float || '''Extend Time''' - Move forward time |
||
|- |
|- |
||
| 0x20 || float || '''Extend Wait Time''' - Wait time after moving forward |
| 0x20 || float || '''Extend Wait Time''' - Wait time after moving forward |
||
|- |
|- |
||
| 0x24 || float || '''Retract Time''' - Move |
| 0x24 || float || '''Retract Time''' - Move backward time |
||
|- |
|- |
||
| 0x28 || float || '''Retract Wait Time''' - Wait time after moving |
| 0x28 || float || '''Retract Wait Time''' - Wait time after moving backward |
||
|- |
|- |
||
| 0x2C || byte[0x4] || null |
| 0x2C || byte[0x4] || null |
||
Line 156: | Line 158: | ||
! colspan="3" | Orbit only |
! colspan="3" | Orbit only |
||
|- |
|- |
||
| 0x04 || [[Vector3]] || '''Center''' - Point to |
| 0x04 || [[Vector3]] || '''Center''' - Point to move around |
||
|- |
|- |
||
| 0x10 || float || '''Width''' |
| 0x10 || float || '''Width''' - X scale of orbit |
||
|- |
|- |
||
| 0x14 || float || '''Height''' |
| 0x14 || float || '''Height''' - Z scale of orbit |
||
|- |
|- |
||
| 0x18 || float || '''Period''' |
| 0x18 || float || '''Period''' - Time it takes to complete one orbit |
||
|- |
|- |
||
| 0x1C || byte[0x14] || null |
| 0x1C || byte[0x14] || null |
||
Line 174: | Line 176: | ||
! colspan="3" | Move Point only |
! colspan="3" | Move Point only |
||
|- |
|- |
||
| 0x04 || unsigned int || '''Flags''' |
| 0x04 || unsigned int || '''Flags''' - Always 0 |
||
|- |
|- |
||
| 0x08 || [[Asset ID]] || '''[[MVPT|Move Point]] ID''' |
| 0x08 || [[Asset ID]] || '''[[MVPT|Move Point]] ID''' - Move Point to start at |
||
|- |
|- |
||
| 0x0C || float || '''Speed''' |
| 0x0C || float || '''Speed''' - Speed to move at, in units per second |
||
|- |
|- |
||
| 0x10 || byte[0x20] || null |
| 0x10 || byte[0x20] || null |
||
Line 184: | Line 186: | ||
! colspan="3" | Mechanism only (BFBB) |
! colspan="3" | Mechanism only (BFBB) |
||
|- |
|- |
||
| 0x04 || byte || '''Type''' |
| 0x04 || byte || '''Type''' |
||
*0 - |
*0 - Slide only |
||
*1 - Rotate only |
*1 - Rotate only |
||
*2 - |
*2 - Slide and Rotate at the same time |
||
*3 - |
*3 - Slide then Rotate |
||
*4 - |
*4 - Rotate then Slide |
||
All other values default to Rotate only |
|||
To do: investigate more values |
|||
|- |
|- |
||
| 0x05 || byte || '''Flags''' |
| 0x05 || byte || '''Flags''' |
||
*1 - Return to start - If set, the object moves forward and back in one cycle. If not set, the object only moves forward. |
|||
*0 - Single direction (never return) |
|||
*2 - Don't loop - If set, the object will run one cycle and stop. If not set, the object will continuously run cycles. |
|||
*1 - Move back and forth |
|||
*2 - Move on event |
|||
*3 - Move on event |
|||
To do: investigate more values and difference between 2 and 3 |
|||
|- |
|- |
||
| 0x06 || byte || '''Slide Axis''' |
| 0x06 || byte || '''Slide Axis''' |
||
Line 204: | Line 202: | ||
*1 - Y |
*1 - Y |
||
*2 - Z |
*2 - Z |
||
⚫ | |||
To do: investigate more values and see how some PLATs move in more than one direction |
|||
|- |
|- |
||
| 0x07 || byte || '''Rotate Axis''' |
| 0x07 || byte || '''Rotate Axis''' |
||
Line 211: | Line 207: | ||
*1 - Y |
*1 - Y |
||
*2 - Z |
*2 - Z |
||
*3 - Z? |
|||
To do: investigate more values and see how some PLATs rotate in more than one direction |
|||
|- |
|- |
||
| 0x08 || float || '''Slide Distance''' |
| 0x08 || float || '''Slide Distance''' |
||
Line 230: | Line 224: | ||
| 0x24 || float || '''Rotate Decel Time''' - Ease out time |
| 0x24 || float || '''Rotate Decel Time''' - Ease out time |
||
|- |
|- |
||
| 0x28 || float || ''' |
| 0x28 || float || '''Return Delay''' - Wait time after moving forward |
||
|- |
|- |
||
| 0x2C || float || '''Post- |
| 0x2C || float || '''Post-Return Delay''' - Wait time after moving backward |
||
|- |
|- |
||
! colspan="3" | Mechanism only (TSSM) |
! colspan="3" | Mechanism only (TSSM) |
||
|- |
|- |
||
| 0x04 || byte || '''Type''' |
| 0x04 || byte || '''Type''' |
||
*0 - |
*0 - Slide only |
||
*1 - Rotate only |
*1 - Rotate only |
||
*2 - |
*2 - Slide and Rotate at the same time |
||
*3 - |
*3 - Slide then Rotate |
||
*4 - |
*4 - Rotate then Slide |
||
All other values default to Rotate only |
|||
To do: investigate more values |
|||
|- |
|- |
||
| 0x05 || byte || '''Flags''' |
| 0x05 || byte || '''Flags''' |
||
*1 - Return to start - If set, the object moves forward and back in one cycle. If not set, the object only moves forward. |
|||
*0 - Single direction (never return) |
|||
*2 - Don't loop - If set, the object will run one cycle and stop. If not set, the object will continuously run cycles. |
|||
*1 - Move back and forth |
|||
*2 - Move on event |
|||
*3 - Move on event |
|||
To do: investigate more values and difference between 2 and 3 |
|||
|- |
|- |
||
| 0x06 || byte || '''Slide Axis''' |
| 0x06 || byte || '''Slide Axis''' |
||
Line 256: | Line 246: | ||
*1 - Y |
*1 - Y |
||
*2 - Z |
*2 - Z |
||
*3 - Z? |
|||
To do: investigate more values and see how some PLATs move in more than one direction |
|||
|- |
|- |
||
| 0x07 || byte || '''Rotate Axis''' |
| 0x07 || byte || '''Rotate Axis''' |
||
Line 263: | Line 251: | ||
*1 - Y |
*1 - Y |
||
*2 - Z |
*2 - Z |
||
*3 - Z? |
|||
To do: investigate more values and see how some PLATs rotate in more than one direction |
|||
|- |
|- |
||
| 0x08 || byte[4] || unknown |
| 0x08 || byte[4] || unknown |
||
Line 284: | Line 270: | ||
| 0x28 || float || '''Rotate Decel Time''' - Ease out time |
| 0x28 || float || '''Rotate Decel Time''' - Ease out time |
||
|- |
|- |
||
| 0x2C || float || ''' |
| 0x2C || float || '''Return Delay''' - Wait time after moving forward |
||
|- |
|- |
||
| 0x30 || float || '''Post- |
| 0x30 || float || '''Post-Return Delay''' - Wait time after moving backward |
||
|- |
|- |
||
| 0x34 || float || unknown |
| 0x34 || float || unknown |
||
Line 296: | Line 282: | ||
| 0x04 || byte || '''Flags''' |
| 0x04 || byte || '''Flags''' |
||
|- |
|- |
||
| 0x05 || byte || '''Plane''' - |
| 0x05 || byte || '''Plane''' - Unknown |
||
|- |
|- |
||
| 0x06 || byte[2] || Padding |
| 0x06 || byte[2] || Padding |
||
|- |
|- |
||
| 0x08 || float || '''Length''' |
| 0x08 || float || '''Length''' - The height of the pivot point |
||
|- |
|- |
||
| 0x0C || float || '''Range''' |
| 0x0C || float || '''Range''' - The amount (in radians) the pendulum swings on each side |
||
|- |
|- |
||
| 0x10 || float || '''Period''' |
| 0x10 || float || '''Period''' - The time one full swing takes |
||
|- |
|- |
||
| 0x14 || float || '''Phase''' |
| 0x14 || float || '''Phase''' - Start swing offset (in radians), e.g. 6.28 = 1 full swing |
||
|- |
|- |
||
| 0x18 || byte[0x18] || null |
| 0x18 || byte[0x18] || null |
Revision as of 04:24, 3 May 2019
Basic types
Type | Description |
---|---|
int, int32 | 32-bit signed integer |
uint, uint32 | 32-bit unsigned integer |
short, int16 | 16-bit signed integer |
ushort, uint16 | 16-bit unsigned integer |
byte | 8-bit signed integer |
char | 8-bit unsigned ASCII integer |
float | IEEE 754 floating point number |
Structs
AssetID
Asset ID is a type derived from uint32 (unsigned integer). It is considered its own type due to how the game uses Asset IDs to uniquely identify an asset and manage communication between them.
Type | Description |
---|---|
uint | 32-bit unsigned integer |
To calculate the asset ID for the original game's assets, the game runs the BKDR hash algorithm on the asset's name converted to upper case. This is specially important to know when editing RWTX assets; to be able to refer to them from MODL, BSP and JSP assets, the game calculates the hash at runtime and finds the textures based on that.
This is HipHopTool's implementation of the algorithm in C#:
public static uint BKDRHash(string str) { str = str.ToUpper(); uint seed = 131; uint hash = 0; int length = str.Length; if (length > 31) length = 31; for (int i = 0; i < length; i++) hash = (hash * seed) + str[i]; return hash; }
Vector2
Vector2 is a set of 2 floats, which usually represent a 2D vector on the world; it is used mostly for texture coordinates.
Type | Description |
---|---|
float | X - The X coordinate of this vector |
float | Y - The Y coordinate of this vector |
Vector3
Vector3 is a set of 3 floats, which usually represent a 3D vector on the world, be it position, rotation or scale.
Type | Description |
---|---|
float | X - The X coordinate of this vector |
float | Y - The Y coordinate of this vector |
float | Z - The Z coordinate of this vector |
Vector4
Vector4 is a set of 4 floats. They can represent a vector in 4D space, and also a color with R, G, B, A components ranging from 0 to 1.
Type | Description |
---|---|
float | X - The X coordinate of this vector |
float | Y - The Y coordinate of this vector |
float | Z - The Z coordinate of this vector |
float | W - The W coordinate of this vector |
Color
Color is a set of 4 bytes, which represent a 32 bit color with red, blue, green and alpha components.
Type | Description |
---|---|
byte | R - red (0-255) |
byte | G - green (0-255) |
byte | B - blue (0-255) |
byte | A - alpha (0-255) |
Motion
Motion is a 0x30-byte structure (0x3C in TSSM) used in several asset types (PLAT and BUTN) which contains some settings defining how the object should move.
Offset | Type | Description |
---|---|---|
0x00 | byte | Type
|
0x01 | byte (bool?) | Use Banking - unknown, always 0 |
0x02 | short | Flags
|
Extend/Retract only | ||
0x04 | Vector3 | Retract Position - Start position |
0x10 | Vector3 | Extend Delta Position - Distance to move from start position |
0x1C | float | Extend Time - Move forward time |
0x20 | float | Extend Wait Time - Wait time after moving forward |
0x24 | float | Retract Time - Move backward time |
0x28 | float | Retract Wait Time - Wait time after moving backward |
0x2C | byte[0x4] | null |
Orbit only | ||
0x04 | Vector3 | Center - Point to move around |
0x10 | float | Width - X scale of orbit |
0x14 | float | Height - Z scale of orbit |
0x18 | float | Period - Time it takes to complete one orbit |
0x1C | byte[0x14] | null |
Spline only | ||
0x04 | int | Unknown - Yes, this field is actually called "unknown" |
0x08 | byte[0x28] | null |
Move Point only | ||
0x04 | unsigned int | Flags - Always 0 |
0x08 | Asset ID | Move Point ID - Move Point to start at |
0x0C | float | Speed - Speed to move at, in units per second |
0x10 | byte[0x20] | null |
Mechanism only (BFBB) | ||
0x04 | byte | Type
All other values default to Rotate only |
0x05 | byte | Flags
|
0x06 | byte | Slide Axis
|
0x07 | byte | Rotate Axis
|
0x08 | float | Slide Distance |
0x0C | float | Slide Time |
0x10 | float | Slide Accel Time - Ease in time |
0x14 | float | Slide Decel Time - Ease out time |
0x18 | float | Rotate Distance - In degrees |
0x1C | float | Rotate Time |
0x20 | float | Rotate Accel Time - Ease in time |
0x24 | float | Rotate Decel Time - Ease out time |
0x28 | float | Return Delay - Wait time after moving forward |
0x2C | float | Post-Return Delay - Wait time after moving backward |
Mechanism only (TSSM) | ||
0x04 | byte | Type
All other values default to Rotate only |
0x05 | byte | Flags
|
0x06 | byte | Slide Axis
|
0x07 | byte | Rotate Axis
|
0x08 | byte[4] | unknown |
0x0C | float | Slide Distance |
0x10 | float | Slide Time |
0x14 | float | Slide Accel Time - Ease in time |
0x18 | float | Slide Decel Time - Ease out time |
0x1C | float | Rotate Distance - In degrees |
0x20 | float | Rotate Time |
0x24 | float | Rotate Accel Time - Ease in time |
0x28 | float | Rotate Decel Time - Ease out time |
0x2C | float | Return Delay - Wait time after moving forward |
0x30 | float | Post-Return Delay - Wait time after moving backward |
0x34 | float | unknown |
0x38 | float | unknown |
Pendulum only | ||
0x04 | byte | Flags |
0x05 | byte | Plane - Unknown |
0x06 | byte[2] | Padding |
0x08 | float | Length - The height of the pivot point |
0x0C | float | Range - The amount (in radians) the pendulum swings on each side |
0x10 | float | Period - The time one full swing takes |
0x14 | float | Phase - Start swing offset (in radians), e.g. 6.28 = 1 full swing |
0x18 | byte[0x18] | null |
None only | ||
0x04 | byte[0x2C] | null |