Combat mechanics (Dragon Age II)

Combat mechanics comprise the technical details relevant to combat in Dragon Age II.
== Damage ==
Damage is the value assigned to the damage effect. When the effect is applied to a creature, it has a couple other things that modify it. These are steps done on the creature when the effect is processed.
=== Order of operations for damage ===
Each is a separate step.
 Base Weapon Damage (in the weapon description, not including on-hit bonuses)
 + Primary Attribute Modifier (0.5 per point over 10)
 * Ability Damage Factor (Winter's Grasp is 4.48833 for example)
 * Hit Result Modifier (1.0 for normal hits, 1.5+ for critical hits)
 + Berserk Bonus Damage
 * Damage Type Modifier (stuff like +15% fire damage)
 * Blood Frenzy/Veneer of Calm Modifier (1.0-2.0)
 * Cross class Combo Multiplier (if applicable)
*Dual-wield weapons hit individually. Basic attacks usually alternate which weapon hits, and abilities usually hit with both (to avoid biasing towards one hand or the other). The "Base Weapon Damage" as well as what on-hit properties apply is determined by which weapon hit with that particular strike. There is no penalty or other trickery involved with calculating dual weapon damage.
*Ability damage works the same for all the classes.
*Accessories with +X% to *TYPE* damage modify a character property, which is included in the "Damage Type Modifier" step.
*On-hit bonuses are applied, when hit with an appropriate weapon (basic attacks, a lot of Warrior and Rogue abilities), it looks at the individual weapon that caused the hit. It runs through each of the on-hit properties on that weapon and applies its effect. So a staff with the following properties:
 Staff
 69 fire damage per hit (whatever DPS)
 +10% spirit damage
 +7 electricity damage
 2.5% chance to stun normal enemies for 3s
*You hit with a basic attack. It processes that attack normally, applying damage, force and secondary effects from other abilities/modes you may have on you. Then it checks the weapon for on-hit properties. In this case, that's electricity damage and chance to stun. The damage it just applies straight, the stun it checks against the percentile chance of it happening before applying.
=== Damage effect ===
Damage Effect determines how much damage the creature takes and what number appears above its head. That's not the actual amount of health deducted from it, though, since that is abstracted a bit to allow for better scaling between difficulty levels.
 Damage
 * Templar Damage Bonus (vs fade creatures/spellcasters)
 * Damage Type Resistance Modifier (armor, fire, resistance, etc.)
 * Damage Resistance Modifier (flat damage resistance)
 * Magic Resistance Modifier (flat magic resistance)
 * Rear Vulnerability Modifier (Shield Defense gives this unless you upgrade it)
 * Blindside Modifier
 * Brittle Modifier (if a critical hit)
 * Damage Redirection Modifier (if Aveline absorbs damage from the target, etc.)
== Armor and resistances ==
Armor and resistances decrease the amount of damage a character takes, it is always measured in a percentage resistance. All types of resistances are cumulative.
Damage type resistance is, as the name suggests, based on the type of damage received. Armor decreases physical damage, fire resistance reduces fire damage etc. These values are only affected by item bonuses that add an amount of armor/resistance, from this amount the percentage resistance is calculated based on the characters' level. It is worth noting that this type of resistance can't exceed 95%, although higher values might be shown on screen.
Magic resistance determines how much damage a character can disregard from a magical attack, as well as determining the duration of hostile magical effects. However, it is only half as effective against spirit damage.
Damage resistance reduces all damage regardless the type or source. However, as with magic resistance, it is only half as effective against spirit damage.
Note : Unlike Origins, Armor and Defense receives a substantial penalty when facing elites (10% and 20%, respectively) and bosses (20% and 40%, respectively), which favors a DPS heavy party setup. This makes it very difficult to make characters that are hard to kill without relying on damage resistance from talents. With sufficient damage/force, you can even stun lock enemies and kill them without them being able to attack back as they will constantly get interrupted.
== Attack and Defense ==
Attack refers to the rate at which companion's attacks will hit their target for full damage. Should the attack fail to hit for full damage, it will become a "glancing blow" that only deals a marginal amount of the damage it would have dealt. Defense, similarly, refers to the rate at which enemies' basic attacks will be reduced to glancing blow damage against Hawke and their companions.
Attack and defense are calculated from a "raw score" that can be viewed in-game and on equipment properties. As Hawke and their companions level up, however, the raw score becomes less valuable as the percentage metric shifts.
Essentially, "ATK(LVL)" and "DEF(LVL)" refer to the raw score one must have at a given level in order to have the corresponding percentage of Attack and Defense against Normal-ranked enemies.
The "baselines," given the values of companion armor upgrades, appear to be: 
*60% for Attack
*20% for Defense
Put another way, the game uses whatever raw scores would provide the character with a 60% chance to hit Normal-ranked enemies (Attack) and a 20% chance to dodge enemy basic attacks (Defense) at a given level, then adjusts the values of companion armor upgrades and generated equipment around these values. Ideally the player's actual numbers should be much higher than this, particularly on higher difficulties, in order to maximize one's damage-per-second (DPS) and minimize the enemy's damage.
ex.) Varric with 30 Dexterity has 164 Attack. This remains at 164 regardless of Varric's level so long as he remains at 30 Dexterity. At Level 14, this amount of Attack provides a hit rate of 64%, but this percentage diminishes with each level up; it only provides 62% at Level 15, 60% at Level 16, 45% at Level 17, and only 34% at Level 18.
At each of these levels, the Coat Lining with Concealed Pockets upgrade provides +72, +77, +82, +88, and +95 Attack. From this, it can be determined that the 60% Attack “baseline” ATK(LVL) is: 144 at Level 14, 154 at Level 15, 164 at Level 16, 176 at Level 17, and 190 at Level 18. These additions into the 164 value grant hit rates of 75%, 73%, 72%, 70%, and 69%. Thus, even as the raw score of 164 depreciates in value with each level up and Varric slips below a 50% hit rate, the upgrade maintains Varric's Attack in the low-to-mid 70s throughout that same window of time.
Varric Attack (30 DEX = 164 Attack)
Level 14
164 = 64%
+upgrade = +72 = 236 = 75%
Level 15
164 = 62%
+upgrade = +77 = 241 = 73%
Level 16
164 = 60%
+upgrade = +82 = 246 = 72%
Level 17
164 = 45%
+upgrade = +88 = 252 = 70%
Level 18
164 = 34%
+upgrade = +95 = 259 = 69%
Thus, equipment can be valuable for maintaining Attack and Defense scores, but they lose value as the requirements become more stringent a couple of levels down the road. Companion armor upgrades and other equipment that will therefore provide the greatest maintenance of Attack and Defense, so they should be obtained as soon as possible.
=== Formula ===
Values for attack and defense are calculated using the following formula:
 StatLevel = (Attribute - 10) / ScalingCoefficient
 StatValue1 = PropertyData(INTEGER_PART(StatLevel))
 StatValue2 = PropertyData(INTEGER_PART(StatLevel) + 1)
 StatValue = StatValue1 + FRACTIONAL_PART(StatLevel) x (StatValue2 - StatValue1)
