OBD:BINA/PAR3: Difference between revisions

no edit summary
(that's just the other way around...)
No edit summary
Line 26: Line 26:
:0x00 '''10''' 00 00 - has velocity
:0x00 '''10''' 00 00 - has velocity
:0x00 '''20''' 00 00 - has orientation
:0x00 '''20''' 00 00 - has orientation
:0x00 '''40''' 00 00 - offset position
:0x00 '''40''' 00 00 - has position offset
:0x00 '''80''' 00 00 - attached to object
:0x00 '''80''' 00 00 - has object attachment matrix
:0x00 00 '''01''' 00 - unknown; ignored?
:0x00 00 '''01''' 00 - has unknown; ignored?
:0x00 00 '''02''' 00 - has decal state
:0x00 00 '''02''' 00 - has decal state
:0x00 00 '''04''' 00 - texture animation: random start
:0x00 00 '''04''' 00 - has texture animation random start tick
:0x00 00 '''08''' 00 - texture animation: animate independently
:0x00 00 '''08''' 00 - has texture animation independent tick
:0x00 00 '''10''' 00 - doesn't damage owner†
:0x00 00 '''10''' 00 - has damage owner
:0x00 00 '''20''' 00 - has contrail data
:0x00 00 '''20''' 00 - has contrail data
:0x00 00 '''40''' 00 - lensflare fading
:0x00 00 '''40''' 00 - has lensflare fading state
:0x00 00 '''80''' 00 - is attracted
:0x00 00 '''80''' 00 - has attractor
:0x00 00 00 '''01''' - has collision cache  
:0x00 00 00 '''01''' - has collision cache  
}}
}}
Line 54: Line 54:
:0x00 00 00 '''20''' - contrail
:0x00 00 00 '''20''' - contrail
:0x00 00 00 '''40''' - lensflare
:0x00 00 00 '''40''' - lensflare
:0x00 00 00 '''80''' - one sided edge fade? appears to be ignored
:0x00 00 00 '''80''' - one sided edge fade
}}
}}
{{OBDtr| 0x14 | int32      |FF00FF| 00 00 00 00 | 0          | unknown; looks like garbage data; maybe thelast one (if you read it from right to left) is a bitset too}}
{{OBDtr| 0x14 | int32      |FF00FF| 00 00 00 00 | 0          | ignored }}
{{OBDtr| 0x18 | int16      |FF8000| 01 00      | 1          | number of variables }}
{{OBDtr| 0x18 | int16      |FF8000| 01 00      | 1          | number of variables }}
{{OBDtr| 0x1a | int16      |FF8000| 01 00      | 1          | number of events/actions }}
{{OBDtr| 0x1a | int16      |FF8000| 01 00      | 1          | number of events/actions }}
Line 64: Line 64:


Sprite modes:
Sprite modes:
*0 - sprite (face camera, orient to screen)  
:*0 - sprite (face camera, orient to screen)  
*1 - rotated sprite (face camera, orient to particle)  
:*1 - rotated sprite (face camera, orient to particle)  
*2 - beam (parallel, face camera)  
:*2 - beam (parallel, face camera)  
*3 - arrow (parallel, orient to particle)  
:*3 - arrow (parallel, orient to particle)  
*4 - flat (perpendicular)  
:*4 - flat (perpendicular)  
*7 - discus (parallel, orient to particle)  
:*7 - discus (parallel, orient to particle)  


Contrail modes:
Contrail modes:
*5 - contrail (orient to particle)  
:*5 - contrail (orient to particle)  
*6 - contrail (face camera)  
:*6 - contrail (face camera)  


†If you children particles (bullets, for example) and want to leave the shooting character unharmed, the parent particles must have this flag set, too
HasX flags:
:For each HasX flags that is set space will be allocated in the particle to hold the respective value. For example:
:*"has velocity" - allocates space for the velocity vector (3 floats = 12 bytes)
:*"has orientation" - allocates space for a 3x3 matrix (9 floats = 36 bytes)
:*"has object attachment matrix" - allocates space for a pointer to an "object" transform matrix (pointer = 4 bytes)
:*"has damage owner" - allocates space for and int32 that indicates who owns the particle (typically the owner is a character or a turret)
:The creator of a particle is responsable for properly initializing these values.
:In the specific case of particle emitters the newly emitted particle can inherit these values from the emitting particle. A value is inherited if:
:*both the emitting particle and emitted particle have the coresponding HasX flag set
:*the emitter itself doesn't calculate another value (orientation, velocity etc.)


