OBD:BINA/PAR3: Difference between revisions

4,306 bytes added ,  8 December 2023
m
added family to footer template call
(that's just the other way around...)
m (added family to footer template call)
 
(13 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{OBD BINA Header|prev=ONIE|type=PAR3|next=SABD|name=3D Particle|onistuff=b_3d}}
{{OBD BINA Header|prev=ONIE|type=PAR3|next=SABD|name=3D Particle|onistuff=b_3d}}


The following example is the raw/sep part of '''3RAPenv_bomb_e06.BINA''' (level 0). (Another example: http://ssg.oni2.net/test.htm )
The following example is the raw/separate file part of '''3RAPenv_bomb_e06.BINA''' (level 0). (Another example: http://ssg.oni2.net/oni_b_3e.htm )


Particle dialogs: http://ssg.oni2.net/subfold/bluebox/3d-part.htm
Particle dialogs: http://ssg.oni2.net/subfold/bluebox/3d-part.htm
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  
}}
}}
{{OBDtr| 0x10 | int32      |00FFFF| 00 00 00 02 | 0x02000000 | flags2; used flags (from left to right):
{{OBDtr| 0x10 | int32      |00FFFF| 00 00 00 02 | 0x02000000 | flags2; used flags (from left to right):
:0x'''01''' 00 00 00 - use special tint
:0x'''01''' 00 00 00 - use "special" tint (color is based on the health of the character who owns the particle; see [[ONGS]])
:0x'''02''' 00 00 00 - don't attract through walls
:0x'''02''' 00 00 00 - don't attract through walls
:0x'''08''' 00 00 00 - expire on cutscene
:0x'''08''' 00 00 00 - expire on cutscene
Line 52: Line 52:
:0x00 00 00 '''08''' - vector
:0x00 00 00 '''08''' - vector
:0x00 00 00 '''10''' - lock position to link
:0x00 00 00 '''10''' - lock position to link
:0x00 00 00 '''20''' - contrail
:0x00 00 00 '''20''' - is contrail emitter
: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          | unused\runtine only }}
{{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 62: Line 62:
{{OBDtr| 0x1e | int16      |FF8000| 00 01      | 256        | unknown; always the same }}
{{OBDtr| 0x1e | int16      |FF8000| 00 01      | 256        | unknown; always the same }}
|}
|}
Field '''0x14''':
From empiric experiments I raise a thesis this field has meaning "used physics for this particle". It corresponds with Neo's [[OBOA]] researches ( field 0x18 in [[OBOA]] ):
::0 - no pre-fabricated physics, if you want physics for this particle, create it via PAR3's actions ( see down on this site for info about actions. )
::1 - unknown, looks like it disables all physics context ( even the PAR3 action-induced one )
::2 - pre-fabricated physics type 1 - reacts on collisions, ignores gravity.
::3 - unknown, looks like it disables all physics context ( even the PAR3 action-induced one ) - maybe because this is "physics" for [[OBOA]] objects which will have [[OBAN]] animation ?
::4 - pre-fabricated physics type 2 - reacts on collisions, gravity is not ignored.
Judging from this discovery it seems possible that maybe there are more ONI file types which can have this "used physics" field. For example [[DOOR]], unknown field 0x18 ( is 0x 02|00|00|00 -> reacts on collisions, ignores gravity ). Maybe there are more files with this field ? --[[User:Loser|Loser]] 07:32, 16 August 2009 (UTC)
:So just checking: when you set this field, the particles suddenly had collisions\gravity and such? [[User:Gumby|Gumby]] 02:31, 17 August 2009 (UTC)
::Same question as Gumby. For all I know particles do not have "physics", only objects and characters have. As for other uses of this "physics type" thing: highly unlikely. I've said it before and I'll say it again: the physics system in Oni is simplistic. There's nothing that it can do more than it already does. Don't waste your time on it. [[User:Neo|Neo]]


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 an 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 98: Line 121:
:*actions {7,8} will be triggered by a '''hit_char''' event
:*actions {7,8} will be triggered by a '''hit_char''' event
:*action {9} will be triggered by a '''lifetime''' event
:*action {9} will be triggered by a '''lifetime''' event
;Back to the silly 3RAPenv_bomb_e06.BINA...


{{Table}}
{{Table}}
Line 241: Line 263:
{{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; variable name follows
: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; instance name follows
:6 - instance name
:7 - color; constant; 1 color follows
:7 - color
:8 - color; random; 2 color follow (min, max)
:8 - random color
:9 - color; bell curve; 2 color follow (mean, stddev)
:9 - random color (normal distribution)
:10 - int32; constant; int32 follows
:10 - int32
:11 - time cycle; 2 float values follow (cycle length, scale)
:11 - time
--------
--------


==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 265: Line 289:
{{OBDtr| 0x00 | char[16] |C8FFC8|            | "rotate" | name of the variable }}
{{OBDtr| 0x00 | char[16] |C8FFC8|            | "rotate" | name of the variable }}
{{OBDtr| 0x10 | int32    |C8FFFF| 02 00 00 00 | 2  | storage type: float }}
{{OBDtr| 0x10 | int32    |C8FFFF| 02 00 00 00 | 2  | storage type: float }}
{{OBDtr| 0x14 | int32    |FFC8FF| 30 00 00 00 | 48 | storaget offset (incremented by the storage type size for every next variable) }}
{{OBDtr| 0x14 | int32    |FFC8FF| 30 00 00 00 | 48 | runtime: storaget offset (incremented by the storage type size for every next variable) }}
{{OBDtrBK|Initial value }}
{{OBDtrBK|Initial value }}
{{OBDtr| 0x18 | int32    |FFFFC8| 04 00 00 00 | 4          | value type: random }}
{{OBDtr| 0x18 | int32    |FFFFC8| 04 00 00 00 | 4          | value type: random }}
Line 275: Line 299:
|}
|}


;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 287: Line 316:
:0x1050 (0x50 10 00 00) - collision orient (storage size: 4)
:0x1050 (0x50 10 00 00) - collision orient (storage size: 4)
:0x1060 (0x60 10 00 00) - boolean (storage size: 4)
:0x1060 (0x60 10 00 00) - boolean (storage size: 4)
:0x1070 (0x70 10 00 00) - ambient sound (storage size: 4)
:0x1070 (0x70 10 00 00) - ambient sound (storage size: 4) (never used)
:0x1080 (0x80 10 00 00) - impulse sound (storage size: 4)
:0x1080 (0x80 10 00 00) - impulse sound (storage size: 4) (never used)
:0x1090 (0x90 10 00 00) - impact modifier (storage size: 4)
:0x1090 (0x90 10 00 00) - impact modifier (storage size: 4)
:0x10A0 (0xA0 10 00 00) - damage type (storage size: 4)
:0x10A0 (0xA0 10 00 00) - damage type (storage size: 4)
Line 298: Line 327:
:*5 - blownup
:*5 - blownup
:*6 - pickup
:*6 - pickup
:0x2000 (0x00 20 00 00) - string? (storage size: 16)
:0x10B0 (0xB0 10 00 00) - direction (storage size: 4)
:0x4000 (0x00 40 00 00) - string? (storage size: 16)
:0x2000 (0x00 20 00 00) - ambient sound name (storage size: 16)
:0x4000 (0x00 40 00 00) - impulse sound name (storage size: 16)


-------
-------
Line 312: Line 342:
{{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 coordinate 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 372:
: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 380:
{{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 - this particle's 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)
Line 363: Line 398:
:3 - sphere (inner radius, outer radius)
:3 - sphere (inner radius, outer radius)
:4 - offset (x, y, z)
:4 - offset (x, y, z)
:5 - cylinder (heigt, inner radius, outer radius)
:5 - cylinder (height, inner radius, outer radius)
:6 - body-surface (offset radius)
:6 - body-surface (offset radius)
:7 - body-bones (offset radius)}}
:7 - body-bones (offset radius)}}
Line 403: Line 438:
{{OBDtr| 0x18 |          |FFC8FF|            |          | not used for random float values }}
{{OBDtr| 0x18 |          |FFC8FF|            |          | not used for random float values }}
|}
|}
;Direction type Inaccurate vs. Cone
:The Inaccurate type was designed for standard ballistic weapons which will have a cone of fire expanding out from the point of origin, therefore it works identically to the Cone type except with an additional factor, "inaccuracy". The "angle" supplied is now a base angle, which is added to by the inaccuracy setting. The "center bias" for Cone and Inaccurate emitters can be positive to pull the dispersion of particles towards the center of the vector, or negative to push them towards the edges of the cone.
:The inaccuracy setting is only used if the originating character is an AI or turret. The AI's or turret's shooting skill is looked up and multiplied by the difficulty setting's weapon inaccuracy multiplier (see [[ONGS]]), then added to the base angle. With the bias taken into account, and some randomization added by the conical dispersion function, this determines the exact trajectory of the bullet coming from the gun.


----
----
----
----
{{OBD BINA Footer|prev=ONIE|type=PAR3|next=SABD|name=3D Particle|onistuff=b_3d}}
{{OBD BINA Footer|prev=ONIE|type=PAR3|next=SABD|name=3D Particle|onistuff=b_3d|family=Level}}
 
{{OBD}}