Sub topic 10
Matchup matrices and spotting dominant options
Where this fits
This chapter assumes you have finished the derived-metrics chapter. You should have a Units table with health, armor, damage, hit chance, crit chance and attack interval, and you should be comfortable with the expected-damage and time-to-kill formulas. You should also know INDEX and MATCH.
A single time-to-kill number says how fast one unit kills one target. It does not say whether a unit is a good choice. For that you compare every option against every other option, which is what a matchup matrix does.
What a matchup matrix tells you
A matchup matrix is a grid. Each row is an option (a unit, class, weapon or deck), and each column is an opponent. Each cell holds a payoff, a number that says how well the row option does against the column option.
The grid answers three questions that single-option metrics cannot:
- Is any option dominant? A dominant option is one that is as good as or better than every other option in every matchup. No reasonable player would pick anything else.
- Is any option useless? A useless option never gains an advantage in any matchup, so nobody has a reason to pick it.
- Do the options counter each other? A healthy roster has options that win some matchups and lose others, so the best pick depends on what the opponent chooses.
The example roster
Four units go on a Units sheet. Column I is a helper column for raw damage per second before armor:
=D2*E2*(1+F2*(G2-1))/H2| A: Name | B: Health | C: Armor | D: Damage | E: Hit | F: Crit | G: Crit mult | H: Interval (s) | I: Raw DPS |
|---|---|---|---|---|---|---|---|---|
| Knight | 1200 | 80 | 40 | 0.90 | 0.05 | 1.5 | 1.0 | 36.9 |
| Archer | 700 | 20 | 55 | 0.85 | 0.20 | 2.0 | 1.2 | 46.75 |
| Mage | 600 | 0 | 90 | 1.00 | 0.10 | 1.5 | 2.0 | 47.25 |
| Rogue | 800 | 40 | 35 | 0.95 | 0.30 | 2.0 | 0.6 | 72.04 |
Column I combines the expected-damage formula from the earlier chapter with the attack interval. It uses damage * hit * (1 + crit * (mult - 1)), then divides by the seconds between attacks.
Step 1: build the time-to-kill matrix
Create a TTK sheet. Put the unit names down column A (rows 2 to 5) and across row 1 (columns B to E). Each cell is the time for the row unit (the attacker) to kill the column unit (the defender):
=INDEX(Units!$B$2:$B$5,MATCH(B$1,Units!$A$2:$A$5,0))/(INDEX(Units!$I$2:$I$5,MATCH($A2,Units!$A$2:$A$5,0))*100/(100+INDEX(Units!$C$2:$C$5,MATCH(B$1,Units!$A$2:$A$5,0))))This is the time-to-kill formula health / damage per second with the armor formula 100 / (100 + armor) applied to the defender's armor. The mixed references (B$1 and $A2) let you fill the formula across the whole grid. Looking units up by name means you can reorder the Units sheet without breaking the matrix.
Results, in seconds:
| Attacker \ Defender | Knight | Archer | Mage | Rogue |
|---|---|---|---|---|
| Knight | 58.5 | 22.8 | 16.3 | 30.4 |
| Archer | 46.2 | 18.0 | 12.8 | 24.0 |
| Mage | 45.7 | 17.8 | 12.7 | 23.7 |
| Rogue | 30.0 | 11.7 | 8.3 | 15.6 |
Read it by rows. The Rogue kills every target fastest. The Knight is slowest against nearly everyone, but the table has no column for how long each unit survives.
Step 2: turn two time-to-kill values into one payoff
A fight has two clocks. Your attacker kills the defender in TTK(me, them) seconds, and the defender kills you in TTK(them, me) seconds. The payoff compares the two:
=INDEX(TTK!$B$2:$E$5,MATCH(B$1,TTK!$A$2:$A$5,0),MATCH($A2,TTK!$B$1:$E$1,0))/TTK!B2Put this on an Edge sheet laid out like TTK. The numerator is the opponent's time to kill you. It is the transposed cell, found by swapping the row and column lookups. The denominator is your time to kill them.
An edge above 1 means you win the race, 1 means a tie, and below 1 means you lose. Edge ratios are easy to read, but they are not symmetric. Winning by a factor of 2 is 2.0 and losing by a factor of 2 is 0.5, so average them with LN, or with a geometric mean, rather than a plain average.
| Row \ Column | Knight | Archer | Mage | Rogue |
|---|---|---|---|---|
| Knight | 1.0 | 2.0 | 2.8 | 1.0 |
| Archer | 0.5 | 1.0 | 1.4 | 0.5 |
| Mage | 0.4 | 0.7 | 1.0 | 0.4 |
| Rogue | 1.0 | 2.1 | 2.8 | 1.0 |
The diagonal is always 1.0 because a unit fights an identical copy of itself. Apply a color scale with the midpoint set at 1, so green means advantage and red means disadvantage. Patterns in a matrix show up much faster as color than as numbers.
Step 3: flag dominant and useless options
Put a tolerance in Params!B6, for example 0.05. Differences smaller than 5% are noise at this level of modeling, and the tolerance lets you change that threshold in one place. Then add a flag column next to the Edge grid:
=IF(MIN(B2:E2)>=1-Params!$B$6,"Dominant",IF(MAX(B2:E2)<=1+Params!$B$6,"Useless","Mixed"))Add a second column for a typical strength score:
=EXP(AVERAGE(LN(B2),LN(C2),LN(D2),LN(E2)))This is the geometric mean of the row's edges. Newer spreadsheet versions let you write it as =GEOMEAN(B2:E2).
For the example roster:
| Unit | Flag | Reading |
|---|---|---|
| Knight | Dominant | Never loses a race by more than 1%, wins two clearly |
| Archer | Mixed | Beats only the Mage |
| Mage | Useless | Never exceeds an edge of 1.0 |
| Rogue | Dominant | Ties or wins every race |
The model flags two problems. The Rogue and Knight are both dominant, and the Mage is useless. The Knight–Rogue tie at about 1.0 means those two are interchangeable in this model, but both beat everything else. The roster is closer to "two good picks and two bad ones" than to a counter-based game.
Checks that keep the matrix honest
Run these checks on every version of the matrix. They catch most formula mistakes.
- Reciprocity. Edge(i, j) times Edge(j, i) must equal 1 for every pair. Use
=B3*C2on one pair, or a whole-grid check such as=SUMPRODUCT(--(ABS(Edge!B2:E5*TRANSPOSE(Edge!B2:E5)-1)>0.001)), which should return 0. In some spreadsheets this formula must be entered as an array formula. - Diagonal equals 1. If a mirror matchup is not 1.0, a lookup is pointing at the wrong row or column.
- Division by zero. A unit with zero damage, or an attack interval of zero, makes a TTK infinite or an error. Wrap the TTK formula in
IFERROR(..., 9999)so one bad row does not blank the whole grid, and make the fallback value obvious. - Negative armor.
100/(100+armor)fails at armor -100 and turns damage negative below that. Restrict armor to at least 0 with data validation on the Units sheet. - Ordering. Sort by the strength score only on a copy. Sorting the live grid can break the mixed references.
Why a single-fight edge is not enough
The edge ratio assumes one unit fights one unit, with both attacking from the first second and nothing else happening. Four things commonly break that assumption:
- Overkill and rounding. In a game with discrete hits, a unit that needs 4.1 attacks takes 5. Convert time-to-kill to
ROUNDUP(health / damage per hit)attacks when hit counts are small. - Intransitive cycles. If A beats B, B beats C, and C beats A, that is a deliberate rock-paper-scissors structure. The row checks will flag every unit as "Mixed", which is what you want. The matrix does not tell you which pick is best unless you know how often opponents pick each option.
- Pick rates. A unit that beats the three most common opponents is stronger in practice than one that beats three rare ones. Add a column of pick-rate weights on the Params sheet and use
SUMPRODUCTfor a weighted score:
=SUMPRODUCT(B2:E2,Params!$B$10:$E$10)Here Params!B10:E10 holds the share of players expected to use each unit, and those shares should sum to 1.
- Cost. A unit that wins every race but costs four times as much is not dominant. Compare the matrix against costs in the next chapter's power budget before you make changes.
Turning flags into changes
Pick the cheapest fix that moves the flag. For the example roster:
- The Mage is useless because it has no armor and little health, and its high damage is too slow to compensate. Raising its health or cutting its attack interval raises every edge in its row, because the TTK of its opponents falls.
- The Rogue dominates because of its 0.6 s interval and 30% crit. Lowering the crit chance, or raising the interval a little, lowers the Rogue's strength against everyone at once.
- Each change is a single Params or Units edit followed by a recalculation. Record the before and after flags so you can see what moved.
The next chapter systematizes that last step by asking which parameter, changed by the same percentage, moves the outcome the most.
Exercise
In the Edge matrix above, the Archer's edge against the Mage is 1.4. Suppose you give the Mage an attack interval of 1.5 s instead of 2.0 s. Without recomputing the whole grid, state which entries in the Mage's row and the Mage's column change and in which direction. Then give the new raw DPS of the Mage.
Show answer
The Mage's raw DPS rises from 47.25 to 94.5 * 1.0 / 1.5 = 63.0. A higher DPS lowers the Mage's TTK against every opponent (its own row in the TTK matrix), so each edge in the Mage's row rises, including the Archer-vs-Mage reciprocal pair: the Mage's edge against the Archer rises and the Archer's edge against the Mage falls, since the two are reciprocals. The Mage's TTK against others does not change in other rows of the TTK matrix, but the Edge column entries for the Mage fall for all opponents because their edges are the reciprocals of the Mage's row. The Mage's own health and armor are unchanged, so the opponents' TTK against the Mage (the Mage's column in TTK) is the same.
Exercise
A new unit has an Edge row of 1.0, 1.3, 1.1 and 1.0 against the four existing units, and a tolerance of 0.05 in Params!B6. What does the flag formula return, and what should you check before changing the unit?
Show answer
MIN of the row is 1.0, which is at least 1 - 0.05 = 0.95, so the formula returns "Dominant". Before changing the unit, check its cost against the power budget, and check mechanics the time-to-kill model ignores, such as range and abilities, because those may already counterbalance it.