Difference between revisions of "Damage (LWR)"

From UFOpaedia
Jump to navigation Jump to search
Line 21: Line 21:
  
 
Damage from the barrel is: '''Weapon Damage''' + '''Barrel Modifiers''' (e.g. ranger, alloy-jacketed rounds, etc.). It is truncated after calculation. Some '''Barrel Modifiers''' give straight damage (e.g. +1 damage) and others give damage based on the weapon damage (e.g. +50% weapon damage). These are all summed together. For example, a sniper with ranger (+1 damage), mayhem (+90% weapon damage), and a sniper rifle (6 weapon damage) would have a barrel damage of 6 + 1 + 5 = 12.
 
Damage from the barrel is: '''Weapon Damage''' + '''Barrel Modifiers''' (e.g. ranger, alloy-jacketed rounds, etc.). It is truncated after calculation. Some '''Barrel Modifiers''' give straight damage (e.g. +1 damage) and others give damage based on the weapon damage (e.g. +50% weapon damage). These are all summed together. For example, a sniper with ranger (+1 damage), mayhem (+90% weapon damage), and a sniper rifle (6 weapon damage) would have a barrel damage of 6 + 1 + 5 = 12.
 +
 +
Critical damage boosts are added as barrel damage but only if the shot is a critical hit.
  
 
=== Travel Damage ===
 
=== Travel Damage ===

Revision as of 03:08, 21 October 2021

Back To Main Page

Damage Calculation

Complete Damage Formula

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

This can be broken down into 5 categories: Weapon Damage, Barrel Damage, Travel Damage, Damage Dealt, and finally Damage Taken.

Each category represents a section of the damage calculation:

Damageformula.png

Weapon Damage

This is simply the listed damage of each weapon (for XCOM) or base damage (for aliens). Alien weapon damage increases with alien level and leader upgrades. Weapon Damage can be viewed in-game by pressing F1.

Barrel Damage