===Event groups (0x20 - 0x5F)===
===Event groups===
Here we have 16 4-byte slots, which correspond to the following 16 particle event types :
Here we have 16 4-byte slots, which correspond to the following 16 particle event types :
{|border=1 cellspacing=0
{|border=1 cellspacing=0
Line 241: Line 250:
{{OBDtr| 0x308 |          |E7CEA5| 88 24 81 0B | 0B 81 24 88 | runtime pointer to emissions }}
{{OBDtr| 0x308 |          |E7CEA5| 88 24 81 0B | 0B 81 24 88 | runtime pointer to emissions }}
|}
|}
;Value types:
;Value types:
:0 - variable
:0 - variable
:1 - int16
:1 - none (action parameters use this to indicate an unused parameter)
:2 - random int16
:3 - float; constant; 1 float value follows
:3 - float
:4 - float; random; 2 float values follow (min, max)
:4 - random float (2 floats, range, min and max value)
:5 - float; bell curve; 2 float values follow (mean, stddev)
:5 - random float (normal distribution)
:6 - instance name
:6 - instance name
:7 - color
:7 - color; constant; 1 color follows
:8 - random color
:8 - color; random; 2 color follow (min, max)
:9 - random color (normal distribution)
:9 - color; bell curve; 2 color follow (mean, stddev)
:10 - int32
:10 - int32
:11 - time
:11 - time cycle; 2 float values follow (cycle  length, scale)
--------
--------


==Variables==
==Variables==
Every variable takes up 52=0x34 bytes. The number of variables is specified at 0x18 in the header.
Every variable takes up 52=0x34 bytes. The number of variables is specified at 0x18 in the header.
For each variable space is allocated then a particle is created. Variables can be modified by some actions like "linear change", "random change" etc.


[[Image:bin_r_31.gif]]
[[Image:bin_r_31.gif]]
Line 275: Line 286:
|}
|}


;Storage types
;Storage types used for variables
:0x0001 (0x01 00 00 00) - int16 (storage size: 2)
:0x0002 (0x02 00 00 00) - float (storage size: 4)
:0x0002 (0x02 00 00 00) - float (storage size: 4)
:0x0004 (0x04 00 00 00) - string? (storage size: 16)
:0x0008 (0x08 00 00 00) - color (storage size: 4)
:0x0008 (0x08 00 00 00) - color (storage size: 4)
:0x1000 (0x00 10 00 00) - pingpong state (storage size: 4)
:0x1000 (0x00 10 00 00) - pingpong state (storage size: 4)
;Other storage types
These storage types are never used for variables. They might work but since there are no actions that can output such values it doesn't make much sense to declare variables using these types.
:0x0001 (0x01 00 00 00) - int16 (storage size: 2) (never used)
:0x0004 (0x04 00 00 00) - impact name (storage size: 16)
:0x1010 (0x10 10 00 00) - action index (storage size: 4)
:0x1010 (0x10 10 00 00) - action index (storage size: 4)
:0x1020 (0x20 10 00 00) - emitter (storage size: 4)
:0x1020 (0x20 10 00 00) - emitter (storage size: 4)
Line 298: Line 314:
:*5 - blownup
:*5 - blownup
:*6 - pickup
:*6 - pickup
:0x2000 (0x00 20 00 00) - string? (storage size: 16)
:0x2000 (0x00 20 00 00) - ambient sound (again) (storage size: 16)
:0x4000 (0x00 40 00 00) - string? (storage size: 16)
:0x4000 (0x00 40 00 00) - impulse sound (again) (storage size: 16)