* Attribute is Cunning for defense, Strength (warrior), Dexterity (rogue), or Magic (mage) for attack.
* ScalingCoefficient is 1.0 for defense and 1.25 for attack (defined in 2da.rim/property_functions.gda file).
* PropertyData(i) is taken from Property Data table from the i-th row.
ex.) The attack value for a rogue with a Dexterity attribute of 88. StatLevel is (88 - 10) / 1.25 = 62.4. StatValue1 is 4331. StatValue2 is 4653. The resulting attack value is 4331 + 0.4 x (4653 - 4331) = 4459.8.
Thus, there is a strong presence of diminishing returns in this system. Due to these diminishing returns it is impractical to raise your Attack solely through pumping points into your primary attack attribute (Str/Dex/Mag). It is far more practical to increase Attack via your class's primary attribute until you stop getting +1% hit chance per point spent (i.e. it takes at least two points to increase the stat 1% more), then spend the remaining attribute points into other stats. This usually happens around 85 to 90%.
=== Effects of talents and spells on Attack/Defense ===
+% attack from talents and spells e.g. Bianca's Song will add a flat rate boost to attack that is not subjected to dimishing returns, e.g. If Varric has a 70% hit chance vs Normal ranks and activates Bianca's Song, which add +20% to Attack, he will now have a 90% hit chance. It does not add to the "raw score," it simply adds to the hit rate on top of whatever the raw score has issued by default. This makes it possible to maintain Attack at a more reasonable number like 80% through the raw score, then boost it the rest of the way to a 90 or even 100% hit rate with a sustained ability or two.
=== Maxing out ===
Attack caps at 100%, but the display only shows the rate vs. Normal-ranked enemies. Defense caps at 80%, which again only shows vs. Normal ranks. Elites and Bosses inflict substantial penalties on Attack (15% and 30%, respectively) and Defense (20% and 40%, respectively) by virtue of their rank alone, so it is a good idea to regularly check the "Details" under each item in the Attributes section of the Character Record to see by how much these ranks reduce the value. Due to the diminishing returns stated earlier, trying to reach 100% Attack vs. Bosses by pumping the raw score with attribute points in the primary attribute is not only impractical, it is impossible, so shoot for a number around 80%, lift the rest with sustained talents, and proceed from there.
Because Defense caps at 80%, this guarantees that at least 1 in 5 enemy hits will deal full damage. However, even if you have Defense rating of 80% against normal enemies, abilities that increase Defense could still be useful because they may provide additional Defense percentage against elites and bosses. For instance, a Rogue with 75% Defense against normal enemies will have 55% and 35% Defense against elites and bosses, respectively. In this case, taking the Evasive Maneuvers talent (+20% Defense) will only increase Defense against normal enemies to 80% because of the cap, but Defense against elites and bosses will be increased to 75% and 55%, respectively.
In addition, any character has a minimum Defense percentage (that is, dodge chance) of 5% against a monster of any rank. It means that if that character's Defense rating would provide them with a dodge chance of less than 5%, their dodge chance will remain at 5%. However, if any abilities increasing the dodge change (such as Turn the Blade) are applied to that character, their dodge chance will be increased to the percentage that they would have at their level with their current Defense rating plus the amount stated in the ability's description. For example:
* If a character has 10 Cunning and thus 0 base Defense rating, and no bonuses to Defense rating or dodge chance from abilities or items, their dodge chance will be 5% (against any enemy). However, if Turn the Blade (which increases the dodge chance by 10%) is applied to them, they will have the dodge chance of only 10% (rather than 10% + 5% = 15%) against normal enemies, because their current Defense rating of 0 on its own provides 0% dodge chance. The dodge chance against elites or bosses will remain at 5%.
* Another example: if a level 9 character has a Defense rating of 60, it would normally provide them with  about 2% dodge chance. In this case, their dodge chance will remain at the minimum value of 5%. However, if Turn the Blade (dodge chance +10%) is applied to them, they will have the total dodge chance of 12% against normal enemies (2% from their Defense rating of 60 + 10% from Turn the Blade). The dodge chance against elites or bosses will remain at 5%.
Normally, only Rogues will put many attribute points into Cunning (which increases defense rating), so trying to increase Defense is rarely practical for classes other than Rogues. Magi and Warriors will probably favor Armor, especially given that the penalties to Armor are lower than for Defense when fighting elites and bosses.
To sum up, unlike in Origins, where tanking strategies could theoretically be pushed to a 100% damage resistance and dodging, the Defense cap, the penalties against elites and bosses, the diminishing returns, and the ability to reach quite high Attack percentages using talents make it favorable to use a DPS heavy party setup in Dragon Age II. It is very difficult to make characters that are hard to kill without relying on damage resistance from talents or in turn handicapping your own damage to the point that the enemy gets enough extra time on the field to bridge the gap created by a more defense-oriented party. In contrast, with sufficient damage/force, you can even stun lock enemies and kill them without them being able to attack back as they will constantly get interrupted.
== Attack speed ==
Attack speed (hits per second) for different weapon types is defined in 2da.rim/itm_base.gda:
* Bows: 0.94
* Daggers: 1.85
* Staves: 1.36
* Two-handed weapons: 1.64
* Weapon & Shield: 1.88
It can also be calculated by dividing displayed DPS by damage.
== Threat ==
Threat is handled very differently compared to Origins. In Origins, a warrior in massive armor and using threaten was enough to hold aggro for most enemies without the player needing to resort to skils like taunt or disengage. In Dragon Age 2, this is no longer true. Enemies seem to heavily favor targeting the closest target and especially characters attacking them. They also appear to switch targets much less often, as it takes them a long time to switch targets from the character they first see to the tank behind him. 
Attempts to use upgraded Battle Synergy combined with Shield Defense to draw threat proved ineffective as enemies would repeatedly target the melee rogue instead of the tank when they were side by side, despite the tank having +100% threat generation and 50% threat transfer. Taunt appears to be the only thing that will consistently draw threat from enemies, but the cooldown and the way enemies arrive in waves (typically waves that surround the party) make it quite difficult to reliably maintain aggro on the party tank. This heavily favors a party setup that emphasizes killing enemies as quickly as possible (preferably using two handed warriors to draw threat from being in melee) that can take a decent amount of damage but clear enemies quickly at the same time.
== Regeneration rate ==
Regeneration rate refers to the rate at which characters will passively replenish a resource, either health or mana/stamina, over the course of a battle, without the use of potions, recovery talents/spells such as Heal and Bolster, or class-specific methods (see Active regeneration for examples). 
All characters will regenerate health and mana/stamina each second by a fixed amount that depends on class and their maximum amount of that resource. The amount of regeneration can be increased by equipment, or spells/talents with property, where X is the numerical amount and Y is either health or mana/stamina. 
The formulae for determining percentage per second are:
Default
 R = C*0.01% of M per second
 or
 R = C/100% x M per second
