Sub topic 13
Tuning loop strength
This chapter assumes you can tell positive (reinforcing) feedback from negative (balancing) feedback, that you know what a stock and a flow are, and that you can read the short Python examples from earlier chapters. Here the question changes from which loop to use to how strong the loop should be.
Why strength is the real design decision
Choosing a loop type decides the direction of the effect. Strength decides the outcome. A 2% income bonus and a 20% income bonus are the same reinforcing loop, but the first is barely noticeable and the second ends most matches within a few turns.
In the simple models in this tutorial, strength is one number: the fraction of a stock that gets added or removed each turn.
- In a reinforcing loop, it is the growth rate
rate. The stock is multiplied by1 + rateeach turn. - In a balancing loop, it is the correction
strength. The gap to the target is multiplied by1 - strengtheach turn.
Both are per-turn multipliers, so their effects compound. Small changes to the number produce large changes after many turns.
Translating strength into player-facing time
A raw percentage is hard to reason about. Convert it into a time that players and designers can feel.
- Doubling time for a reinforcing loop is
ln(2) / ln(1 + rate)turns. - Half-life for a balancing loop is
ln(0.5) / ln(1 - strength)turns. It is the time for the gap to the target to halve.
import math
def doubling_time(rate):
return math.log(2) / math.log(1 + rate)
def half_life(strength):
return math.log(0.5) / math.log(1 - strength)
for r in (0.05, 0.10, 0.20):
print("rate", r, "doubles in", round(doubling_time(r), 2), "turns")
for k in (0.10, 0.25, 0.50):
print("strength", k, "halves the gap in", round(half_life(k), 2), "turns")| Reinforcing rate | Doubling time (turns) | Balancing strength | Half-life (turns) |
|---|---|---|---|
| 0.05 | 14.21 | 0.10 | 6.58 |
| 0.10 | 7.27 | 0.25 | 2.41 |
| 0.20 | 3.80 | 0.50 | 1.00 |
Now a design target such as "a leader should double their resources about once every act of the game" becomes a number you can solve for. If an act lasts 7 turns, a rate near 0.10 fits.
Strength is relative: the loop contest
A loop is rarely alone. When two loops act on the same quantity, only their relative strength matters. The two-player race from the earlier chapters is the clearest case. Let the leader's lead be d. Each round, the reinforcing loop grows the lead and the balancing loop shrinks it:
d_next = (1 + rate - catch_up) * d
The gap multiplier is 1 + rate - catch_up.
- If
catch_up < rate, the multiplier is above 1 and the lead grows. The reinforcing loop dominates. - If
catch_up == rate, the lead stays constant. The loops are balanced. - If
catch_up > rate, the lead shrinks. The balancing loop dominates.
So catch_up == rate is a tipping point where control switches from one loop to the other. You can tune around it on purpose. Put the balancing strength slightly below the reinforcing rate if you want leaders to stay ahead but only slowly pull away. Put it slightly above if you want leads to erode gently.
def gap_after(rounds, rate, catch_up, scores=(12.0, 10.0)):
a, b = scores
for _ in range(rounds):
lead = max(a, b)
a, b = (a + rate * a + catch_up * (lead - a),
b + rate * b + catch_up * (lead - b))
return a - b
for c in (0.0, 0.05, 0.10, 0.15, 0.20, 0.25, 0.30):
print(c, round(gap_after(10, 0.10, c), 2))After 10 rounds the printed gap is about 5.19, 3.26, 2.00, 1.20, 0.70, 0.39 and 0.21 as catch_up rises from 0 to 0.30. The starting gap is 2, so the gap is almost unchanged at catch_up 0.10. That is where it equals the rate.
Solving for a parameter instead of guessing
Because the gap multiplier has a closed form, you can work backward from a design goal. Suppose you want a 2-point lead to shrink to 0.5 after 10 rounds, with a growth rate of 0.10.
def catch_up_for(target_gap, start_gap, rounds, rate):
multiplier = (target_gap / start_gap) ** (1 / rounds)
return 1 + rate - multiplier
print(round(catch_up_for(0.5, 2.0, 10, 0.10), 3))This prints 0.229. Use closed forms to find a starting value, then confirm it with the simulation. The formula only holds for the simplified linear model. Once you add caps, thresholds or randomness, you have to sweep numerically.
Tuning range and its limits
Strength cannot be raised without limit. For a balancing loop, the gap multiplier 1 - strength has three regimes:
| Strength | Multiplier | Behavior |
|---|---|---|
| 0 to 1 | 1 to 0 | Smooth approach to the target |
| 1 | 0 | Snaps to target in one turn |
| 1 to 2 | 0 to -1 | Overshoots, swings back, settles |
| 2 or more | -1 or less | Swings never settle, or grow |
Past 1, the correction is bigger than the gap, so the stock overshoots the target and oscillates.
def balancing(turns, target=100.0, strength=0.25, start=20.0):
health = start
history = [health]
for _ in range(turns):
health += strength * (target - health)
history.append(health)
return history
print([round(x) for x in balancing(4, strength=1.5)])The output is [20, 140, 80, 110, 95]: it overshoots, then swings back around the target, with the swings shrinking by half each turn.
Delays make this worse. If the correction reacts to a stock value from two turns ago, it can overshoot even with strength below 1. Tune the strength of any loop with a delay more conservatively than the arithmetic suggests. Lower strength, or a smoothed signal such as a moving average, is the usual fix.
A repeatable tuning workflow
- State the goal as an observable. Examples: "the trailing player should be within 10% by mid-game", or "a lead of 20% should convert to a win 70% of the time".
- Pick a starting value using doubling time, half-life or the closed-form solution.
- Sweep one parameter at a time. Run many simulated matches at each setting and record the metric from step 1. Changing two strengths together hides which one caused the effect.
- Look for cliffs. Plot the metric against the parameter. A smooth slope is easy to tune. A sharp jump, such as near
catch_up == rate, means a small balance patch can change the whole game. - Playtest at the chosen value and at the values on each side of it. Players feel loops through events, not percentages. A mechanic that is mathematically gentle can still feel punishing if it fires at a dramatic moment.
- Record the value and the acceptable range. Later balance changes may shift the other loop, and the range tells you how much room you have.
Common errors
- Forgetting that rates compound. Raising
ratefrom 0.10 to 0.12 looks small, but over 20 turns the stock grows by1.12^20 ≈ 9.6instead of1.1^20 ≈ 6.7. - Treating strength as the visible number. A "+10% bonus" is a reinforcing rate only if it applies to a stock that grows. If it applies to a fixed base, it is a constant flow and is much weaker.
- Comparing loops on different time scales. If one loop fires every turn and another fires every three turns, convert both to a per-turn rate before comparing.
- Hiding the balancing loop so well that players cannot learn it. A loop that cannot be perceived reads as luck, which affects perceived fairness. Tuning can make a loop effective but not legible.
- Tuning away the tension. A balancing loop that is too strong makes every match end close regardless of play, so skill stops mattering.
Exercise
A reinforcing loop has rate 0.15 and a balancing loop has catch-up 0.15. A leader leads by 4 points. After 6 rounds, about how large is the lead, and what happens if you raise catch-up to 0.20?
Show answer
At equal strengths the gap multiplier is 1 + 0.15 - 0.15 = 1, so the lead stays at 4. With catch-up 0.20 the multiplier is 0.95, so after 6 rounds the lead is 4 * 0.95^6, which is about 2.94. The balancing loop now dominates and the lead shrinks.
Exercise
A balancing loop pulls a stock toward a target with strength 1.8, and its correction uses a value that is one turn old. Why is this a poor design, and what two changes could you try?
Show answer
Strength above 1 already overshoots the target each turn, and the one-turn delay adds to the swings, so the stock oscillates and may never settle. Lower the strength well below 1, for example to 0.3, or smooth the input signal, for example with a moving average, so the correction reacts less sharply.