Difference between revisions of "Entity"

From Crash Bandicoot Hacking Wiki
Jump to navigation Jump to search
(Type: Added 0x109.)
(Type: fixing stuff)
Line 83: Line 83:
 
!Purpose
 
!Purpose
 
!Format
 
!Format
 +
!Uses Metavalues?
 
|-
 
|-
 
|0x2C
 
|0x2C
Line 88: Line 89:
 
|String of characters for the internal name used to refer to the entity. Its only purpose is for the devs to distinguish entities so whatever you put here won't directly affect the game
 
|String of characters for the internal name used to refer to the entity. Its only purpose is for the devs to distinguish entities so whatever you put here won't directly affect the game
 
|UTF-8 charset
 
|UTF-8 charset
 +
|No
 
|-
 
|-
 
|0x4B
 
|0x4B
Line 93: Line 95:
 
|List of position points to be used by the entity. Multiple of these can be used to make the entity follow a path (as long as it is programmed to do so)
 
|List of position points to be used by the entity. Multiple of these can be used to make the entity follow a path (as long as it is programmed to do so)
 
|Int16 for each X, Y and Z coordinate
 
|Int16 for each X, Y and Z coordinate
 +
|No
 
|-
 
|-
 
|0x9F
 
|0x9F
 
|ID
 
|ID
 
|Value to uniquely identify the entity that is used to draw it, destroy it (see victims below) and other miscellaneous behaviors
 
|Value to uniquely identify the entity that is used to draw it, destroy it (see victims below) and other miscellaneous behaviors
|Int32<sup>1</sup>
+
|Int32'''<sup>1</sup>'''
 +
|No
 
|-
 
|-
 
|0xA4
 
|0xA4
 
|General Settings
 
|General Settings
 
|List of values that can be used to change a certain object's behavior (i.e. flags, delay, speed)
 
|List of values that can be used to change a certain object's behavior (i.e. flags, delay, speed)
|Int32 (UInt8 + Int24)
+
|Int32 (UInt8 + Int24, but can be combined in different ways)
 +
|No
 
|-
 
|-
 
|0xA9
 
|0xA9
Line 108: Line 113:
 
|Type of the entity<!--Index of T11 entry in T11 entry list in the [[NSD]]?-->
 
|Type of the entity<!--Index of T11 entry in T11 entry list in the [[NSD]]?-->
 
|Int32
 
|Int32
 +
|No
 
|-
 
|-
 
|0xAA
 
|0xAA
Line 113: Line 119:
 
|Variant of the entity
 
|Variant of the entity
 
|Int32
 
|Int32
 +
|No
 
|-
 
|-
 
|0x103
 
|0x103
Line 118: Line 125:
 
|EID of the SLST [[entry]] to be used by this camera rail
 
|EID of the SLST [[entry]] to be used by this camera rail
 
|Int32
 
|Int32
 +
|No
 
|-
 
|-
 
|0x109
 
|0x109
Line 123: Line 131:
 
|Contains information about neighboring [[zone]]  
 
|Contains information about neighboring [[zone]]  
 
|Int32
 
|Int32
 +
|No
 
|-
 
|-
 
|0x118
 
|0x118
Line 128: Line 137:
 
|X rotation?
 
|X rotation?
 
|Int32
 
|Int32
 +
|No
 
|-
 
|-
 
|0x13B
 
|0x13B
 
|Draw List A
 
|Draw List A
|List of values that determine which entities should despawn while the camera is in this zone;<br>Uses metavalues
+
|List of values that determine which entities should despawn while the camera is in this zone'''<sup>2</sup>'''
 
|Int32
 
|Int32
 +
|Yes
 
|-
 
|-
 
|0x13C
 
|0x13C
 
|Draw List B
 
|Draw List B
|List of values that determine which entities should spawn while the camera is in this zone;<br>Uses metavalues
+
|List of values that determine which entities should spawn while the camera is in this zone'''<sup>2</sup>'''
 
