Sub topic 11
Tuning a Game by Changing Mechanics and Observing Dynamics
This chapter assumes you know the three MDA layers (mechanics, dynamics, aesthetics), what a feedback loop is, and how to read short Python functions. It covers how to adjust a game once a first version exists. You change one mechanic at a time and measure the dynamic it was meant to produce.
Why tuning is a separate activity
A first draft of a rule set is a guess. The designer picks a mechanic because it should produce a dynamic, and the dynamic should support an aesthetic. Each link in that chain can fail on its own:
- The mechanic may not produce the dynamic at all.
- It may produce the dynamic at the wrong strength.
- The dynamic may appear but fail to create the intended feeling.
Tuning is the loop that finds and fixes these failures. The key rule is that you edit mechanics and observe dynamics. You cannot edit a dynamic directly. "More lead changes" is not a rule. It is a result you get by changing numbers, rules, or data.
The tuning loop
The final step matters. Hitting a numeric target tells you the dynamic is right. It does not tell you the players feel what you wanted.
Step 1: Turn the aesthetic into a measurable dynamic
You cannot measure "tense races". You can measure properties that support tension. Suppose the aesthetic goal is challenge, with close races. Two target dynamics follow from it:
- Lead changes happen often during a race.
- The final gap between the racers is small.
Each target needs a number and a direction. "Average of at least 5 lead changes per 100 steps" can be tested. "More exciting" cannot.
Step 2: Expose the mechanic as parameters
A tunable mechanic has explicit parameters. Here is the catch-up rule from the worked example:
def racer_speed(base_speed, gap_behind_leader, boost_per_unit=0.05, max_boost=0.3):
"""Mechanic: a trailing racer gets a speed bonus proportional to the gap, capped at max_boost."""
gap = max(gap_behind_leader, 0.0)
boost = min(gap * boost_per_unit, max_boost)
return base_speed * (1 + boost)There are two knobs. boost_per_unit sets how strongly the rule reacts to the gap. max_boost sets the most help a racer can ever get. They affect different parts of the dynamic. The first controls how quickly a small gap closes. The second limits how much a large gap can be helped. A rule with no parameters is hard to tune, because every change becomes a rewrite.
Step 3: Measure the dynamic by simulation
One run of a random race tells you very little. You need many runs of the same configuration, then an average. The simulation below takes the catch-up parameters as arguments and repeats the race over many seeds.
import random
def simulate_race(boost_per_unit, max_boost=0.3, steps=100, seed=1):
rng = random.Random(seed)
pos = [0.0, 0.0]
leaders = []
for _ in range(steps):
for i in range(2):
gap = max(pos[1 - i] - pos[i], 0.0)
base = rng.uniform(0.8, 1.2)
boost = min(gap * boost_per_unit, max_boost)
pos[i] += base * (1 + boost)
leaders.append(0 if pos[0] > pos[1] else 1)
lead_changes = sum(1 for a, b in zip(leaders, leaders[1:]) if a != b)
return lead_changes, abs(pos[0] - pos[1])
def measure(boost_per_unit, max_boost=0.3, runs=200):
total_changes = 0
total_gap = 0.0
for seed in range(runs):
changes, gap = simulate_race(boost_per_unit, max_boost, seed=seed)
total_changes += changes
total_gap += gap
return total_changes / runs, total_gap / runs
print("boost avg_lead_changes avg_final_gap")
for boost in (0.0, 0.02, 0.05, 0.1, 0.3):
changes, gap = measure(boost)
print(f"{boost:<6} {changes:<17.2f} {gap:.2f}")Each row of output is one setting of the mechanic. Read the table as a curve. As boost_per_unit rises, you should see the average final gap fall and the lead-change count rise. Run it yourself and look at where the curve flattens or turns. The shape matters more than any single value.
The simulation has a simplification you should know about. Racers move one after the other inside each step, so the second racer sees the first racer's updated position. This gives a small bias that a real game would avoid by computing both moves from the same starting positions. It is acceptable for a rough check, but treat very small differences between settings with caution.
Step 4: Change one thing at a time
If you change boost_per_unit, max_boost, and the speed range in one edit, you cannot say which change caused the result. Follow these habits:
- Record the current numbers and the measured dynamics before you edit.
- Change exactly one parameter.
- Re-measure with the same seeds and the same number of runs.
- Keep a log of each change and its effect.
Using the same seeds is important. It makes the comparison fair, because both versions face the same random sequences. Differences in the output then come from your change and not from luck in the dice.
| Change | Likely effect on dynamics | Risk |
|---|---|---|
| Raise `boost_per_unit` | Gaps close faster, more lead changes | Leader is punished for being ahead |
| Lower `max_boost` | Big gaps close more slowly | A far-behind player may stay far behind |
| Narrow the base-speed range | Less luck, results follow earlier gaps | The race becomes predictable |
| Widen the base-speed range | More luck, more variation | Skill matters less |
Step 5: Watch for overshoot and side effects
A negative feedback mechanic can overcorrect. If the boost is too strong, the trailing racer overtakes, the former leader now gets the boost, and the lead flips back and forth. The count of lead changes is high, but the race feels arbitrary because nothing a player does matters. The number looks good while the aesthetic is damaged.
Tuning one mechanic also changes dynamics you were not aiming at. A stronger catch-up rule raises the lead-change count, but it may also lower how much skill matters. If another aesthetic depends on mastery, such as challenge defined as rewarding skill, you have traded one for the other. Measure more than one dynamic each time:
- Lead changes (the target).
- Final gap (the target).
- How often the better racer wins (a side effect you want to protect).
Step 6: Stop with a tolerance, not a perfect value
A simulation gives noisy averages, and players are noisier. Set a tolerance band before you start, for example "average final gap between 3 and 6". When the measured value falls inside the band, stop tuning that parameter. Chasing the exact middle of a band wastes effort and tends to overfit your simulation, meaning you tune to the quirks of the model and not to the real game.
Step 7: Confirm with players
Simulation answers whether the mechanic produces the dynamic. It cannot answer whether the dynamic produces the aesthetic. For that you need playtests, which the next chapters in this plan cover in more detail. When you bring tuning results to a playtest:
- Ask players about the experience, such as whether the race felt close, not about your parameters.
- Compare two builds with only one mechanic changed.
- If the numbers are on target but players report a flat or random feel, the problem is probably in the dynamic-to-aesthetic link. Look for a different dynamic, or a different mechanic, instead of pushing the same parameter further.
Common errors
- Tuning by feel after every playtest. A single session is a small sample. Collect several before you change a number.
- Changing several parameters at once. The cause of the change in behavior is lost.
- Different seeds between comparisons. Variation from randomness hides or fakes the effect.
- Only measuring the target. Side effects on other dynamics go unnoticed.
- Treating the simulation as the game. It only contains the mechanics you modeled. Missing elements, such as items or player choice, can change the dynamics entirely.
Exercise
In the simulation above, you raise boost_per_unit from 0.05 to 0.3. The average lead-change count goes up sharply, but playtesters say races feel random. Name the likely cause in MDA terms, and describe one change and one guard metric you would use next.
Show answer
The mechanic is probably overcorrecting. The trailing racer's boost is so large that the lead flips constantly regardless of what the players do, so the dynamic (many lead changes) no longer supports the aesthetic (challenge through close, skill-driven races). Reduce boost_per_unit to a middle value such as 0.1, or lower max_boost, changing only one of them and re-measuring with the same seeds. A guard metric is the fraction of races won by the racer with the higher average base speed. It should stay clearly above 50 percent, which shows that skill or speed still matters.
Exercise
Why should you reuse the same random seeds when you compare two settings of a mechanic, and what is the downside of tuning against a simulation only?
Show answer
Reusing seeds means both settings face the same random sequences, so any difference in the measured dynamics comes from your change and not from luck. The downside of relying only on simulation is that it models only the mechanics you included. It can show that a mechanic produces a dynamic, but it cannot show that the dynamic produces the intended feeling in players, so playtests are still needed.