Difference between revisions of "Sacred:Damage"

From SacredWiki
Jump to navigation Jump to search
(Re-writing the article and adding some math. Should be a good backbone to expand on now.)
m (Simplified equations a bit.)
Line 20: Line 20:
  
 
Hence, the net damage on successful attack is given by the formula:
 
Hence, the net damage on successful attack is given by the formula:
N = Σ(G_i/(1+R_i/G_i))
+
N = Σ((G_i)^2/(G_i+R_i))
  
 
Where N is the net damage, i from 1 to 4 are the indices of the four damage types, G_i is the gross damage rolled for damage type i, and R_i is the defender's resistance against damage type i.  
 
Where N is the net damage, i from 1 to 4 are the indices of the four damage types, G_i is the gross damage rolled for damage type i, and R_i is the defender's resistance against damage type i.  
Line 31: Line 31:
 
To evaluate the effect of increases in damage for the attacker or resistance for the defender at a certain regime of values, the total derivative is helpful. For one damage type:
 
To evaluate the effect of increases in damage for the attacker or resistance for the defender at a certain regime of values, the total derivative is helpful. For one damage type:
  
dN = δN/δG dG + δN/δR dR = ( 1 - (1/(1+G/R))^2 ) dG - (1/(1+R/G))^2 dR
+
dN = δN/δG dG + δN/δR dR = ( 1 - (R/(R+G))^2 ) dG - (G/(G+R))^2 dR
  
It reveals that for both the attacker and the defender, it is crucial to boost the stats where (i.e., the damage type where) the incoming damage is large compared to the adverse resistance.
+
It reveals that for both the attacker and the defender, it is crucial to boost the stats on the damage types where the incoming damage is large compared to the adverse resistance.
 +
 
 +
There is no cross interaction between the damage calculations on different damage types.

Revision as of 23:18, 16 March 2016

The four damage & resistance types
Net damage (z-axis) as a function of gross damage (x-axis) and resistance (y-axis) from 0 to 1000 each.

Damage is any diminution of an entity's health as the result of a successful attack.

As such, it is a fundamental combat mechanic. Entities fight each other by attempting attacks, eventually inflicting damage, until their opponents' or their own health is fully depleted and they die. To win a fight, one has to kill the opponent before the opponent kills oneself.

In Sacred, there are four distinct damage types and corresponding resistances:

  • Physical
  • Fire
  • Magic
  • Poison

The net damage of an attack is calculated through several steps:

  1. On attack, the attacker's attack value is rolled against the defender's defense value, determining whether the attack hits or misses. Only successful hits inflict any damage.
  2. If the attack is successful, for each damage type individually, a gross damage value is drawn from the discrete uniform probability distribution of attainable values.
  3. Each of these gross damage values gets mitigated by the defender's resistances, by being divided by ( 1 + Resistance / Gross Damage ).
  4. The resulting net damages get summed up and subtracted together from the defender's health. Damage over Time (DoT) effects may be applied. Hit reactions may be triggered.


Hence, the net damage on successful attack is given by the formula: N = Σ((G_i)^2/(G_i+R_i))

Where N is the net damage, i from 1 to 4 are the indices of the four damage types, G_i is the gross damage rolled for damage type i, and R_i is the defender's resistance against damage type i. For any damage type, if the gross damage is very large compared to the resistance, the net damage gets close to the gross damage. Conversely, if the resistance is very large compared to the gross damage, the net damage gets close to 0. If resistance and gross damage are equal, net damage is equal to half the gross damage.

The interaction of resistance and damage for one damage type is illustrated to the right.

To evaluate the effect of increases in damage for the attacker or resistance for the defender at a certain regime of values, the total derivative is helpful. For one damage type:

dN = δN/δG dG + δN/δR dR = ( 1 - (R/(R+G))^2 ) dG - (G/(G+R))^2 dR

It reveals that for both the attacker and the defender, it is crucial to boost the stats on the damage types where the incoming damage is large compared to the adverse resistance.

There is no cross interaction between the damage calculations on different damage types.