|Int32
 
|Int32
 +
|Yes
 
|-
 
|-
 
|0x208
 
|0x208
 
|Load List A
 
|Load List A
|List of EIDs to load when the camera is in this zone;<br>Uses metavalues
+
|List of EIDs to load when the camera is in this zone
 
|Int32
 
|Int32
 +
|Yes
 
|-
 
|-
 
|0x209
 
|0x209
 
|Load List B
 
|Load List B
|List of EIDs to deload when the camera is in this zone;<br>Uses metavalues
+
|List of EIDs to deload when the camera is in this zone
 
|Int32
 
|Int32
 +
|Yes
 
|-
 
|-
 
|0x277
 
|0x277
Line 153: Line 167:
 
|Value that can be used to change a certain object's DDA behavior (i.e. deaths until DDA checkpoint) or other settings like Y rotation.
 
|Value that can be used to change a certain object's DDA behavior (i.e. deaths until DDA checkpoint) or other settings like Y rotation.
 
|Int32
 
|Int32
 +
|No
 
|-
 
|-
 
|0x287
 
|0x287
Line 158: Line 173:
 
|List of entity IDs to destroy on certain occasions (i.e. TNT is despawned, Nitro Switch activated)
 
|List of entity IDs to destroy on certain occasions (i.e. TNT is despawned, Nitro Switch activated)
 
|Int16
 
|Int16
 +
|No
 
|-
 
|-
 
|0x288
 
|0x288
Line 163: Line 179:
 
|Value to uniquely identify a "section" of the level and is used in checkpoints for the game to know which DDA checkpoints have been triggered and at what point in the level the player is (i.e. First real checkpoint has this set to 1, the next DDA checkpoint will have a 1 too, the next real checkpoint will have a 2, etc.)
 
|Value to uniquely identify a "section" of the level and is used in checkpoints for the game to know which DDA checkpoints have been triggered and at what point in the level the player is (i.e. First real checkpoint has this set to 1, the next DDA checkpoint will have a 1 too, the next real checkpoint will have a 2, etc.)
 
|Int32
 
|Int32
 +
|No
 
|-
 
|-
 
|0x28B
 
|0x28B
Line 168: Line 185:
 
|Number of boxes in the level;<br>Should only be used in obj_willy
 
|Number of boxes in the level;<br>Should only be used in obj_willy
 
|Int32
 
|Int32
 +
|No
 
|-
 
|-
 
|0x30E
 
|0x30E
 
|Scale
 
|Scale
|Indicates the scale of the object. Crash 3-only;<br/> 1 = Position/4 in-game; 2 = Position/2 in-game; 3 = Normal; 4 = Position*2 in-game; etc.
+
|Indicates the scale of the object. ''Crash 3''-only;<br/> 1 = Position/4 in-game; 2 = Position/2 in-game; 3 = Normal; 4 = Position*2 in-game; etc.
 
|Int32
 
|Int32
 +
|No
 
|-
 
|-
 
|0x337
 
|0x337
 
|Bonus box count
 
|Bonus box count
|Number of boxes in the level's bonus;<br>Should only be used in obj_willy;<br>Crash 3 only
+
|Number of boxes in the level's bonus;<br>Should only be used in obj_willy;<br>''Crash 3''-only
 
|Int32
 
|Int32
 +
|No
 
|}
 
|}
'''Note:''' Draw lists store this as an Int16, so setting this to a value higher than that will cause severe issues.
+
'''<sup>1</sup>''' Other lists store this as an Int16, so setting this to a value higher than the maximum value that can be stored in a 16-bit field (65535) may cause serious issues.
  
The roles of draw lists is reversed when the camera is going backwards. When proceeding from one camera path to the next, all entities should be despawned at the "connection" point for proper disposal of resources.
+
'''<sup>2</sup>''' The roles of draw lists is reversed when the camera is going backwards. When proceeding from one camera path to the next, all entities should be despawned at the "connection" point for proper disposal of resources.