Barrel Damage = ((Weapon Damage + Barrel Modifiers)

Damage from the barrel is: Weapon Damage + Barrel Modifiers (e.g. ranger, alloy-jacketed rounds, etc.). It is truncated after calculation. Some Barrel Modifiers give straight damage (e.g. +1 damage) and others give damage based on the weapon damage (e.g. +50% weapon damage). These are all summed together. For example, a sniper with ranger (+1 damage), mayhem (+90% weapon damage), and a sniper rifle (6 weapon damage) would have a barrel damage of 6 + 1 + 5 = 12.

Critical damage boosts are added as barrel damage but only if the shot is a critical hit.

Travel Damage

Travel Damage = (Barrel Damage * Crit Dmg) <-- Randomization

Travel Damage is basically the Barrel Damage that is modified by Crit and Randomization.

After it leaves the barrel and is travelling towards the target, Crit Dmg of anywhere from 1.0x to 2.0x damage is applied (there is a minimum boost that affects low damage crits) and then the damage is Randomized.

For all damage 1-9, the damage is randomized from -1 to +1, with an even chance of being -1, 0, or +1.

For all damage 10-19, the damage is randomized from -2 to +2, with an even chance of being -2, -1, 0, +1, or +2.

The same occurs for damage of 20-29, 30-39, etc.

The minimum damage is always at least 1.

The actual formula is: Randomized Damage = Max(1, Damage + Rand[1 + (2 * (1 + Damage / 10))] - (1 + Damage / 10))

The randomization works in integer values so all values are constantly truncated (e.g. If x is 6 then x/10 = 0).

Damage Dealt (AKA Damage Received)

Damage Dealt = Travel Damage + Target Modifiers

Once it reaches the targets, Target Modifiers are applied (In this order: Shredder-> VPT -> CST -> Fragmentation -> Distortion). It is truncated after each calculation.

This can also be termed Damage Received (as opposed to Damage Dealt) if being considered from the target's point of view.

Damage Taken

Damage Taken = (Damage Dealt - Flat DR) * (1 - Percent DR) + Penetration

Then Damage Resistance (DR) is calculated.

Flat DR is applied first, then Percent DR, then Penetration. The Damage Taken is truncated only after all DR has been removed from the Damage Dealt. Damage Dealt cannot be reduced below 1 by Damage Resistance.

Exceptions

Low Damage Crits

A special exception for critical hits, is that a crit with low Barrel Damage (1, 2, or 3 damage) will crit for at least 3, 4, or 5 damage, respectively. This is an artificial boost to ensure that even if a player rolls low on the randomization, the crit is always at least as much as the max roll on a non-crit.

Mins and Maxes

The Damage Taken cannot be reduced below 1 by Damage Resistance.

The Damage Taken can never go higher than the Damage Dealt.

For example, someone with a high amount of penetration could calculate final Damage Taken numbers higher than Damage Dealt, but this would be capped at the initial Damage Dealt.

Randomization will never set the damage below 1.

Truncation

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.

The exception to this is that Damage Resistance is not truncated and is removed from damage after both Flat DR and Percent DR is calculated.

So Damage Dealt is truncated only after all DR is removed.

This is important, because having DR NOT truncated until it's removed from the Damage Dealt means that you can have non-integer (i.e. 0.5 DR) forms of DR be effective.

Example: a 10 damage shot against a unit with 0.1 Flat DR will have a Damage Taken of 9. Having both Flat DR and Percent DR calculated as total DR before truncation means that minor amounts of both DR will not end up reducing DR by 2. Example: a 10 damage shot against a unit with 0.1 Flat DR and 1 Percent DR will have a Damage Taken of 9 (it would be 8 if the damage was truncated individually between Flat DR and Percent DR).

Explosive Damage

Each unit damaged by explosive damage has the Travel Damage reduced based on distance from the center. Damage falls as [half of the distance:radius ratio + 0.5], down to [50% + 0.5] at the periphery. The exception to this is that damage within 1 tile of the center has no fall-off.

Note: The 0.5 damage is added on explosive fall-off to accommodate for truncation.

Explosive Travel Damage = 0.50 + Travel Damage * (1.0 - FMin[0.50, 0.50 * Distance_to_Target/Radius_of_Explosive])

Example Calculations

Mental In-Game Calculation

A soldier with a 3 damage assault carbine and ranger (+1 damage) fires at a drone who has 1 flat DR and 30% DR.

You'd expect it to do 4 damage (range 3-5), minus 1 flat DR down to 3 damage, minus 30% DR down to 2 damage.

Detailed Calculation

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

The Assault Rifle 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 does not change the value.

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

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

Environmental Damage

Environmental damage is the damage done to objects and structures around the battlefield (like walls, chairs, cars, etc.).

Each weapon has a specific environmental damage based on its size and type:

Source XP
Normal Weapons 3x weapon damage
MEC, SHIV, Large Alien Weapons 6x weapon damage
Explosives 10x weapon damage

Environmental damage is mostly unaffected by perks and abilities and just considers the weapon's specific environmental damage. However, there are 2 exceptions: Explosives do tapper their environmental damage down to 50% at their periphery (and Tandem Warheads does prevent this tapper) and Sapper increases environmental damage fivefold.

Fire will also cause a lot of environmental damage and can spread. Be careful taking cover behind objects that are on fire!

All objects have a certain amount of HP. The less sturdy the object the less HP it will have. When an object's HP is reduced to 0 or less it will crumple.

Most cover has between 30 and 90 HP, based on what they are made of -- stone is tougher than wood, for example. Some map elements are entirely invulnerable and non-cover objects usually have less than 30 HP. Meld Canisters have 3 HP. Vehicles take 250 before catching on fire and 500 will cause them to explode immediately. Examples of the HP of objects can be found in the pictures below. You can set your own game to show the HP of objects by setting the BASE_DAYS_INJURED value to 1 in the DefaultGameCore.ini file.

Coverhp.png

Coverhp2.png