and
Equipment/talent
 R = N*0.01% of M per second
 or
 R = N/100% x M per second
:C is the default regeneration rate determined by the character's Class
:N is the numerical regeneration value stated in the ability or piece of equipment's description
:M is the Maximum amount of the resource, i.e. health or mana/stamina
In the simplest terms, the regeneration rate is 1% of its stated number, which in turn is multiplied by 1% of the corresponding max value. For example, a health regeneration rate of 10 is equivalent to 0.1% of base health per second, therefore 1% per 10 seconds, or 2 health every 10 seconds on a max health of 200. Thus, 100 health regeneration would be 1%, which on a max health of 200 is 2 health per second.
The following determines baseline values of regeneration depending on the character's class:
Health regeneration
* Warrior base health regeneration: 25 (0.25% of M per second)
* Rogue base health regeneration: 10 (0.1% of M per second)
* Mage base health regeneration: 10 (0.1% of M per second)
Effectively, warriors with 150 health recover 0.375 health per second, or 3.75 every 10 seconds. Rogues with 125 health and mages with 100 recover 0.125 and 0.1 health per second respectively, or 1.25 and 1 health every 10. However, if raised to 150 health to match a warrior's base health, they would only recover 1.5 per 10 seconds. 
Mana/stamina regeneration
* Warrior base stamina regeneration: 20 (0.2% of M per second)
* Rogue base stamina regeneration: 20 (0.2% of M per second)
* Mage base mana regeneration: 30 (0.3% of M per second)
Put another way, a warrior or rogue with 100 maximum stamina passively regenerates 2 points every 10 seconds, or 1 every 5 seconds. A mage with 100 maximum mana passively regenerates 3 mana every 10 seconds, or 1 every 3.33 seconds.
These modest auto-refills can be quite useful, as sustained abilities tend to dip the character's mana/stamina pool just a few points shy of being able to use one more activated ability, allowing it to be used after what amounts to a slight wait. Certain passive abilities such as Elemental Mastery, Galvanism, and Overtime add +10 to the mana/stamina regenerate rate, effectively restoring an additional of max mana/stamina per ten seconds, making them worthwhile later in the game in more protracted fights. Rivalry passives like No Compromises and Man Of The Crown can also be valuable, as +50 to health regeneration gives them a health recovery of 0.6% of M per second, or 1.2% every two seconds.
For these reasons, abilities can be much more valuable than equipment for raising regeneration. An accessory with 2 mana/stamina regeneration per second, on a base maximum of 100 stamina, yields a final increase of +0.02 per second. In short, this would provide 2 additional stamina per 100 seconds, or 1 every 50. These rates are vastly inferior to the basic recovery rates and are, in most cases, not worth the accessory slot compared to those that simply raise a resource's maximum amount.
: The following method may be used to calculate which is most efficient on a piece of equipment for "+[resource] regeneration in combat" versus "+max [resource]". Whichever side of the ratio is greater is the accessory the player should use:
 Regen:Max = [(+GameRegeneration)*(Max)*0.0001]:[(+Max)*(TrueRegeneration)/10]
