Sub topic 5
Negative feedback: pulling a system back toward balance
This chapter assumes you know what a stock and a flow are, and that you can read a short Python loop. Earlier chapters defined feedback loops and positive feedback. This one covers the opposite kind: the loop that makes a game settle instead of explode.
What negative feedback does
A negative feedback loop, also called a balancing loop, pushes a stock back toward a target value. The further the stock is from the target, the stronger the push. As the gap closes, the push fades.
"Negative" does not mean "bad." It means the loop acts against the direction of change. If the stock is too high, the loop lowers it. If the stock is too low, the loop raises it.
A home thermostat is the standard example. The room temperature is the stock. The target is the thermostat setting. The gap between them decides how hard the heater works.
Games are full of these loops:
- Health regeneration. In many shooters, your health refills while you avoid damage. The lower your health, the more there is to regain. The target is full health.
- Upkeep costs. In strategy games, each extra unit or city costs gold or happiness per turn. The bigger you get, the more the economy pushes back.
- Item balancing in racers. In kart racers, players in last place tend to receive stronger items than players in first place. The gap to the leader drives the help you get.
- Hunger or fatigue. In survival games, the longer you go without eating, the stronger the pressure to eat.
Each case has the same shape: a stock, a target, a gap, and a correction that depends on the gap.
The structure of a balancing loop
Every balancing loop has four parts:
- A stock you care about, such as health.
- A target (also called a goal or equilibrium), such as full health.
- A gap, which is the target minus the current stock.
- A correcting flow, which changes the stock in the direction that closes the gap.
In a causal loop diagram, you can tell a loop is balancing by counting its opposing links. A loop with an odd number of "opposite direction" links is balancing. Here the link from stock to gap is opposite: more stock means a smaller gap. The other links are same-direction. That gives one opposing link, so the loop is balancing. A later chapter covers these diagrams in full.
The math in one line
The simplest balancing loop updates the stock each turn like this:
stock = stock + strength * (target - stock)The strength value is the fraction of the gap closed each turn. It is a loop parameter you control as a designer. Here is the runnable version:
def balancing(turns, target=100.0, strength=0.25, start=20.0):
health = start
history = [health]
for _ in range(turns):
health += strength * (target - health) # correction shrinks as the gap closes
history.append(health)
return history
print(balancing(5))The output is [20.0, 40.0, 55.0, 66.25, 74.6875, 81.015625]. The first correction is 20 points. The second is 15. The third is 11.25. Each correction is smaller than the last because the gap is smaller.
The gap after n turns is gap0 * (1 - strength)^n. With strength = 0.25, the gap keeps 75% of its size each turn. That is exponential decay, the mirror image of the exponential growth in a reinforcing loop.
This also means the stock never quite reaches the target. It gets closer forever. In practice, you stop caring once the gap is smaller than a player would notice.
What balancing loops do to a match
Compare the two loop types by their effect on a match:
| Property | Positive feedback | Negative feedback |
|---|---|---|
| Effect of a lead | Lead grows | Lead shrinks |
| Long-run behavior | Runaway growth or collapse | Settles near a target |
| Effect on outcomes | Outcomes become decided early | Outcomes stay open |
| Typical feel | Momentum, power fantasy | Tension, comeback, stability |
| Main risk | Snowballing | Rewarding poor play, dull stalemate |
Negative feedback keeps matches close. That is its main use. It also has costs, which the rest of this chapter covers.
Choosing the target
A balancing loop pulls toward a target, so the target is a design decision. Ask what the loop is balancing against.
- A fixed target. Health regen aims at a constant. The loop is predictable and easy for players to learn.
- A moving target. Catch-up mechanics aim at the leader's position. The target changes as the leader moves. The loop then reduces differences between players instead of pushing everyone to one number.
- A hidden target. Some games adjust difficulty toward a target the player never sees, such as a desired failure rate. This is harder to explain, and players sometimes notice it and resent it.
Moving targets are the basis of rubber banding, which has its own chapter. Here you only need to see that the gap can be measured against another player's score.
Strength is the main tuning knob
Strength decides how fast the stock approaches the target. It also decides whether the loop behaves at all. Look at what happens when strength gets large:
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
for k in (0.25, 1.0, 1.5, 2.0, 2.5):
print(k, [round(x, 1) for x in balancing(4, strength=k)])The output is:
0.25 [20.0, 40.0, 55.0, 66.2, 74.7]
1.0 [20.0, 100.0, 100.0, 100.0, 100.0]
1.5 [20.0, 140.0, 80.0, 110.0, 95.0]
2.0 [20.0, 180.0, 20.0, 180.0, 20.0]
2.5 [20.0, 220.0, -80.0, 370.0, -305.0]The gap is multiplied by (1 - strength) each turn. That factor decides everything:
| Strength | Factor `1 - strength` | Behavior |
|---|---|---|
| 0 | 1 | No correction at all |
| Between 0 and 1 | Between 0 and 1 | Smooth approach, no overshoot |
| 1 | 0 | Snaps to target in one turn |
| Between 1 and 2 | Between -1 and 0 | Overshoots, then oscillates and settles |
| 2 | -1 | Oscillates forever with constant size |
| Above 2 | Below -1 | Oscillation grows without bound |
Above a strength of 2, the "balancing" loop has become unstable. Each correction is bigger than the error it was meant to fix. The stock swings further from the target every turn.
For most designs you want a strength between 0 and 1. That gives a smooth approach with no overshoot. Values between 1 and 2 can still be useful when you want a visible swing, but they make the system harder to predict.
Overshoot comes from delay
The overshoot above was caused by acting on the full gap in one step. A more common cause in real games is delay. If the loop acts on old information, it keeps pushing after the gap has already closed.
An example: a game spawns more enemies when the player looks strong. If it measures strength only once per level, it responds to the previous level's state. The player may have lost half their health since. The spawn rate then swings between too easy and too hard.
Delays are covered in their own chapter. For now, remember the rule: a balancing loop with a delay can oscillate even if its strength is moderate.
Common errors
Treating negative feedback as always good. A strong balancing loop can remove the reward for skill. If the better player's lead is erased every turn, winning feels random. Players call this unfair, and they are often right.
Forgetting that the target defines the outcome. If a regen loop targets 100 health but combat damage is 30 per second, the loop cannot keep up. The stock still falls. A balancing loop only wins when its flow is large enough compared with the opposing flow.
Confusing "negative" with "decreasing." A balancing loop can raise a stock. Health regen increases health. The word describes the loop's response to the gap, not the direction of change.
Ignoring combined loops. In a real game, a balancing loop sits next to reinforcing ones. Which one dominates depends on their relative strength. The third example in the spine, a race with both growth and catch-up, shows this. A later chapter treats it fully.
Stopping the simulation too early. Because the approach is exponential, the first few turns look dramatic and the later ones look flat. Run enough turns to see where the stock settles.
Design checklist
Before adding a balancing loop, answer these questions:
- What is the stock, and what is the target?
- Is the target fixed, moving or hidden? Will players be able to see it?
- How strong is the correction, and what is the value of
1 - strength? - How fast does the loop update, and with what delay?
- What opposes the loop, and is the loop strong enough to win?
- Does the loop punish good play, and is that what you intend?
Exercise
A player's morale starts at 20 with a target of 100. Each turn, morale increases by 40% of the gap. What is morale after two turns? What is the gap after two turns? Would any strength between 0 and 1 ever cause overshoot?
Show answer
Turn 1: the gap is 80, so morale rises by 0.4 80 = 32 and becomes 52. Turn 2: the gap is 48, so morale rises by 0.4 48 = 19.2 and becomes 71.2. The gap after two turns is 28.8, which equals 80 * 0.6^2. No strength between 0 and 1 overshoots, because the factor 1 - strength stays between 0 and 1. The gap shrinks each turn but never changes sign.
Exercise
A balancing loop uses strength 1.8 with a target of 50 and a start value of 10. Predict the first three values after the start, and say whether the loop is stable.
Show answer
The gap multiplies by 1 - 1.8 = -0.8 each turn. The start gap is 40. Turn 1: the gap is -32, so the value is 82. Turn 2: the gap is 25.6, so the value is 24.4. Turn 3: the gap is -20.48, so the value is 70.48. The loop oscillates around 50 with shrinking swings, so it is stable but overshoots. It is stable because the factor -0.8 has magnitude below 1.