Damage/Calculation

==Damage Calculation==
The following explains how a certain amount of damage of one type turns into actual inflicted damage to a target, considering type modifiers and armor. Faction modifiers, body part modifiers, critical hit and stealth modifiers, as well as Warframe debuffs, are disregarded for now, since all of these are independent of damage types.
===Quantization===
Dealing damage is quantized. Meaning, rather than the damage being applied smoothly, physical and elemental damages round to the nearest multiple of 1/16th of their attack's base damage, before being multiplied further. By using this method of quantization, the precision of data is reduced, thereby saving storage space and improving the efficiency of computer operations. Rather than communicating a lengthy integer of each element's value, only one "Total" integer along with short representative multiples of 1/16th need to be communicated.
{
\text{Scale} = \frac{\text{Modded Base Damage}} {16}
}
For each damage type that a weapon deals, the base damage for that damage type will first be divided by the scale, rounded to the nearest whole number, and finally multiplied by the scale. This quantized value will be used in the mission's damage calculations. The final damage seen by in-game damage pop-ups are further rounded to a whole number.
{
\begin{aligned}
\text{Quantized Damage Type Value} &= \text {Round} (\frac{ \text{Total Damage Type Value} } { \text{Scale} } ) \times \text{Scale} 
\end{aligned}
}
# For example, if you have a weapon with a listed damage distribution of 30 , 30 , and 40 , the total damage is 100.
# The value of a scale will then be .
# The amount of damage dealt by the weapon will then be rounded to the nearest whole number, multiplied by the scale: . This process is applied to and as well, yielding 31.25 and 37.5 respectively.
# As such, when damaging a Charger, which has a +50% bonus to damage due to having health, the total damage dealt to the Charger will then be (the game will display the rounded value of ). 
*Note that while in this case the weapon's total damage after the conversion remained the same (at 100), mixed-type weapon damage is frequently gained or lost by the conversion.
Damage mods such as , Faction mods such as , and any other multipliers only multiply final quantized values and do not affect the scale or damage composition.
If a physical or elemental mod is applied, their bonuses are also quantized.
# The value of the example scale will still be . Elemental and Physical bonuses do not affect the scale.
# If was used, for example, the bonus calculates seperately using the base portion of slash, and adds to the total: round( 40 1.2 6.25 ) 6.25 = 50.
# The damage distribution would then be 31.25 , 31.25 , and 37.5 + 50 = 87.5 .
# Elemental bonuses calculate using the full base damage, are rounded to the nearest 1/16th of the base damage and added to the total.
# Elements formed by a sum of mods and bonuses quantize their sum alone. For example, if 90% combined with 90% , or 90% modded combined with 90% of , these types would count seperately as a sum of their final element (180% , or 180% ), each rounded to the nearest 1/16th of base damage, and finally added to the quantized total. 
*Applying the math fully: with , , , and in that order deals:
**Scale (S) = 16 = 10.8125
**Elemental and Physical Quantization:
***round[ ( ( + ) 173 ) S ] S = 259.5 
***round[ ( 173 ) S ] S = 151.375 
***round[ ( 15.6 ) S ] S = 21.625 
***round[ ( 173 ) S ] S = 346 
**Base Quantization:
***round[ 1.7 S ] S = 0 
***round[ 15.6 S ] S = 10.8125 
***round[ 155.7 S ] S = 151.375 
**Total: 0 + 10.8125 + 151.375 + 259.5 + 151.375 + 21.625 + 346 = 940.6875 Damage
***Note that the value of Nagantaka Prime is so low that it will not register during attacks, rounding to 0 in the process.
***Applying , or any other non-elemental bonus multiplies both the base value of rounding numerator and Scale of rounding denominator, and therefore is a simple multiplier to any quantized total.
Calculating damage with quantization can be simplified to the following steps.
* Get Scale
* Quantize Elements
* Quantize IPS
* Add above
* Apply all other multipliers
====Trivia====
* Hitscan weapons do not quantize against object health such as Nullifier Bubbles and Zephyr Tornadoes. Projectiles however will be quantized. This characteristic has been used to determine damage compositions not disclosed in-game, so they can be presented here in the wiki.
===Unarmored Enemies===
Against unarmored enemies or when applying damage, the formula is simply:
{
\text{Inflicted Damage} = \text{Starting Damage} (1 + \text{Health-type Modifier})
}
*Inflicted Damage (ID) is the final damage result of a particular damage type.
*Starting Damage (SD) is the initial damage value of a particular damage type, modded or not.
*Health-type Modifier (HM) is the damage modifier against that health type (may be shields or health).
To make it independent from the amount of base damage:
{
\begin{aligned}
\text{Damage Modifier} &= 1 + \text{Health-type Modifier} \\
\text{Inflicted Damage} &= \text{Starting Damage} \times \text{Damage Modifier}
\end{aligned}
}
* Damage Modifier (DM) is the total damage modifier. An amount of damage of that type (SD) against that enemy will then always be multiplied with this factor (DM).
===Armored Enemies===
Against armored enemies, the formula is:
{
DM = 1 - \frac{\sqrt{AR \cdot 3}}{100}
}
Where in addition to the previous definitions, AR is the target's armor after all reductions from debuffs (e.g. , status effects, and ).
In the case of enemies who have both shields and armor, damage to shields is not mitigated by armor. Lastly, when damage is applied to a shielded target, generally the damage is applied directly to its health, not shields (i.e. it bypasses shields). Some special enemies like Treasurer or Hounds cannot have their shields bypassed with damage however.
==Final Calculations==
===Modded Stats===
\begin{aligned}
\text{Modded Stat} = \text{Base Stat} \times (1 + \text{Stat Bonuses})
\end{aligned}
:Basic formula for calculating modded stats (e.g. critical chance) with the exception of accuracy, reload time, and charge time.
\begin{aligned}
\text{Modded Stat Time} = \frac{\text{Base Stat Time}}{(1 + \text{Stat Speed Bonuses})}
\end{aligned}
:Formula for calculating modded reload time and charge time.
===Total Damage===
The damage numbers displayed in the in-game arsenal calculate total weapon damage as such:
{
\begin{aligned}
\text{Arsenal Total Damage} &= \text{Base Damage} \\
&\quad \times [ 1 + \text{Elemental Bonuses} \\
&\qquad + \text{Unmodded Impact Distribution} \times \text{Impact Bonuses} \\
&\qquad + \text{Unmodded Puncture Distribution} \times \text{Puncture Bonuses} \\
&\qquad + \text{Unmodded Slash Distribution} \times \text{Slash Bonuses} ] \\
&\quad \times ( 1 + \text{Damage Bonuses}) \\
&\quad \times [\text{Base weapon multishot} \times ( 1 + \text{Multishot Bonuses})]
\end{aligned}
}
This arsenal damage is the average non-crit damage per shot, without Faction Damage Bonus. 
:For melee weapons, remove multishot from the equation. It does not include Stance damage multipliers.
Theoretical total inflicted damage against an enemy can be calculated as such (ignoring quantization for simplification):
{
\text{Total Inflicted Damage} = \text{SD}_{1} \times \text{DM}_{1} + ... + \text{SD}_{N} \times \text{DM}_{N}
}
:Where SD represents the modded value of a particular damage type and DM represents the damage modifier for a particular damage type using the generalized damage modifier formula.
===Gun Damage Per Second===
When comparing the performance of non-melee weapons, it may be useful to calculate their theoretical damage per second (DPS) (without accounting for status effects) using the following formulas:
====Average Shot/Hit====
Average shot or hit is the theoretical average damage dealt on a single button input if all projectiles hit the target.
{
\text{Normal Shot} = \text{Total Damage} \times [1 + (\lfloor \text{Modded Crit Chance} \rfloor \times (\text{Modded Crit Multiplier} - 1) ) ]
}
:In the case where modded critical chance is over 100%, the lowest crit tier possible will be considered a normal shot. (e.g. if a weapon has 250% crit chance, the 100% for an orange crit will be considered a normal shot)
:Note that \lfloor \qquad \rfloor denotes a flooring function (rounding down)
{
\text{Critical Shot} = \text{Total Damage} \times [1 + (\lceil \text{Modded Crit Chance} \rceil \times (\text{Modded Crit Multiplier} - 1) ) ]
}
:In the case where modded critical chance is over 100%, the next crit tier possible will be considered a critical shot (e.g. if a weapon has 250% crit chance, the 50% for a red crit will be considered a critical shot)
:Note that \lceil \qquad \rceil denotes a ceiling function (rounding up)
{
\begin{aligned}
\text{Average Shot} &= \text{Total Damage} \times (1 + \text{Modded Crit Chance} \times (\text{Modded Crit Multiplier} - 1))
\end{aligned}
}
:The average damage dealt on a single button input if all projectiles hit the target.
====Average Burst DPS====
Average burst DPS is the theoretical damage a player does in a very short burst of time, or an extended period of time if ignoring time spent reloading/not firing their weapon.
{
\begin{aligned}
\text{Effective Fire Rate} &= \frac{ 1 }{ \text{Modded Charge Time} + \frac{ 1 }{ \text{Modded Fire Rate} } }
\end{aligned}
}
:The lower the Fire Rate, the more delay between charge shots. If attack is not a charge trigger type (charge time is 0), then effective fire rate equals modded fire rate.
{
\begin{aligned}
\text{Number of Shots Per Magazine} &= \frac{ \text{Modded Mag Size} }{ \text{Ammo Cost Per Shot} }
\end{aligned}
}
:Not all weapons consume one ammo per shot; this is to account for cases such as Continuous Weapons
{
\begin{aligned}
\text{Average Burst DPS} &= \text{Avg. Shot} \times \text{Effective Fire Rate}
\end{aligned}
}
====Average Sustained DPS====
Average sustained DPS is the theoretical damage a player does over an extended period of time, accounting time spent reloading/not firing their weapon.
{
\begin{aligned}
\text{Proportion of Time Spent Shooting vs. Reloading} &= \frac{ \text{Number of Shots Per Mag} }{ \text{Effective Fire Rate} \times \text{Modded Reload Time} + \text{Number of Shots Per Mag}}
\end{aligned}
}
{
\begin{aligned}
\text{Average Sustained DPS} &= \text{Avg. Burst DPS} \times \text{Proportion of Time Spent Shooting vs. Reloading}
\end{aligned}
}
:For the and specifically, one (1) should be subtracted from the denominator to account for their lack of a reload delay.
:For specifically, ignore Modded Reload Time since it draws ammo directly from the full ammo pool similar to bows, but does not "reload" between shots like them.
:Assumes that damage ramp up is at max for Continuous Weapons.
:Reload time is in seconds.
:Reload time includes reload delay which is more prevalent for Battery Weapons. Reload delay for most weapons are negligible if not non-existent.
===Melee Damage Per Second===
When comparing the performance of melee weapons, it may be useful to calculate their theoretical damage per second (DPS) (without accounting for status effects) using the following formulas:
{
\text{Normal Hit} = \text{Total Damage} \times [1 + (\lfloor \text{Modded Crit Chance} \rfloor \times (\text{Modded Crit Multiplier} - 1) ) ]
}
:In the case where modded critical chance is over 100%, the lowest crit tier possible will be considered a normal hit. (e.g. if a weapon has 250% crit chance, the 100% for an orange crit will be considered a normal shot)
:Note that \lfloor \qquad \rfloor denotes a flooring function (rounding down)
{
\text{Critical Hit} = \text{Total Damage} \times [1 + (\lceil \text{Modded Crit Chance} \rceil \times (\text{Modded Crit Multiplier} - 1) ) ]
}
:In the case where modded critical chance is over 100%, the next crit tier possible will be considered a critical hit (e.g. if a weapon has 250% crit chance, the 50% for a red crit will be considered a critical shot)
:Note that \lceil \qquad \rceil denotes a ceiling function (rounding up)
{
\begin{aligned}
\text{Average Hit} &= \text{Average Combo Damage Multiplier} \\
&\qquad \times \text{Total Damage} \times (1 + \text{Modded Crit Chance} \times (\text{Modded Crit Multiplier} - 1))
\end{aligned}
}
:The average damage dealt on the first enemy hit by melee attack, not accounting Follow Through
:See individual stance pages for average combo damage multipliers or go to Stance#Comparison
{
\begin{aligned}
\text{Average DPS} &= \frac{\text{Avg Hit} \times \text{Modded Attack Speed}}{\text{Base Combo Length}}
\end{aligned}
}
:See individual stance pages for average base combo lengths or go to Stance#Comparison
===Damage Over Time===
{
\begin{aligned}
\text{Modded Damage} &= \text{Modded Base Damage} \\
&\qquad \times \text{Modded Multishot} \\
&\qquad \times (1 + \text{Faction Damage Bonuses})
\end{aligned}
}
:Total modded damage calculations used for DoT ignores elemental and physical damage bonuses.
{
\begin{aligned}
\text{Base Avg DoT} &= \text{Modded Damage} \\
&\qquad \times (1 + \text{Faction Damage Bonuses}) \\
&\qquad \times \text{Total Ticks}
\end{aligned}
}
:Without accounting multipliers of specific DoT.
{
\begin{aligned}
\text{Avg Slash DoT} &= 0.35 \times \text{Base Avg DoT} \\
\text{Avg Electricity DoT} &= 0.5 \times (1 + \text{Electricity Bonuses}) \times \text{Base Avg DoT} \\
\text{Avg Heat DoT} &= 0.5 \times (1 + \text{Heat Bonuses}) \times \text{Base Avg DoT} \\
\text{Avg Toxin DoT} &= 0.5 \times (1 + \text{Toxin Bonuses}) \times \text{Base Avg DoT} \\
\text{Avg Gas DoT} &= 0.5 \times \text{Base Avg DoT}
\end{aligned}
}
:Individual calculations for each DoT proc. Keep in mind Slash DoT deals Cinematic damage, ignoring armor.
{
\begin{aligned}
\text{Total Avg DoT} &= (\text{Slash DoT} \times \text{Slash Distribution}) \\
&\qquad + (\text{Electricity DoT} \times \text{Electricity Distribution}) + \dots \\
&\qquad + (\text{Gas DoT} \times \text{Gas Distribution})
\end{aligned}
}
:Multiply each DoT with the respective damage distribution (i.e. damage type / total damage) and add them together
{
\begin{aligned}
\text{Normal Total Avg DoT} &= \text{Total Avg DoT} \\
&\qquad \times [1 + (\lfloor \text{Modded Crit Chance} \rfloor \times (\text{Modded Crit Multiplier} - 1) ) ]
\end{aligned}
}
:In the case where modded critical chance is over 100%, the lowest crit tier possible will be considered a normal shot. (e.g. if a weapon has 250% crit chance, the 100% for an orange crit will be considered a normal shot)
:Note that \lfloor \qquad \rfloor denotes a flooring function (rounding down)
{
\begin{aligned}
\text{Crit Total Avg DoT} &= \text{Total Avg DoT} \\
&\qquad \times [1 + (\lceil \text{Modded Crit Chance} \rceil \times (\text{Modded Crit Multiplier} - 1) ) ]
\end{aligned}
}
:In the case where modded critical chance is over 100%, the next crit tier possible will be considered a critical shot (e.g. if a weapon has 250% crit chance, the 50% for a red crit will be considered a critical shot)
:Note that \lceil \qquad \rceil denotes a ceiling function (rounding up)
{
\begin{aligned}
\text{Avg Total Avg DoT} &= \text{Modded Status Chance} \\
&\qquad \times \text{Total Avg DoT} \\
&\qquad \times (1 + \text{Modded Crit Chance} \times (\text{Modded Crit Multiplier} - 1))
\end{aligned}
}
:Accounting for critical hits, non-crits, and status chance for an average of total DoT averages.
===Lifetime Damage===
Lifetime damage is a derived damage stat that is based on the total amount of damage that a weapon can deal before it depletes its ammo reserve. Melee weapons, Battery Weapons or rechargable weapons, and Exalted Weapons (assuming Energy is always restored) will deal infinite damage over their in-game use since they are always available and are not reliant on ammo pickups or Squad Ammo Restores.
{
\begin{aligned}
\text{Average Lifetime Damage} &= \text{Average Shot} \times \text{Number of Shots Per Magazine} \times (1 + \frac{ \text{Modded Maximum Ammo} }{ \text{Modded Magazine} })
\end{aligned}
}
:The average total damage dealt by a weapon without switching weapons or replenishing ammo.
==References==
==See Also==
* :Category:User_Research_(Damage)
__NOTOC__
Category:Damage 3.0
Category:Mechanics
Category:Update 36