Particle damage types

From OniGalore
Revision as of 20:24, 20 March 2014 by Iritscen (talk | contribs) (Iritscen moved page DamageTypes to Particle damage types without leaving a redirect: Reader-friendly names are preferable to tech-speak ones.)
Jump to navigation Jump to search

Introduction

DamageType ("damage type" in .exe) is a member of a preset collection of seven interaction modifiers for 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 PAR3 particle, which utilizes DamageBlast or DamageChar.


ONCC multipliers

In the 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.
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.
When the knockback is set 100, character repositions so far that the distance between original and new location is almost 100 game world units.
The accuracy of the distance calculation is 0.1
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)

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.

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"

ONCC multiplier offset: 0x0C68
StunDamage: no visible effect
Knockback: no special effect, simply repositions the target character
Target character AnimType: HitOverlay (hex 0x39;dec 57)


Nothing special. Just deals damage, applies knockback on the target character and makes him play HitOverlay.



DamageType 1 - "MinorStun"

ONCC multiplier offset: 0x0C6C
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
Target character AnimType: Stun (hex 0xD4; dec 212)


Makes the target character play Stun animation till the StunDamage variable decreases back to zero.
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"

ONCC multiplier offset: 0x0C70
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
Target character AnimType: first Stagger (hex 0xC6; dec 198) or StaggerBehind (hex 0xD5; dec 213)
then Stun(hex 0xD4; dec 212)


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, target character still plays at least the first 30 frames of Stagger/StaggerBehind. 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"

ONCC multiplier offset: 0x0C74
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: no AnimType forced on target character
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 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 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.



DamageType 4 - "MajorKnockdown"

ONCC multiplier offset: 0x0C78
StunDamage: no visible effect
Knockback: no special effect, simply repositions the target character
Target character AnimType: KnockdownHead (hex 0x4F; dec 79) or KnockdownHeadBehind (hex 0x58; dec 88)


Nothing interesting here. Simply applies Damage, Knockback and knocks down the target character.



DamageType 5 - "Blownup"

ONCC multiplier offset: 0x0C7C
StunDamage: no visible effect
Knockback: no special effect, simply repositions the target character
Target character AnimType: Blownup (hex 0xD6; dec 214) or BlownupBehind (hex 0xD7; dec 215)


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



DamageType 6 - "Pickup"

ONCC multiplier offset: 0x0C80
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 frame its Fly (hex 0x19; dec25), but then it keeps looping FallingFlail (hex 0xDC, dec 220)


Designed especially for MutantMuro's tractor particle attack.

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 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:

  • 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 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.

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.