Sub topic 6
Power-to-cost ratio and spotting outliers
This chapter assumes you have read the earlier chapters on common currency, stat valuation, and the linear cost baseline. You should be able to read short Python functions and compare numbers as ratios.
A cost curve says what a unit, item, or ability should cost for a given power. The next question is how to check a whole catalog against that expectation. The power-to-cost ratio answers it with one number per item.
The ratio and what it measures
For each item, divide its power (from the earlier stat valuation) by its cost:
efficiency = power / costAn efficiency of 1.6 means the item gives 1.6 points of power for each point of cost. Higher efficiency is better value for the player. The absolute number carries no meaning on its own, because it depends on your currency and scale. It only matters relative to other items.
For that reason, audits use the relative efficiency: each item's efficiency divided by a typical efficiency for the catalog. A relative efficiency of 1.0 is on-curve. 1.25 means the item gives 25% more power per cost than typical (under-costed). 0.8 means it gives 20% less (over-costed).
| Relative efficiency | Reading | Typical player behavior |
|---|---|---|
| Near 1.0 | On the curve | Chosen when it fits the situation |
| Well above 1.0 | Under-costed | Picked by default, crowds out alternatives |
| Well below 1.0 | Over-costed | Ignored, so the content is effectively wasted |
Both directions are balance bugs. Over-costed items are quieter, because nobody complains about a card they never see.
A first audit
The spine's example computes each ratio, compares it to the mean, and flags anything outside a tolerance:
def flag_outliers(units, tolerance=0.15):
# units maps name -> (power, cost)
ratios = {name: power / cost for name, (power, cost) in units.items()}
mean = sum(ratios.values()) / len(ratios)
relative = {name: ratio / mean for name, ratio in ratios.items()}
return {name: r for name, r in relative.items() if abs(r - 1) > tolerance}
units = {"Archer": (16, 10), "Knight": (30, 20), "Mage": (40, 20)}
print(flag_outliers(units))The efficiencies are 1.6, 1.5, and 2.0, and the mean is 1.7. The relative values are about 0.94, 0.88, and 1.18. Only the Mage is more than 0.15 away from 1.0, so the function returns {'Mage': 1.176...}. The Knight is the cheapest-looking value at 0.88, but 12% below average is inside the tolerance, so it is not flagged.
Choosing the tolerance
The tolerance is a design decision, not a constant. Consider three things when you set it.
- Noise in your power estimates. If your stat values are rough guesses, a 15% gap may be estimation error, not a real imbalance.
- Granularity of cost. If costs are small integers (1 to 10), rounding alone produces large swings. A unit that "should" cost 2.4 will cost 2, which is already 17% under.
- Cost of being wrong. In a competitive game, 10% under-costing can dominate a meta. In a casual single-player game, 30% may be fine.
A practical approach is to start loose (25%), fix what it finds, then tighten it.
Gotcha 1: the mean is pulled by the outliers
The mean is the wrong center for an audit, because the items you are hunting for distort it. Suppose three units sit exactly on the curve and one is wildly under-costed:
from statistics import mean, median
def flag_outliers(units, tolerance=0.15, center=median):
ratios = {name: power / cost for name, (power, cost) in units.items()}
mid = center(ratios.values())
relative = {name: ratio / mid for name, ratio in ratios.items()}
return {name: round(r, 2) for name, r in relative.items() if abs(r - 1) > tolerance}
units = {"A": (10, 10), "B": (20, 20), "C": (30, 30), "D": (90, 30)}
print(flag_outliers(units, center=mean))
print(flag_outliers(units))The efficiencies are 1, 1, 1, and 3. The mean is 1.5, so the mean-centered audit prints {'A': 0.67, 'B': 0.67, 'C': 0.67, 'D': 2.0}. It flags every unit, and it blames the healthy ones. The median is 1.0, so the median-centered audit prints {'D': 3.0} and names only the real problem.
Use the median as the default center. It is robust, because a few extreme items do not move it.
Gotcha 2: a flat ratio assumes a linear curve
Power divided by cost is only constant across a catalog if cost is linear in power. If you chose a superlinear curve (say exponent 1.3), then strong items are supposed to have lower efficiency than weak ones. A flat audit will flag every expensive item as over-costed and every cheap item as a bargain, even when your pricing follows the design exactly.
The fix is to compare cost to the curve's expected cost instead of comparing raw ratios:
def cost_ratio(power, cost, scale=1.0, exponent=1.0):
# > 1 means over-costed, < 1 means under-costed
return cost / (scale * power ** exponent)
units = {"Archer": (16, 10), "Knight": (30, 20), "Mage": (40, 20)}
for name, (power, cost) in units.items():
print(name, round(cost_ratio(power, cost, scale=0.625), 2))With scale=0.625 and the default linear exponent, the expected costs are 10, 18.75, and 25. The output is:
Archer 1.0
Knight 1.07
Mage 0.8The Mage costs 80% of what the curve says it should, so it is under-costed by 20%. Notice that this ratio is inverted compared to efficiency: here a value below 1.0 means a bargain. Pick one direction for your team and label every column in your audit tables, because mixing the two is a common source of "fix the wrong unit" mistakes.
To audit a superlinear catalog, pass exponent=1.3 and the scale you fitted. The ratio then stays near 1.0 for on-curve items at every power level.
The audit workflow
The branch at "many items flagged" matters. One outlier usually means one bad price. A cluster of outliers in the same power range means the curve is the wrong shape there. For example, a cluster of cheap-looking high-tier items suggests the exponent is too low. Repricing each item individually would just paper over that.
Interpreting a flag
A flag only tells you that an item's price disagrees with its computed power. It does not say which one is wrong. Before changing a price, check the following in order.
- Is the power estimate right? An item with an unusual stat mix may hold a stat whose value you set badly. If every item with high speed is flagged, the speed value is suspect, not each item.
- Is there an ability the formula ignores? Abilities priced with expected value (a later chapter) may be missing a chance, uptime, or drawback term.
- Is it intentional? Designers sometimes under-cost an item on purpose, such as a tutorial unit or a weak but fun joke card. Record an exception list so a later audit does not re-flag it every time.
- Does context change its power? A unit can be on-curve in isolation and still dominate in a particular combination. That is the limit of this method, covered in the chapters on synergies and on where cost curves fail.
Reporting results
When you share an audit, sort by relative efficiency and show both ends. A short table is easier to act on than a list of every item:
| Item | Power | Cost | Cost ratio | Verdict |
|---|---|---|---|---|
| Mage | 40 | 20 | 0.80 | Under-costed |
| Archer | 16 | 10 | 1.00 | On-curve |
| Knight | 30 | 20 | 1.07 | Slightly over |
Include the tolerance and the center (median or mean) in the report. Without them, nobody can reproduce your flags, and a reviewer cannot tell a real finding from a threshold artifact.
Exercise
A catalog has five items with efficiencies (power / cost) of 2.0, 2.0, 2.0, 2.0, and 1.0. Using a tolerance of 0.15, which items does a mean-centered audit flag, and which does a median-centered audit flag? Which result is more useful, and why?
Show answer
The mean is (8 + 1) / 5 = 1.8, so the relative values are about 1.11 for each 2.0 item and 0.56 for the 1.0 item. With tolerance 0.15, the mean-centered audit flags only the 1.0 item, because 1.11 is within 0.15 of 1.0 only if the difference 0.11 is under 0.15, which it is. The median is 2.0, so the relative values are 1.0 for the four items and 0.5 for the 1.0 item. The median-centered audit also flags only the 1.0 item. Both agree here, because the single outlier is not extreme enough to shift the mean past the tolerance. The median is still the safer default: with a larger outlier (for example an efficiency of 10.0 in place of 1.0) the mean would rise to 3.6 and flag all the healthy items, while the median would stay at 2.0 and flag only the outlier.
Exercise
Your cost curve uses exponent 1.3. A flat power / cost audit flags every item above power 40 as "over-costed". Is this a real problem with the items? What would you change in the audit?
Show answer
Not necessarily. With exponent 1.3, expensive items are supposed to have lower power per cost, so a flat ratio audit will flag them even when they follow the design. Change the audit to compare each item's cost to the curve's expected cost, cost / (scale * power ** exponent), so on-curve items stay near 1.0 at every power level. Then see whether any high-power items still sit outside tolerance.