Particle damage types: Difference between revisions

From OniGalore
Jump to navigation Jump to search
m (/cat)
(massive copy-edit for clarity; removed excessive technical details)
Line 1: Line 1:
====Introduction====
"DamageType" is a parameter that can be passed to the [[OBD:BINA/PAR3/Actions|PAR3 actions]] "DamageChar" and "DamageBlast". (In engine, these terms are written "damage type", "Damage Char" and "Blast Damage", so you will see those variant phrasings on the wiki as well.) The damage type determines how a character reacts to a [[OBD:BINA/PAR3|PAR3]] particle which utilizes DamageBlast or DamageChar.
DamageType ("damage type" in .exe) is a member of a preset collection of seven interaction modifiers for [[OBD:BINA/PAR3/Actions|PAR3 actions]] actions "DamageChar" ("Damage Char" in .exe) and "DamageBlast" ("Blast Damage" in .exe).


These modifiers affect the way target character reacts when interacting with [[OBD:BINA/PAR3|PAR3]] particle, which utilizes DamageBlast or DamageChar.
==ONCC multipliers==
In the ONCC's [[ONCC#DamageTypes|DamageType section]], each DamageType is assigned its own multiplier, a float ranging from 0.0-1.0. The higher the number, the greater the character's immunity to that damage type; 1.0 is total immunity and 0.0 means no immunity. But note that these multipliers only affect the "StunDamage" and "Knockback" parameters of DamageBlast and DamageChar. The "Damage" parameter for actual HP damage dealt is left intact. The purpose of specific resistance to StunDamage and Knockback effects is to allow heavy characters to suffer from less knockback than lighter ones.