Revision as of 04:39, 25 August 2018

An entity is an item that stores a collection of values (hereafter referred to as "fields") that can represent a game object/camera rail in Crash 2 and 3.

Format

Crash 2/3

Offset Field Size Value
0x0 Length of this item 4 bytes *
0x4 Unknown 4 bytes x 2 *
0xC Field count 4 bytes hc
0x10 Field info structures (headers) hc * 8 bytes *
Field Info Structure h
0x10 + (h * 0x8) Type 2 bytes *
0x12 + (h * 0x8) Offset relative to 12 bytes at the start of the item 2 bytes offset
0x14 + (h * 0x8) Flags Byte *
0x15 + (h * 0x8) Element size Byte es
0x16 + (h * 0x8) Row Count 2 bytes r
Field Structure f
offset + 0xC + f * 2 Element count 2 bytes ec
offset + 0xE + r * 2 + f * 2 Metavalues 2 bytes *
offset + 0xE + r * 4 + f * 2 Data es * ec *

Type

The format and usage of the field data depends on the field type. Incomplete list.

Type Name Purpose Format Uses Metavalues?
0x2C Name String of characters for the internal name used to refer to the entity. Its only purpose is for the devs to distinguish entities so whatever you put here won't directly affect the game UTF-8 charset No
0x4B Position List of position points to be used by the entity. Multiple of these can be used to make the entity follow a path (as long as it is programmed to do so) Int16 for each X, Y and Z coordinate No
0x9F ID Value to uniquely identify the entity that is used to draw it, destroy it (see victims below) and other miscellaneous behaviors Int321 No
0xA4 General Settings List of values that can be used to change a certain object's behavior (i.e. flags, delay, speed) Int32 (UInt8 + Int24, but can be combined in different ways) No
0xA9 Type Type of the entity Int32 No
0xAA Subtype Variant of the entity Int32 No
0x103 SLST EID EID of the SLST entry to be used by this camera rail Int32 No
0x109 Neighbor camera rails (untested) Contains information about neighboring zone Int32 No
0x118 Misc Settings 1 X rotation? Int32 No
0x13B Draw List A List of values that determine which entities should despawn while the camera is in this zone2 Int32 Yes
0x13C Draw List B List of values that determine which entities should spawn while the camera is in this zone2 Int32 Yes
0x208 Load List A List of EIDs to load when the camera is in this zone Int32 Yes
0x209 Load List B List of EIDs to deload when the camera is in this zone Int32 Yes
0x277 Misc Settings 2 Value that can be used to change a certain object's DDA behavior (i.e. deaths until DDA checkpoint) or other settings like Y rotation. Int32 No
0x287 Victim List of entity IDs to destroy on certain occasions (i.e. TNT is despawned, Nitro Switch activated) Int16 No
0x288 Section ID Value to uniquely identify a "section" of the level and is used in checkpoints for the game to know which DDA checkpoints have been triggered and at what point in the level the player is (i.e. First real checkpoint has this set to 1, the next DDA checkpoint will have a 1 too, the next real checkpoint will have a 2, etc.) Int32 No
0x28B Box count Number of boxes in the level;
Should only be used in obj_willy
Int32 No
0x30E Scale Indicates the scale of the object. Crash 3-only;
1 = Position/4 in-game; 2 = Position/2 in-game; 3 = Normal; 4 = Position*2 in-game; etc.
Int32 No
0x337 Bonus box count Number of boxes in the level's bonus;
Should only be used in obj_willy;
Crash 3-only
Int32 No

1 Other lists store this as an Int16, so setting this to a value higher than the maximum value that can be stored in a 16-bit field (65535) may cause serious issues.

2 The roles of draw lists is reversed when the camera is going backwards. When proceeding from one camera path to the next, all entities should be despawned at the "connection" point for proper disposal of resources.