:(Note: TrueRegeneration is the percentage of resource per second, not the "integer" value as shown in the game i.e. +100 in GameRegeneration = 1% in TrueRegeneration. When using that, divide by 1000)
:Essentially, a piece of equipment with 1 point of extra mana/stamina would raise a maximum stamina/mana amount to 101. On a warrior, 0.2% of this effectively increases the amount of stamina regenerated from 0.2 per second to 0.202 per second. An item with +2 regeneration on a warrior with 100 stamina yields 200*0.0001 = +0.02 per second, added to a stamina of 100 becomes 0.202 stamina regenerated per second. Thus, this situation is equal. In a health example, 1 point of health added to a mage gives them 101 health, and effectively an additional 0.001 health per second, increasing the final amount from 0.1 per second to 0.101. In this situation, +2 health regeneration would be the superior value, though not by enough to matter on a practical scale. Given that few accessories actually get above +2 for either type, and how effortless it is to swing the ratio permanently in favor of raising the maximum (a few attribute points in Willpower or Constitution will suffice), accessories that raise maximum health and mana/stamina are preferable.
Active regeneration
While not "regeneration" in the same sense as the above, the following methods are still classified as "regeneration" within the game's terminology. They differ in that they require action, such as attacking the enemy, to activate their effects, and they have a flat-rate, clear-to-understand percentage of maximum resource, thus they are not influenced by the mechanics listed above.
*Rogues regenerate stamina on every basic attack (1% for dual weapons, 2% for archers, 0.25% and 0.5% respectively prior to patch 1.03) and warriors gain stamina upon every kill (+10% per rank: Critter = 1, Normal = 2, Lieutenant = 3, Boss = 4, Elite Boss = 5)
*The Scoundrel tree offers Follow-Through, which adds 1% more stamina per hit, effectively doubling the recovery rate for dual-wielders and increasing by 1/2 the recovery rate for archers.
*Additionally, talents such as an Assassin's Bloodlust provide stamina recovery for kills where none exists, and similarly the a Berserker's Death Blow builds upon a warrior's innate trait.
*Death Syphon restores 5% of mana for every nearby corpse, and its upgrade restores 5% more mana and 5% of health.
*Arlathan's Grace, an upgrade to Merrill's Wrath of the Elvhen, allows her to recover 1% of her health every 4 seconds for every enemy in range.
== Combat Colors ==
If the preference option is turned on, damage and healing amounts will appear colored coded this way:
* Damage against opponents
** blue: cold damage
** dark green: natural damage
** orange: fire damage
** purple: spirit damage
** white: physical damage
** yellow: electrical damage
* Party members, including Hawke:
** red: all types of damage
** light green: healing
== External links ==
Lead Game Designer Peter Thomas on Dragon Age II Combat mechanics http://social.bioware.com/forum/1/topic/315/index/6578772
Category:Dragon Age II gameplay