Damage (LWR)

From UFOpaedia
Revision as of 19:20, 13 July 2020 by Ucross (talk | contribs) (Created page with "{{Header (Long War)}}<div class="floatright">__TOC__</div> == Terms == '''Weapon Damage''': This is each weapon damage stat configurable in DefaultGameCore.ini file. The wea...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
Long War Main Page

Terms

Weapon Damage: This is each weapon damage stat configurable in DefaultGameCore.ini file. The weapon ranges shown in game in barracks are computed from this stat based on the randomization process, with an algorithm.

Barrel Modifiers: These are effects that modifies damage as it leaves the barrel of the weapon.

Crit Dmg (or Critical Damage): This is how much the Weapon Damage, after being affected by Barrel Modifiers, is increased during a critical hit. The base value is 1.5, and a non-crit is 1.0.

Target Modifiers: These are effects that modify the damage when it hits the target.

Damage Dealt: This is the damage that a target receives from a damage dealer. It is Weapon Damage modified by both Barrel Modifiers and Target Modifiers.

DR (or Damage Resistance): This is how much of the damage received is resisted. It involves Flat Damage Resistance, Percent Damage Resistance, and Penetration.

Damage Taken: This is how much damage the unit actually takes. It is the Damage Dealt minus the Damage Resistance.


Damage Calculation

Damage from the barrel is: Weapon Damage + Barrel Modifiers (e.g. ranger, alloy-jacketed rounds, holo, etc.). After it leaves the barrel critical damage is applied (anywhere from 1.0x to 2.0x damage) and the damage is randomized +/- 25%. One it reaches the targets, Target Modifiers are applied (In this order: Shredder-> VPT -> CST -> Fragmentation -> Distortion). Damage Dealt = (((Weapon Damage + Barrel Modifiers) * Crit Dmg) * Randomization + Target Modifiers

Then Damage Resistance (DR) is calculated. Flat DR is applied first, then Percent DR, then Penetration. Damage Taken = ((Damage Dealt - Flat DR) * (1 - Percent DR) + Penetration)

The total formula is as follows: Damage Dealt = (([(((Weapon Damage + Barrel Modifiers) * Crit Dmg) * Randomization ) + Target Modifiers] - Flat DR) * (1 - Percent DR) + Penetration)


Other Modifications

The Damage Taken cannot be reduced below 1 by Damage Resistance (DR) and the Damage Taken can never go above the Damage Dealt. All damage is stored in an integer form, thus it is always being truncated during each step. This means 5.6 becomes 5, 9.1 becomes 9, and 9.9 becomes 9. Note that Damage Resistance is not truncated, but the Damage Dealt is truncated after DR is removed.


An Example

A soldier with an Assault Carbine and the Ranger perk fires at a Drone

The Assault Carbine has 4 Weapon Damage, receives +1 damage as a Barrel Modifier from Ranger, and has no innate Penetration. The Drone has 1 Flat DR and is Hardened (30 Percent DR). The Drone is not Shredded and does not have Distortion. The soldier does not have VPT or CST, and Fragmentation does not apply to rifles, so there are no Target Modifiers to the damage.

The shot does not 'Crit' so Crit Dmg is 1.0 and the Randomization is 1.0.

Damage Dealt = (([(((Weapon Damage + Barrel Modifiers) * Crit Dmg) * Randomization ) + Target Modifiers] - Flat DR) * (1 - Percent DR) + Penetration)

Damage Dealt = ((((((4 + 1) * 1.0) * 1.0) + 0 - 1) * (1 - 0.3) + 0) = 2.8 = 2 Damage Taken


Damage Randomization

The purpose of the randomization is to pick a integer value between roughly 0.75 and 1.25 of the Weapon Damage with Barrel Modifiers' and Crit Dmg applied.

The randomization works in integer values only. A die of size 2 * PreRNG Damage + 2 is rolled, where each integer point of PreRNG Damage is assigned up to four possible results on that die (except for the highest and lowest values, which may be assigned less). The weighted average of all possible results equals the PreRNG Damage. For a better understanding, reference the charts, below.

Randomization Table

LR MWD randomisation noncrit.jpg

The Y axis has PreRNG Damage values. Row values are possible randomization results for that particular PreRNG Damage. The rightmost column has the RNG range (min, max). The probability to roll a particular value given a particular PreRNG Damage is (number of times value appears in the row) / (total number of values in the row).


Explosive Damage

Each unit damaged by explosive damage has the Weapon Damage after Barrel Modifiers reduced based on distance from the center. Damage falls as the square of the radius, down to 50% at the edge.