Original location: http://forums.runicgames.com/discussion/44975/how-stuff-works-damage, in October 2012, edited October 2015
This is a compilation of things I’ve either read on these boards or tested myself, but mostly tested myself because I have trust issues :P. All credit to those whose work I'm using here.
While I think people mostly understand now the major points of how the game calculates damage, I think it’d be useful to have a central reference for this. First, to encourage discussion on the things I may have gotten wrong, obviously, and second so that you don’t have to search the boards for an hour to find the tiniest bit of accurate information. Comments in orange are those that I still have to test whenever I get a minute, which might not be for the next few days.
Before we start crunching numbers, there are a few rules that one should understand about how damage works:
The Fake Formula
The formula below describes how damage works, but incorrectly. I want to make that very clear. However, it’s simple enough to give you a basic understanding of how things work, and then I’ll go on to post the actual full formula.
DPS = base_dps * (1+bonus_damage) * (1+speed_bonus) * (1+crit%*crit_dmg) * (1+u*fumble%*fumble_dmg)
Base_dps = (A+B)/(a+b) * (1+execute%) A and B are the average damage per hit values of the two weapons, a and b are their respective speeds.
Base_dps = WDPS * X% / CS
Cycle speed isn't listed anywhere and must be figured out for each skill (though it is equal to the cooldown on skills that have those). It is only relevant if you want an absolute measure of DPS, or want to compare two skills in terms of damage over time. If you're just figuring out the optimal gear/stats for one skill, then you can actually do your comparisons without this variable.
Do note that when dual-wielding, skill damage is always, and only, based on the weapon in your right hand (i.e. the one in the box on the left side of the inventory screen) (edit: except Arc Beam, apparently - credit to Baron).
If the skill deals elemental damage (“X% of weapon DPS as Fire,” for instance) then you get to add both Strength and Focus as sources of bonus damage in (1).
With skills based on flat damage values, such as say Hailstorm, the base dps is the damage range listed in the tooltip divided by the cycle speed. Easy. For those skills, Strength does not factor at all and it’s all about the Focus.
Now that we understand the basics, let’s dig into the details. The actual accurate formula is the following (hang on, it’s a bit long):
DPS = (1+bonus_damage) * (1+speed_bonus) * [(1- u * fumble%) * [(1-crit%) * base_dps + crit% * crit_dmg * crit_dps] + u * fumble% * fumble_dmg * base_dps]
Yay for science. Pay attention to the nested parentheses, it’s a bit hard to read on screen. Crit_dps is basically the same as base_dps for flat-damage skills (e.g. Hailstorm), and is the maximum damage in the range for weapon-based skills (e.g. Flame Hammer) and auto-attacks.
The idea is basically that:
But it gets worse, because sometimes base_dps is actually made of different things: physical and elemental damage. In this case, I won’t type out the whole equation but basically you need to split the physical and elemental damage, calculate DPS separately, then add them up again, all because elemental damage is increased by Focus (and some specific bonus sources, like +15% ice damage) while physical isn’t.
There are many affixes on gear that can impact the equation above.
Here’s where it gets neat: what happens with stuff that adds fixed damage? Well, thanks for asking. It depends on whether it’s a weapon socketable (or a weapon enchantment) or not.
If it is (a socketable or an enchantment), the added damage value gets added to the base weapon damage per hit. This is huge, because if you add a Skull of Vellinque (+199 physical damage) to a weapon that deals 100 damage per hit, you’re essentially tripling the total DPS (give or take). Bear in mind that if you add elemental damage such as from Embers, it gets bonus damage from Strength AND Focus (and all other applicable bonus sources). The flip side is that if you’re using a flat-damage skill, your weapon is irrelevant and so is this socketable.
If it’s not a weapon socketable/enchantment, then it . Not that I’m judging. The fact is, it gets no bonus damage whatsoever. That +173 ice damage necklace basically adds 173 ice damage to your final damage number before fumbles and crits, but that’s it. You could have 2000 Focus and you’d still only get +173 ice damage, even with skills. Note that the bonus damage from Sword and Board works like this too, making it IMO the most useless skill in the game.
Adding to the confusion is how the game calculates it: all elemental damages are actually calculated and applied separately, which means that enemy armor will apply separately to each of them. In addition, when socketing a physical damage gem (or enchant, etc.) in a weapon dealing physical damage, the game will count it separately. In other words, any addition of physical damage applies separately from the weapon's base physical damage. Yes, it's a bit confusing so here's a screenshot:
Notice in the combat log the +Physical line, which is separate from the first line (that corresponds to base damage of the gun), and is the result of a +27 physical enchant and +199 physical skull (226*(1+5% from Str) = 237).
(largely copied from my Embermage Handbook but has general applications)
There's a lot of confusion around which skill applies which weapon affix. Like I said above, skills based on weapon DPS transmit some effects, but not all of them. Let me refine that a bit.
DoTs from skills never stack with themselves: you can cast Magma Spear as many times as you like, but the target isn't going to get more damage per second (however, the duration will be refreshed each time). Do note that the number in the icon that tells you how much damage the target is taking does change for some skills, as some DoTs have a damage range and a new application can roll a different number in that range. DoTs from skills usually scale with focus and the appropriate +% damage modifiers.
DoTs from weapons (as a native affix, not as a socket - enchantments not tested at this time) DO stack with themselves [edit: apparently so do DoTs from enchantments - thanks lminith]. Two hits from Endgame will result in the target taking twice the damage over time, with the game keeping track of each duration separately (the icon will only show the longest time remaining). In addition, those DoTs scale with your character's Focus, but not his strength (even though technically they're physical damage - go figure). In other words, they can be a source of massive damage if you have a fast-attacking weapon or a fast-casting skill, and lots of Focus.
DoTs from socketables stack with themselves too, both from multiple weapon hits or from having multiple socketables in one weapon. However, they don't scale with Focus (nor Strength), so their damage ends up rather piddly. Not worth the socket IMO. (edit: apparently fixed to scale with Focus in 1.22 - according to patch notes - but I haven't tested it)
Also, as a miscellaneous bit of information: DoTs don't build charge, whether from a skill, weapon or socketable.
Armor debuffs from weapons or socketables do stack with themselves too. More interestingly, the “% chance to flee” debuff (which I assume works like other “chance to inflict X” affixes) seems to stack too, though I have no idea how that works: if you hit the dummy with a “10% chance to flee” weapon, once every few hits it'll get a little icon that says “10% chance to flee”. If it gets that effect applied again, the icon will be upgraded to 20%, then 30, etc. At face value it's like you have a chance to inflict a debuff that has a chance to cause the target to flee; my guess is that the game is just acting up a bit and the 20/30/40% chances just mean the “fleeing” debuff was applied while it was still active from a previous hit.
Attributes define a lot of the damage variables. What often happens is you take an attribute, derive the base value of, say, crit chance, and then add to that all the fixed bonuses you have (usually from gear).
Crit% = Dex * (0.2002 – 0.0002 * Dex), capped at 50.1% at 500 Dex (Dodge also follows this relationship)
Crit_dmg = 50 + Str * 0.4, capped at 450% (technically 449.6%; basically Str above 999 doesn’t give you anything. Total crit damage from all sources caps at 500% in the Arcane Statistics screen though)
Fumble% = 21%, and no amount of stats will change that number, only gear will improve it
Fumble_dmg = 25 + Dex * (0.3003 – 0.0003 * Dex), capped at 100% at 476 Dex
Execute% = 9.8 + Foc * (0.2002 – 0.0002 * Foc), capped at 60% at 500 Focus (technically 498)
Block% = Vit * (0.2002 - 0.0002 * Vit), capped at 50.1% at 500 Vit
Have you ever wondered what the Character and AS panels reported exactly? I know I have. Let’s find out with Serguei, my trusty consoled character.
Serguei's equipped with two Corbucci's rings, a pair of Steam-Tech Nines, and 6 pieces of the Labarinto set (which is, incidentally, ugly as ).
Let's take a look at some numbers:
So we now know what the reported numbers correspond to.
So we know that armor is basically a direct reduction to damage taken, and that a random amount between 50 and 100% of the armor value is applied to each hit. Beyond that not much has been done to figure out how armor works, which is why Chthon's work was so interesting. Lifted straight from his post a couple pages down:
Chthon wrote: A brief report on how monster armor works: 1. Testing methodology ---------------------- Testing monster armor is a flying pain the **** for a couple of reasons. First, there's a range of damage reduction, so instead of straight numbers, you've got to deal with averages and mins and maxes that you're never sure you've hit yet. Second, the practice dummy has such absurdly high armor values that testing against it often results in damage being reduced to zero (for which the game gives you a consolation prize of 1 damage). The best method I could come up with was this: I started a new character a made my way to the path of the honored dead where monsters are level 4 (at least for me). The low level results in a low armor, which in turn results in a narrow range of damage reduction, which allows testing to proceed without requiring a huge number of samples. Console "levelup 99" to get access to any skill I want to mess with and to equip any item. Console "aifreeze" to make the monsters hold still. Console "unit bandit_assassin" to spawn a bandit assassin to spawn an unlimited supply of guys to hit. I picked the assassin because he's supposed to have flat 100% armor across all types. Use console to spawn weapons as desired. Axes are preferred because they have no damage range to muddy up the picture. Start with a plain no-mods physical axe, then work up to more complicated weapons. For each sample, look at the combat log and subtract the "post" value from the (bonus modified) damage roll (the number on the right of the arrow). 2. Getting from .dat to actual damage reduction ----------------------------------------------- This one is a bit of a head-scratcher. ARMOR_MONSTER_BYLEVEL_VERYHARD.DAT says that level 4 monsters are supposed to have 15.14 armor. BANDIT_ASSASSIN.DAT says that bandit assassins are supposed to have 100% normal armor for all armor types. The observed range of damage reduction against the plain axe was 9-17. I don't really have a good theory for this discrepancy. (Uh... the monsters are really level 4.5?) If anyone is able to figure out where that extra 2 points of armor came from, please let me know. 3. Really unexpected result: Monster armor scales with skill WDPS! ------------------------------------------------------------------ For weapon-DPS-based skills that do less than 100% weapon DPS, monster armor is scaled by the same percentage. To replicate: While equipped with your plain axe, use a skill with really low WDPS at early ranks (rank 1 Chain Snare is a good example) and compare the average damage reduction to the average reduction from normal hits with the plain axe. This is BIG NEWS since it means that a lot of skills everyone thought would get absolutely clobbered by armor to the point of uselessness are actually viable. (And Ravage fans should be doing a happy dance.) 4. Another unexpected result: Monster armor scales on secondary targets ----------------------------------------------------------------------- The armor on monsters taking splash damage from non-claw melee weapons (i.e., secondary targets) is getting scaled down by something -- presumably your damage-to-secondary-targets percentage. To replicate: Spawn two bandit assassins on top of each other; whack with plain axe. 5. Multi-type damage gets pro-rated... with one major anomaly ------------------------------------------------------------- When you hit with a weapon that does multiple damage types, the monster's armor gets pro-rated across the various damage sources. The pro rating is done in proportion to the post-roll, fully modified damage for each type (rather than the pre-modifier roll, or the pre-roll min/max/avg). To replicate: This is best tested by using wands/staves with equal bases for all four elements. Each element will be reduced by 1/4 as much as your plain axe hits were. The Beast with a Million Eyes demonstrates that the base physical damage is also subject to pro rating (but see below). Adding items like 2x Ratchet Ring to boost one particular element will show that the pro rating cares about the final, post modifier roll. Now for the anomaly: If the weapon does base physical damage, this gets reduced by more than it should. To be precise, it looks like double. This appears to result in more than 100% of the monster's armor getting applied. Example: A Four-Bearded Axe socketed with 3x Iron Ember Chip does 114 base physical and 105 +physical (yes, they get separate lines in the console even though they're both physical). That was as close as I could get to what should be a 50/50 pro rating. It's not. The base physical is subject to the exact same reduction range as the the plain axe (double what was expected), while the reduction applied to the +dmg from the socketables is about half what the plain axe had (as expected). The sum result is that ~150% of the monster's armor gets applied! Another example: Mountain of the Cannibal ****. One would expect the reduction applied to the poison to be ~1.5x bigger than the reduction to the base physical, but the reduction to the base physical is actually slightly larger. Adding points to focus and/or poison_dmg% gear can eventually flip this over, but the reduction applied to the base physical stays higher than the ratio between the damage types would indicate. My best theory to explain this is that it's a BUG. 6. Degrading Armor ------------------ These effects stack with each other and themselves. Unless otherwise stated, they have a 5 sec duration. They are not scaled down (or up) by WDPS% on skills (at least not for the skills I tested with). Ordinarily, these effects apply after the hit does its damage. One exception I saw was Ravage, where each hit does its armor degrade effect before it does its damage (degrade, hit, degrade, hit, degrade, hit). (Yet another reason for Ravage fans to do a happy dance.) 7. "Monsters takes X% more damage" effects (like Howl) ------------------------------------------------------ These effects are applied after the monster's armor is applied. 8. Frost Breath --------------- Applies its "monsters takes X% more damage" effect before it does its damage. 9. Multi-component skills (like Wolfpack) ----------------------------------------- I only tested Wolfpack, but I assume the others (like Emberquake) work the same. It's hard to tell because the console reports poorly on flat damage skills, but it looks like the two components are treated as separate hits that are each subject to the monster's full armor. Also, if the flat component (against, just tested Wolfpack) is sufficient to kill a monster, the WDPS component doesn't happen at all.