-------
-------
Line 312: Line 328:
{{OBDtr| 0x00 | int32 |FFC8C8| 22 00 00 00 | 34 | [[OBD:BINA/PAR3/Actions|Action type]]: Rotate Y }}
{{OBDtr| 0x00 | int32 |FFC8C8| 22 00 00 00 | 34 | [[OBD:BINA/PAR3/Actions|Action type]]: Rotate Y }}
{{OBDtr| 0x04 | int32 |FFFFC8| 00 00 00 00 | 0  | unknown }}
{{OBDtr| 0x04 | int32 |FFFFC8| 00 00 00 00 | 0  | unknown }}
{{OBDtrBK|First variable reference}}
{{OBDtrBK|First output paramter (reference to a variable which the action can modify) }}
{{OBDtr| 0x00 | char[16] |C8FFC8| 00          | ""  | variable name, if empty this block is not used }}
{{OBDtr| 0x00 | char[16] |C8FFC8| 00          | ""  | variable name, if empty this block is not used }}
{{OBDtr| 0x10 | int32    |C8FFFF| 00 00 00 00 | 0  | runtime: storage type }}
{{OBDtr| 0x10 | int32    |C8FFFF| 00 00 00 00 | 0  | runtime: storage type }}
{{OBDtr| 0x14 | int32    |FFC8FF| 00 00 00 00 | 0  | runtime: storage offset }}
{{OBDtr| 0x14 | int32    |FFC8FF| 00 00 00 00 | 0  | runtime: storage offset }}
{{OBDtrBK|First action parameter}}
{{OBDtrBK|First input parameter}}
{{OBDtr| 0x00 | int32    |FFFFC8| 0A 00 00 00 | 10     | value type: int32 }}
{{OBDtr| 0x00 | int32    |FFFFC8| 0A 00 00 00 | 10 | value type: int32 }}
{{OBDtr| 0x04 | int32    |C8FFC8| 01 00 00 00 | 1       | value (rotation space)}}
{{OBDtr| 0x04 | int32    |C8FFC8| 01 00 00 00 | 1   | value (rotation space)}}
{{OBDtr| 0x08 |          |C8FFC8|            |         | not used for int32 values }}
{{OBDtr| 0x08 |          |C8FFC8|            |     | not used for int32 values }}
{{OBDtr| 0x14 |          |C8FFFF|            |         | not used for int32 values }}
{{OBDtr| 0x14 |          |C8FFFF|            |     | not used for int32 values }}
{{OBDtr| 0x18 |          |FFC8FF|            |         | not used for int32 values }}
{{OBDtr| 0x18 |          |FFC8FF|            |     | not used for int32 values }}
|}
|}


Line 342: Line 358:
:0x'''10''' 00 00 00 - emit with parent velocity
:0x'''10''' 00 00 00 - emit with parent velocity
:0x'''20''' 00 00 00 - ignored?
:0x'''20''' 00 00 00 - ignored?
:0x'''40''' 00 00 00 - "inherit attachment matrix" or "orient to velocity"?
:0x'''40''' 00 00 00 - orient to velocity
:0x'''80''' 00 00 00 - inherit tint
:0x'''80''' 00 00 00 - inherit tint
:0x00 '''01''' 00 00 - one per attractor
:0x00 '''01''' 00 00 - one per attractor
Line 350: Line 366:
{{OBDtr| 0x4A | uint16  |00FFFF| FF FF      | 65535    | emit probability (scaled by 65535) }}
{{OBDtr| 0x4A | uint16  |00FFFF| FF FF      | 65535    | emit probability (scaled by 65535) }}
{{OBDtr| 0x4C | float    |FF00FF| 00 00 20 41 | 10.000000 | amount of (sprite) copies }}
{{OBDtr| 0x4C | float    |FF00FF| 00 00 20 41 | 10.000000 | amount of (sprite) copies }}
{{OBDtr| 0x50 | int32    |FFC8C8| 00 00 00 00 | 0        | emitter number? }}
{{OBDtr| 0x50 | int32    |FFC8C8| 00 00 00 00 | 0        | link to:
:0 - nothing
:1 - this particle
:2-9 - to the particle last emitted by emitter 0-7
:10 - inherit this particle link
}}
{{OBDtr| 0x54 | int32    |FFC8C8| 00 00 00 00 | 0        | emit rate; can use parameters 1 and 2; possible values (in dec):
{{OBDtr| 0x54 | int32    |FFC8C8| 00 00 00 00 | 0        | emit rate; can use parameters 1 and 2; possible values (in dec):
:0 - continuous (emit interval)
:0 - continuous (emit interval)
708

edits