Sub topic 7
Derived metrics: expected damage, time to kill, effective health
Raw stats such as damage, health and armor rarely tell you how a fight feels. Players experience outcomes: how long a fight lasts, how much punishment a character absorbs, how fast an enemy dies. A derived metric is a number computed from several raw stats that describes one of those outcomes. This chapter builds three of them: expected damage per attack, time to kill (TTK), and effective health (EHP).
Prerequisites
This chapter assumes you have:
- A workbook with a Params sheet and calculation sheets, as set up earlier in this tutorial.
- A level-based stat table, so that damage, health and armor can be looked up per level.
- The armor formula
damage * 100 / (100 + armor)and the idea of expected value for crits and misses.
Why derived metrics matter
Designers set goals in player-facing terms, such as "a level 10 player kills a level 10 enemy in about 8 seconds". A balance sheet that only lists damage and health cannot be checked against that goal. Derived metrics connect the two. They also let you compare options that differ in several stats at once. A slow, heavy weapon and a fast, light one become comparable once both are expressed as damage per second or time to kill.
The metrics in this chapter are all averages. Individual fights vary, and the chapter on Monte Carlo simulation covers that spread. Averages are still the right first tool because they are cheap to compute and easy to tune.
Setting up the sheet
Use one row per attacker. Keep the columns in a fixed order so formulas stay readable. This chapter uses the following layout on a sheet called Attackers.
| Column | Contents |
|---|---|
| A | Attacker name |
| B | Damage per hit |
| C | Hit chance (0 to 1) |
| D | Crit chance (0 to 1) |
| E | Crit multiplier (for example 2 for double damage) |
| F | Expected damage per attack |
| G | Seconds between attacks |
| H | Damage per second (DPS) |
| I | Time to kill the chosen target |
Hit chance, crit chance and the crit multiplier are inputs. Put the defaults on the Params sheet and reference them if every attacker shares them. Put per-attacker values directly in the row if they differ.
Expected damage per attack
An attack has three possible outcomes: it misses, it hits normally, or it hits and crits. Expected damage is the average damage per attack over many attacks, weighted by how often each outcome occurs.
Assume the crit chance applies only to attacks that hit. The average damage of a hit is then:
- Normal hit:
B2, with probability1 - D2. - Critical hit:
B2 * E2, with probabilityD2.
Averaging these gives B2 * (1 - D2) + B2 * E2 * D2, which simplifies to B2 * (1 + D2 * (E2 - 1)). Multiplying by the hit chance gives the formula for column F:
=B2 * C2 * (1 + D2 * (E2 - 1))Here is a worked example. An attacker deals 50 damage, hits 90% of the time, crits 20% of the time, and crits for double damage.
- Crit factor:
1 + 0.2 * (2 - 1) = 1.2. - Expected damage:
50 * 0.9 * 1.2 = 54.
So over many attacks this attacker averages 54 damage per attack, even though no single attack deals exactly 54.
Where the formula assumes too much
- It treats the crit chance as conditional on a hit. If your game rolls crits independently of hits, a crit can only matter when the hit lands, so the formula is the same, but check that the design matches.
- It ignores overkill. If the target has 10 health left and the attack deals 50, the extra 40 damage is wasted. Expected damage overstates real output against low-health targets.
- It assumes damage is the same every attack. If damage has a random range, use the average of the range in column B.
Applying armor before you average
Mitigation should be applied to the damage a hit does, before you average over crits and misses. With the armor formula from the previous chapter, the damage after armor is B2 * 100 / (100 + armor). Because armor scales damage by a constant factor and expected damage is linear in damage, you can apply armor either before or after averaging and get the same answer. That holds only for a purely proportional formula. If your armor model subtracts a flat amount from each hit, such as MAX(1, B2 - armor), the order matters. In that case apply the flat reduction to the normal hit and the crit hit separately, then weight them.
For the proportional model, a clean approach is to add a column for post-armor damage per hit and point the expected-damage formula at it. This keeps each column doing one job.
Damage per second
Damage per second is expected damage per attack divided by the time between attacks:
=F2 / G2DPS lets you compare attackers with different speeds. An attacker with expected damage 54 and 1.5 seconds between attacks has DPS 54 / 1.5 = 36. Another with expected damage 30 and 0.8 seconds between attacks has DPS 37.5, so the faster attacker slightly out-damages the slower one on average.
Time to kill
Time to kill is the average time an attacker needs to bring a target's health to zero. The simplest estimate divides target health by expected damage to get the number of attacks, then multiplies by the time per attack:
=Targets!B2 / F2 * G2Using the earlier attacker (expected damage 54, 1.5 seconds per attack) against a target with 600 health:
- Attacks needed:
600 / 54 = 11.1. - TTK:
11.1 * 1.5 = 16.7seconds.
This is the same as Targets!B2 / H2, so use whichever is clearer in your sheet.
Whole attacks and the first-hit effect
Real attacks come in whole units. The attacker above needs 12 attacks on average, not 11.1, if every attack did exactly 54. To reflect this, round the attack count up:
=ROUNDUP(Targets!B2 / F2, 0) * G2The rounded version suits attackers with few, large hits, such as a slow siege weapon. The continuous version suits attackers with many small hits, where rounding error is small. Pick one and use it throughout the workbook so comparisons stay fair. Also note that the first attack lands at time zero in many games, so the real time to kill is about (attacks - 1) * G2. Decide how your game works and document the choice on the Params sheet.
Comparing TTK across levels
Fill the formula down a table with one row per level, pulling attacker damage and target health from your level-based stat tables. A TTK column that grows smoothly from 5 seconds to 12 seconds is healthy. A sudden jump, or a drop to 1 second at one level, points to a curve mismatch between damage and health. Chart the column to see this at a glance.
Effective health
Effective health is the amount of raw damage a target can absorb before dying, after mitigation is taken into account. With the proportional armor formula, each hit is reduced by the factor 100 / (100 + armor), so the target can absorb (100 + armor) / 100 times its health in raw damage:
=Health * (100 + Armor) / 100A target with 600 health and 100 armor has an EHP of 600 * 200 / 100 = 1200. Against raw attacks it behaves as if it had 1200 health.
Effective health is useful because it puts health and armor on one scale. Suppose you can give a defender either +200 health or +50 armor. Starting from 600 health and 100 armor:
| Option | Health | Armor | EHP |
|---|---|---|---|
| Baseline | 600 | 100 | 1200 |
| +200 health | 800 | 100 | 1600 |
| +50 armor | 600 | 150 | 1500 |
The health option wins here. At higher health or higher armor the answer changes, because armor gives a percentage boost and health gives a flat one. Armor becomes the better purchase as health grows. Computing EHP for each option removes the guesswork.
Armor has diminishing returns, EHP does not
Damage taken falls with armor at a decreasing rate, but EHP rises linearly with armor. Going from 0 to 100 armor doubles EHP. Going from 100 to 200 adds the same amount again, and EHP is 3 times health at 200 armor. The linearity of EHP is the reason designers like the formula. Each point of armor is worth the same fraction of base health, so you can price it in your power budget with a single constant.
The diagram below shows how the three metrics depend on each other.
Putting it together: TTK against armor
The most useful derived number is TTK that already includes the target's armor. Apply armor to the attacker's damage first, then compute expected damage and TTK. In a sheet with post-armor damage in column B, that is the same formulas as above. A one-row check is:
=Targets!B2 / (B2 * 100 / (100 + Targets!C2) * C2 * (1 + D2 * (E2 - 1))) * G2This is long, so avoid it in the main table. Prefer separate columns for post-armor damage, expected damage and TTK, and use the long form only to cross-check one row.
Common errors
- Mixing units of time. If attack speed is stored as attacks per second in one place and seconds per attack in another, DPS comes out inverted. Store one form and label the column header with its unit.
- Percentages entered as whole numbers. A hit chance of 90 instead of 0.9 gives an expected damage 100 times too large. Use data validation to limit chance columns to 0 through 1.
- Applying armor twice. If the stat table already includes armor effects, do not apply mitigation again in the TTK formula.
- Hard-coded constants. A
100inside the armor formula is acceptable because it is part of the formula. A crit multiplier typed into a formula is not, because you will need to change it. Put it on Params. - Trusting the average for burst fights. If a fight lasts 3 attacks, the average hides large variance. Use the simulation chapter for short fights.
Checklist for this chapter
- Add expected damage, DPS and TTK columns to your attacker table.
- Add EHP to your target table.
- Compare TTK across levels and chart it.
- Compare your TTK values to the goals from the first chapter.
Exercise
An attacker deals 80 damage per hit, hits 75% of the time, crits 10% of the time for 3 times damage, and attacks every 2 seconds. A target has 900 health and 50 armor. Using the proportional armor formula applied to damage, what is the attacker's TTK (use the continuous version, with no rounding of attack counts), and what is the target's EHP?
Show answer
Post-armor damage is 80 100 / 150 = 53.33. The crit factor is 1 + 0.1 (3 - 1) = 1.2. Expected damage per attack is 53.33 0.75 1.2 = 48. Attacks needed are 900 / 48 = 18.75, so TTK is 18.75 2 = 37.5 seconds. The target's EHP is 900 (100 + 50) / 100 = 1350.
Exercise
A defender has 500 health and 100 armor. You can add either 150 health or 60 armor. Which gives more EHP, and by how much?
Show answer
Baseline EHP is 500 200 / 100 = 1000. Adding 150 health gives 650 200 / 100 = 1300. Adding 60 armor gives 500 * 260 / 100 = 1300. The two options are equal at 1300 EHP.