Sub topic 4
The linear baseline
This chapter assumes you can read short Python examples and know basic game design vocabulary: stats, resources, abilities, and tiers. It also assumes you have seen the idea of a common currency, where every stat and effect is priced in the same unit. Here we use that idea to build the simplest cost curve, the linear one, and test where it holds up and where it breaks.
What a linear baseline is
A cost curve maps the power of a piece of content to its cost. The linear baseline is the simplest version: cost is proportional to power.
cost = scale × powerIf a unit with 16 power costs 10 gold, then a unit with 32 power costs 20 gold. Double the power, double the price. The only free parameter is scale, the price of one point of power.
You rarely keep a linear curve as your final model. You build it first because it gives you three things.
- A reference line. Every later refinement (superlinear curves, diminishing returns) is described as a departure from this line.
- A fast audit tool. Content that sits far from the line is suspicious, and you can see that with one division.
- A model you can explain. Designers, artists, and programmers can all check a linear price by hand.
Step 1: Compute power from stats
The previous chapter assigned each stat a value in the common currency. A unit's raw power is the weighted sum of its stats.
STAT_VALUE = {"attack": 2.0, "health": 0.5, "speed": 3.0}
def raw_power(stats):
return sum(STAT_VALUE[name] * amount for name, amount in stats.items())
print(raw_power({"attack": 4, "health": 10, "speed": 1})) # 8 + 5 + 3 = 16.0Here one point of attack is worth 2.0 units of power, one point of health is worth 0.5, and one point of speed is worth 3.0. The Archer with 4 attack, 10 health, and 1 speed has a raw power of 16.0.
The weights encode design decisions. Speed is priced high because, in this imagined game, it is scarce and hard to counter. If you later change the weight of speed, every unit's power changes, so treat the weights as shared constants and record why you chose them.
Step 2: Turn power into cost
With power computed, the linear price is one multiplication. The code below uses the general power-law form, with the exponent fixed at 1.0 to make the curve linear.
def cost_from_power(power, scale=1.0, exponent=1.0):
return scale * power ** exponent
for power in (10, 20, 40):
print(power, round(cost_from_power(power, scale=0.625), 1))With scale=0.625, the Archer's 16 power costs exactly 10. The output for the loop is:
10 6.2
20 12.5
40 25.0Doubling power doubles the cost each time. Writing the function with an exponent argument now means the next chapter can change one number to bend the curve.
Choosing the scale
The scale answers the question "how much of the budget does one point of power consume?" There are two practical ways to pick it.
- Anchor on a reference unit. Choose a unit you trust, such as a basic infantry unit, and set
scale = cost / powerfor it. Everything else is priced relative to that anchor. - Anchor on the budget. If a player earns 100 gold per turn and you want a typical army of 5 units, an average unit should cost about 20. Set the scale so average power maps to that number.
Both methods give the same kind of answer. The anchor method is easier to defend in a design review because you can point at a specific unit that "feels right."
What the linear model implies
Linearity makes a strong claim: one big unit and several small units of the same total power cost the same. A 40-power unit costs 25, and four 10-power units cost 4 × 6.25 = 25.
That claim is often false in play. Consider three real effects the linear model ignores.
- Action economy. In games where each unit acts once per turn, four small units act four times and one big unit acts once. Four small units can be worth more than their summed stats.
- Concentration. One big unit can carry equipment, receive buffs, and survive focus fire. A single strong unit can be worth more than the same power spread over many bodies.
- Board space or population limits. If you can field only six units, the cost of a slot matters as much as the cost of the stats.
Which of these effects dominates depends on your game. That is why the linear model is a baseline: it tells you what balance would look like if power were the only thing that mattered.
Using the baseline as an audit tool
Because linear cost is proportional to power, the power-to-cost ratio should be the same for every unit. Content with a different ratio is either cheap or expensive for what it does.
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))Walk through the numbers.
| Unit | Power | Cost | Power per cost | Relative to mean |
|---|---|---|---|---|
| Archer | 16 | 10 | 1.60 | 1.07 |
| Knight | 30 | 20 | 1.50 | 1.00 |
| Mage | 40 | 20 | 2.00 | 1.33 |
The mean ratio is 1.70. The Archer sits at about 0.94 of the mean and the Knight at about 0.88 when computed exactly, while the Mage sits at about 1.18. With a tolerance of 0.15, the Knight and the Mage are flagged. The table above rounds relative values for readability, so rerun the code and read the actual output rather than trusting hand-rounded figures.
The Mage gives far more power per gold than the others. Either its price is too low, or its stats are overvalued, or its power is not as useful as the number suggests.
Picking the tolerance
The tolerance argument sets how far from the mean a ratio can drift before it is flagged. A value of 0.15 flags anything more than 15% away.
- Too tight (for example 0.02) flags nearly everything, because stat weights are estimates and rounding in prices alone creates drift.
- Too loose (for example 0.5) lets obviously bad content through.
- A starting point is the size of your price steps. If prices move in steps of 5 gold on a 20 gold unit, a 25% difference is built into the system, and a tolerance below that is noise.
Common errors with a linear baseline
- Pricing from stats that are not independent. If health and defense both reduce damage taken, adding their values counts survivability twice. Check whether stats overlap before summing them.
- Using the mean as the truth.
flag_outlierscompares each unit to the average ratio. If most of your content is mispriced in the same direction, the mean is wrong too, and nothing is flagged. Anchor on a trusted reference unit as well. - Mixing tiers in one audit. A late-game unit and an early-game unit may follow different curves. Auditing them together makes the mean meaningless. Audit one tier at a time.
- Rounding prices before auditing. If the price is rounded to the nearest 5, a unit with an ideal price of 12 and a listed price of 10 shows a 20% gap that is purely rounding. Audit against the unrounded price when you can.
- Treating zero or tiny costs as normal. Dividing by a cost near zero produces huge ratios. Free or near-free content, such as a starting unit, should be excluded or handled separately.
When the linear baseline is enough
A linear curve is a reasonable final model in a few cases.
- Point-buy systems where the player builds a unit from stats and every point has the same price, such as many tabletop character builders.
- Small content sets where you have too little data to justify a more complex curve.
- Early prototypes where you need a defensible first pass and expect to revise.
It is a poor final model when strong content is much more powerful than its stat total suggests, or when cheap content is nearly worthless. Both patterns are the signal to move to the superlinear and diminishing-returns shapes in the next chapter.
Summary
- A linear cost curve sets
cost = scale × power. The only parameter is the scale. - Power comes from a weighted sum of stats, using the values from your common currency.
- Choose the scale by anchoring on a trusted unit or on a budget.
- Linearity says that many small units and one large unit of equal power cost the same, which is often untrue in play.
- The power-to-cost ratio is constant on a linear curve, so deviations point to content worth investigating.
- A flagged unit needs a human decision about whether the price or the power estimate is wrong.
Exercise
A unit has 5 attack, 8 health, and 2 speed, using the values attack = 2.0, health = 0.5, speed = 3.0. A reference unit has 16 power and costs 10 gold. (a) What is the unit's raw power? (b) What is the linear scale, and what should the unit cost? (c) The unit is listed at 12 gold. Is it cheap or expensive for its power, and by roughly how much?
Show answer
(a) Power = 5 × 2.0 + 8 × 0.5 + 2 × 3.0 = 10 + 4 + 6 = 20. (b) Scale = 10 / 16 = 0.625, so the linear cost is 20 × 0.625 = 12.5 gold. (c) At 12 gold the unit is slightly cheap, because the linear price is 12.5. Its power per gold is 20 / 12 ≈ 1.67 against the reference 1.60, about 4% better than the reference, which is well inside a 15% tolerance and not worth flagging.
Exercise
Four 10-power units each cost 6.25 gold under a linear curve with scale 0.625, and one 40-power unit costs 25 gold. Name one reason players might still prefer the single 40-power unit, and one reason they might prefer the four small units. What does this say about the linear model?
Show answer
The single unit can carry equipment and buffs and takes up one population slot, so it can be worth more than its stat total. The four small units act four times per turn and are harder to eliminate with one attack, so they can be worth more under action-economy rules. Either result means the true value of power depends on context, and the linear model, which prices only total power, cannot capture that. This is the motivation for superlinear and diminishing-returns curves.