==Knockback==
The Knockback parameter sets the distance to push the character back in world units (1 unit = 3" or about 0.1m). If no multipliers are in effect (such as the ONCC DamageType field, a boss shield, DamageBlast falloff, etc.), then the actual distance travelled by the affected character will fall within about 0.1 world units of the Knockback value. Multiple knockbacks from different sources can also be stacked for a combined effect on the character. The velocity of the knockback has an exponential fade-out.


 
==DamageType 0 - Normal==
====ONCC multipliers====
In the [[OBD:ONCC|ONCC]] profile, each DamageType is assigned its own multiplier (float value).
* These multipliers have allowed range 0.0 ~ 1.0
* These multipliers cannot be set negative.
* These multipliers cap at 1.0
* These multipliers affect only "StunDamage" and "Knockback" parameters of DamageBlast and DamageChar. "Damage" parameter is left intact.
When the PAR3 with DamageBlast or DamageChar interacts with the character, initial values of StunDamage and Knockback are multiplied by:
:multiplier = (1 - "respective DamageType ONCC multiplier")
This means leaving the multiplier at 0.0 equals not using the multiplier at all.<BR>
These multipliers can be used to differentiate reactions of characters (for example, heavy characters can suffer from less knockback than lighter ones).
 
 
 
====Knockback====
The Knockback parameter basically sets a distance for which character relocates.<BR>
When the knockback is set 100, character repositions so far that the distance between original and new location is almost 100 game world units.<BR>
The accuracy of the distance calculation is 0.1<BR>
If no multipliers are in effect (ONCC DamageType, Boss shield, DamageBlast falloff etc.), then the actual travelled distance from the moment when being hit till the moment the travelled distance is closer to Knockback value than 0.1 complies with the closed-form expression:
:distance = Knockback_value*(1-0.93^frame_count)
<font size=1>
Example: if the Knockback value in PAR3 is 100 and no multipliers are in effect, then:
*0th frame (the moment when being hit) -> distance from original location is 0 units
*1st frame -> the distance from the original location is 7,000 units
*2nd frame -> the distance from the original location is 13,510 units
*...
*96th frame -> the distance from the original location is 99,906 units, which is closer to Knockback value than 0.1, so the mechanism ends here.
</font>
 
Actual calculation in Oni is most probably some sort of recurrence relation, because it has to deal effectively with multiple knockbacks as well. Multiple knockbacks can be taken as a sum of all applied displacements at the given frame.
 
Question is whether the Knockback is really calculated as some sort of exponential fade-out or if there actually are some kinematics involved. Bungie West were targeting for high fidelity, for example with velocities in the TRAM xz part. So far I have tried to apply uniform deceleration formula, but it does not comply.
 
This also leads to question about velocities in Oni. If we assume the "game world unit" is decimeter, then in PAR3 files, speed value of "1.0" means 0.1 m/s.
 
 
 
 
 
====DamageType 0 - "Normal"====
{| border="0"
{| border="0"
|-
| [[OBD:ONCC|ONCC]] multiplier offset: || 0x0C68
|-
|-
| StunDamage: || no visible effect
| StunDamage: || no visible effect
Line 53: Line 14:
| Knockback: || no special effect, simply repositions the target character
| Knockback: || no special effect, simply repositions the target character
|-
|-
| Target character AnimType: || HitOverlay (hex 0x39;dec 57)
| Target character AnimType: || HitOverlay
|-
|-
|}
|}


A simple type that just deals damage, applies knockback on the target character and makes them play HitOverlay.


Nothing special. Just deals damage, applies knockback on the target character and makes him play HitOverlay.
==DamageType 1 - MinorStun==
 
 
 
 
====DamageType 1 - "MinorStun"====
{| border="0"
{| border="0"
|-
|-
| [[OBD:ONCC|ONCC]] multiplier offset: || 0x0C6C
| StunDamage: || length of target character's stun status (if frames). Decreases over time at -1.0/frame.
|-
| StunDamage: || length of target character's stun status (if frames). Decreases over time with rate -1.0/frame
|-
|-
| Knockback: || no special effect, simply repositions the target character
| Knockback: || no special effect, simply repositions the target character
|-
|-
| Target character AnimType: || Stun (hex 0xD4; dec 212)
| Target character AnimType: || Stun
|-
|-
|}
|}


Makes the target character play their Stun animation till the StunDamage variable drops to zero. If hit again by a MinorStun while already MinorStunned, the StunDamage variable is reset to the newly dealt StunDamage value and the character restarts the Stun animation.


Makes the target character play Stun animation till the StunDamage variable decreases back to zero.<BR>
==DamageType 2 - MajorStun==
When hit again by the MinorStun while MinorStunned, the StunDamage variable is filled with the newly dealt StunDamage value and the character restarts the Stun animation.
 
 
 
 
====DamageType 2 - "MajorStun"====
{| border="0"
{| border="0"
|-
|-
| [[OBD:ONCC|ONCC]] multiplier offset: || 0x0C70
| StunDamage: || length of target character's stun status (if frames). Decreases over time at -1.0/frame.
|-
| StunDamage: || length of target character's stun status (if frames). Decreases over time with rate -1.0/frame
|-
|-
| Knockback: || no special effect, simply repositions the target character
| Knockback: || no special effect, simply repositions the target character
|-
|-
| Target character AnimType: || first Stagger (hex 0xC6; dec 198) or StaggerBehind (hex 0xD5; dec 213)
| Target character AnimType: || first Stagger or StaggerBehind, then Stun
|-
| || then Stun(hex 0xD4; dec 212)
|-
|-
|}
|}


Makes the target character play the first 30 frames of their Stagger/StaggerBehind animation (during which it starts running the timer on the StunDamage variable), followed by a looped Stun animation till the StunDamage variable reached zero.


Makes the target character play the first 30 frames of the Stagger/StaggerBehind animation (already decreasing the StunDamage variable), followed by looped Stun animation till the StunDamage variable decreases to zero.
If the inflicted StunDamage is below 30, the target character still plays at least the first 30 frames of Stagger/StaggerBehind.
If the target character is hit repeatedly with MajorStun, and StunDamage is less than 30, then the target character keeps staggering but will not enter the Stun loop.


If the inflicted StunDamage is below 30, target character still plays at least the first 30 frames of Stagger/StaggerBehind.
If the target character is hit with MajorStun while already in the Stun loop, then the StunDamage variable is reset to the newest dealt StunDamage value, but the target character seamlessly continues the Stun loop till the StunDamage variable reaches zero.
If the target character is hit repeatedly with MajorStun, which StunDamage is less than 30, then the target character only keeps staggering, but will not enter the Stun loop.


If the target character is hit with MajorStun while already in the Stun loop, then the StunDamage variable is filled with the newest dealt StunDamage value but the target character fluently continues the Stun loop till the StunDamage variable decreases to zero.
==DamageType 3 - MinorKnockdown==
 
 
 
 
====DamageType 3 - "MinorKnockdown"====
{| border="0"
{| border="0"
|-
| [[OBD:ONCC|ONCC]] multiplier offset: || 0x0C74
|-
|-
| StunDamage: || no visible effect
| StunDamage: || no visible effect
Line 118: Line 58:
| Knockback: || not only repositions the target character, but also serves as a threshold for triggering a Stagger or a Knockdown
| Knockback: || not only repositions the target character, but also serves as a threshold for triggering a Stagger or a Knockdown
|-
|-
| Target character AnimType: || no AnimType forced on target character
| Target character AnimType: || Stagger/StaggerBehind, or KnockdownHead/KnockdownHeadBehind
|-
| || Stagger (hex 0xC6; dec 198) or StaggerBehind (hex 0xD5; dec 213)
|-
| || KnockdownHead (hex 0x4F; dec 79) or KnockdownHeadBehind (hex 0x58; dec 88)
|-
|-
|}
|}


This poor DamageType was neglected even by Bungie West, being fully used only for the [[PSP]]. But it looks pretty useful, especially when combined with DamageBlast's falloff feature.


This poor DamageType was neglected even by Bungie developers, being fully used only for w4_psm weapon. But it looks pretty useful, especially when combined with DamageBlast's falloff feature.
When the target character suffers some knockback (be it from PAR3 interaction or even from [[OBD:TRAM/raw0x14|TRAM attacks]]), the value is also added to some sort of variable which sums all incoming knockback values. This sum variable also decreases over time, but the exact decrease mechanism is not fully understood yet as it looks to be non-linear.
 
When the target character suffers some knockback (be it from PAR3 interaction or even from [[OBD:TRAM/raw0x14|TRAM attacks]]), the value of Knockback serves not only to make the target character reposition, but the value is also added to some sort of the knockback sum variable. This Knockback sum variable sums all incoming knockback values. This Knocback sum variable also decreases over time, but the exact decrease mechanism is not fully reasearched yet as it looks to be non-linear.
 
When hit by the PAR3 with MinorKnockdown, the engine decided what to do based on the value stored in the Knockback sum variable at the moment of the impact (after the knockback of the impacting MinorKnockdown is counted in):
* if the value is below 2.2, the target character does not play any special animation.
* if the value is equal or higher than 2.2 BUT lower than 4.1, then the target character plays the first 22 frames of the Stagger/StaggerBehind. This Stagger status can stack if the target character is hit again by MinorKnockdown while still staggering and the Knockback sum variable is still within Stagger limits.
* if the value is equal to or higher than 4.1, the target character gets knockdowned.
 
 


When hit by a PAR3 with MinorKnockdown, the engine decides what to do based on the value stored in the Knockback sum variable at the moment of impact (after the knockback of the impacting MinorKnockdown is added in):
* < 2.2: The target character does not play any special animation.
* 2.2 ≥ value < 4.1: The target character plays the first 22 frames of their Stagger/StaggerBehind. This Stagger status can stack if the target character is hit again by MinorKnockdown while still staggering and the Knockback sum variable is still within this range.
* ≥ 4.1: The target character gets knocked down (plays their Knockdown TRAM).


====DamageType 4 - "MajorKnockdown"====
==DamageType 4 - MajorKnockdown==
{| border="0"
{| border="0"
|-
| [[OBD:ONCC|ONCC]] multiplier offset: || 0x0C78
|-
|-
| StunDamage: || no visible effect
| StunDamage: || no visible effect
Line 148: Line 78:
| Knockback: || no special effect, simply repositions the target character
| Knockback: || no special effect, simply repositions the target character
|-
|-
| Target character AnimType: || KnockdownHead (hex 0x4F; dec 79) or KnockdownHeadBehind (hex 0x58; dec 88)
| Target character AnimType: || KnockdownHead or KnockdownHeadBehind
|-
|-
|}
|}


Simply applies Damage, Knockback and the "knockdown" animation on the target character.


Nothing interesting here. Simply applies Damage, Knockback and knocks down the target character.
==DamageType 5 - Blownup==
 
 
 
 
====DamageType 5 - "Blownup"====
{| border="0"
{| border="0"
|-
| [[OBD:ONCC|ONCC]] multiplier offset: || 0x0C7C
|-
|-
| StunDamage: || no visible effect
| StunDamage: || no visible effect
Line 167: Line 91:
| Knockback: || no special effect, simply repositions the target character
| Knockback: || no special effect, simply repositions the target character
|-
|-
| Target character AnimType: || Blownup (hex 0xD6; dec 214) or BlownupBehind (hex 0xD7; dec 215)
| Target character AnimType: || Blownup or BlownupBehind
|-
|-
|}
|}


Simply applies Damage, Knockback and the "blownup" animation on the target character.


Nothing interesting here. Simply applies Damage, Knockback and "blownup" animation on the target character.
==DamageType 6 - Pickup==
 
 
 
 
====DamageType 6 - "Pickup"====
{| border="0"
{| border="0"
|-
| [[OBD:ONCC|ONCC]] multiplier offset: || 0x0C80
|-
|-
| StunDamage: || allows the pickup mechanism to work; minimal 1.5 required for stable pickup mechanism
| StunDamage: || allows the pickup mechanism to work; minimal 1.5 required for stable pickup mechanism
Line 186: Line 104:
| Knockback: || no special effect, simply repositions the target character
| Knockback: || no special effect, simply repositions the target character
|-
|-
| Target character AnimType: || first frame its Fly (hex 0x19; dec25), but then it keeps looping FallingFlail (hex 0xDC, dec 220)
| Target character AnimType: || first Fly, but then looping FallingFlail
|-
|-
|}
|}


Designed specially for Mutant Muro's attractor lightning attack, this DamageType utilizes the Damage parameter of a DamageBlast/DamageChar PAR3 action in a different way than all the others. While it still drains the blue force shield, as all other DamageTypes do, it does not subtract hitpoints from the target character when it hits them.


Designed especially for MutantMuro's tractor particle attack.
Instead, all dealt Pickup "damage" is added to some sort of Pickup sum variable. The value of this variable dies off at a rate of roughly 1.0/frame (however it might be nonlinear), so it eventually drops to 0 if the character is no longer being hit with the particle. If the value in the sum variable exceeds 100 AND the target character has at least 0.5 StunDamage (however, 1.5 is the required minimum for a stable pickup), the pickup process can start. Please note that the Pickup damage type only accepts StunDamage induced by this specific damage type. It cannot be combined with StunDamages from other DamageTypes.
 
This DamageType utilizes the '''Damage''' parameter of DamageBlast/DamageChar PAR3 actions in a bit different way than all the others. While it still drains the blue shield as all other DamageTypes' Damage parameter does, it does not subtract hitpoints of the target character when it hits him.
 
Instead, all dealth Pickup damage is added to some sort of Total Pickup Damage variable. The value of total Pickup Damage variable decreases over time, rate is roughly -1.0/frame (however, maybe it is nonlinear).
 
If the value in the Total Pickup Damage exceeds 100 AND if the target character has at least 0.5 StunDamage (however, 1.5 is required minimum for stable pickup mechanism), the pickup mechanism can start. Please note that the DamageType Pickup only accepts StunDamage induced by the DamageType Pickup. It cannot be combined with StunDamages from other DamageTypes.


If the pickup mechanism start and the horizontal distance between the Pickupper and the pickupped target character is less than 35 game world units, then the Pickupped target character enters the pickup state and that's that.
If the pickup mechanism starts and the distance between the Pickupper and the target character is less than 35 world units, then the target character enters the pickup state and that's that.


If the pickup mechanism start and the horizontal distance between the Pickupper and the pickupped target character is more than 35 game world units, then the Pickupped target enter the pickup state and simultaneously:
If the pickup mechanism starts when the distance between them is more than 35 world units, then the target enters the pickup state and simultaneously:
* Starts ascending vertically so high that the angle between the line "Pickupper's position - Pickuped target character's position" and the horizontal plane is equal to 45° (tan = 1).
* Starts ascending vertically to a point 45° above the Pickupper.
* Starts moving horizontally towards the Pickupper. From the beginning of the movement, the velocity first rises from 0 to 2.4 m/s within the first 30 frames of the Pickup mechanism, then the horizontal velocity of 2.4 m/s is kept during the whole Pickuped target character's dragging. Near the end of the dragging, when the Pickuped target character gets near the distance "35 units afar from the Pickupper", the horizontal velocity decreases again within 30 frames from 2.4 m/s to 0 m/s.
* Starts sliding horizontally towards the Pickupper. The sliding speed rises from 0 to 2.4 m/s within the first 30 frames of the pickup process, then stays at that speed. Once the target character has been dragged within 35 world units of the Pickupper, their horizontal velocity decreases within 30 frames from 2.4 m/s to 0 m/s.


Warning: Even when all the criteria is met, the DamageType 6 - Pickup does not overwrite animations but always waits till the end of the target character's curent animation before it (the pickup) kicks in. So the effect of the DamageType 6 - Pickup can appear to be "delayed" if the target character plays some long animations, for example 60 frames idle animations.
Warning: Even when all the criteria are met, the Pickup DamageType does not override the current animation, but always waits till the end of it before the pickup kicks in. So the effect of Pickup can appear to be delayed if the target character is playing a long animation such as a 60-frame idle TRAM.


[[Category:Engine docs]]
[[Category:Engine docs]]

Revision as of 19:23, 14 October 2021

"DamageType" is a parameter that can be passed to the PAR3 actions "DamageChar" and "DamageBlast". (In engine, these terms are written "damage type", "Damage Char" and "Blast Damage", so you will see those variant phrasings on the wiki as well.) The damage type determines how a character reacts to a PAR3 particle which utilizes DamageBlast or DamageChar.

ONCC multipliers

In the ONCC's DamageType section, each DamageType is assigned its own multiplier, a float ranging from 0.0-1.0. The higher the number, the greater the character's immunity to that damage type; 1.0 is total immunity and 0.0 means no immunity. But note that these multipliers only affect the "StunDamage" and "Knockback" parameters of DamageBlast and DamageChar. The "Damage" parameter for actual HP damage dealt is left intact. The purpose of specific resistance to StunDamage and Knockback effects is to allow heavy characters to suffer from less knockback than lighter ones.

Knockback

The Knockback parameter sets the distance to push the character back in world units (1 unit = 3" or about 0.1m). If no multipliers are in effect (such as the ONCC DamageType field, a boss shield, DamageBlast falloff, etc.), then the actual distance travelled by the affected character will fall within about 0.1 world units of the Knockback value. Multiple knockbacks from different sources can also be stacked for a combined effect on the character. The velocity of the knockback has an exponential fade-out.

DamageType 0 - Normal

StunDamage: no visible effect
Knockback: no special effect, simply repositions the target character
Target character AnimType: HitOverlay

A simple type that just deals damage, applies knockback on the target character and makes them play HitOverlay.

DamageType 1 - MinorStun

StunDamage: length of target character's stun status (if frames). Decreases over time at -1.0/frame.
Knockback: no special effect, simply repositions the target character
Target character AnimType: Stun

Makes the target character play their Stun animation till the StunDamage variable drops to zero. If hit again by a MinorStun while already MinorStunned, the StunDamage variable is reset to the newly dealt StunDamage value and the character restarts the Stun animation.

DamageType 2 - MajorStun

StunDamage: length of target character's stun status (if frames). Decreases over time at -1.0/frame.
Knockback: no special effect, simply repositions the target character
Target character AnimType: first Stagger or StaggerBehind, then Stun

Makes the target character play the first 30 frames of their Stagger/StaggerBehind animation (during which it starts running the timer on the StunDamage variable), followed by a looped Stun animation till the StunDamage variable reached zero.

If the inflicted StunDamage is below 30, the target character still plays at least the first 30 frames of Stagger/StaggerBehind. If the target character is hit repeatedly with MajorStun, and StunDamage is less than 30, then the target character keeps staggering but will not enter the Stun loop.

If the target character is hit with MajorStun while already in the Stun loop, then the StunDamage variable is reset to the newest dealt StunDamage value, but the target character seamlessly continues the Stun loop till the StunDamage variable reaches zero.

DamageType 3 - MinorKnockdown

StunDamage: no visible effect
Knockback: not only repositions the target character, but also serves as a threshold for triggering a Stagger or a Knockdown
Target character AnimType: Stagger/StaggerBehind, or KnockdownHead/KnockdownHeadBehind

This poor DamageType was neglected even by Bungie West, being fully used only for the PSP. But it looks pretty useful, especially when combined with DamageBlast's falloff feature.

When the target character suffers some knockback (be it from PAR3 interaction or even from TRAM attacks), the value is also added to some sort of variable which sums all incoming knockback values. This sum variable also decreases over time, but the exact decrease mechanism is not fully understood yet as it looks to be non-linear.

When hit by a PAR3 with MinorKnockdown, the engine decides what to do based on the value stored in the Knockback sum variable at the moment of impact (after the knockback of the impacting MinorKnockdown is added in):

  • < 2.2: The target character does not play any special animation.
  • 2.2 ≥ value < 4.1: The target character plays the first 22 frames of their Stagger/StaggerBehind. This Stagger status can stack if the target character is hit again by MinorKnockdown while still staggering and the Knockback sum variable is still within this range.
  • ≥ 4.1: The target character gets knocked down (plays their Knockdown TRAM).

DamageType 4 - MajorKnockdown

StunDamage: no visible effect
Knockback: no special effect, simply repositions the target character
Target character AnimType: KnockdownHead or KnockdownHeadBehind

Simply applies Damage, Knockback and the "knockdown" animation on the target character.

DamageType 5 - Blownup

StunDamage: no visible effect
Knockback: no special effect, simply repositions the target character
Target character AnimType: Blownup or BlownupBehind

Simply applies Damage, Knockback and the "blownup" animation on the target character.

DamageType 6 - Pickup

StunDamage: allows the pickup mechanism to work; minimal 1.5 required for stable pickup mechanism
Knockback: no special effect, simply repositions the target character
Target character AnimType: first Fly, but then looping FallingFlail

Designed specially for Mutant Muro's attractor lightning attack, this DamageType utilizes the Damage parameter of a DamageBlast/DamageChar PAR3 action in a different way than all the others. While it still drains the blue force shield, as all other DamageTypes do, it does not subtract hitpoints from the target character when it hits them.

Instead, all dealt Pickup "damage" is added to some sort of Pickup sum variable. The value of this variable dies off at a rate of roughly 1.0/frame (however it might be nonlinear), so it eventually drops to 0 if the character is no longer being hit with the particle. If the value in the sum variable exceeds 100 AND the target character has at least 0.5 StunDamage (however, 1.5 is the required minimum for a stable pickup), the pickup process can start. Please note that the Pickup damage type only accepts StunDamage induced by this specific damage type. It cannot be combined with StunDamages from other DamageTypes.

If the pickup mechanism starts and the distance between the Pickupper and the target character is less than 35 world units, then the target character enters the pickup state and that's that.

If the pickup mechanism starts when the distance between them is more than 35 world units, then the target enters the pickup state and simultaneously:

  • Starts ascending vertically to a point 45° above the Pickupper.
  • Starts sliding horizontally towards the Pickupper. The sliding speed rises from 0 to 2.4 m/s within the first 30 frames of the pickup process, then stays at that speed. Once the target character has been dragged within 35 world units of the Pickupper, their horizontal velocity decreases within 30 frames from 2.4 m/s to 0 m/s.

Warning: Even when all the criteria are met, the Pickup DamageType does not override the current animation, but always waits till the end of it before the pickup kicks in. So the effect of Pickup can appear to be delayed if the target character is playing a long animation such as a 60-frame idle TRAM.