Sub topic 10
Difficulty Tuning and Adaptive Assistance
This chapter assumes you know the difference between win, lose, and fail states. It also assumes you have read the chapters on fairness, readability, and retry cost. You should be comfortable reading short Python functions with conditionals and classes.
Earlier chapters treated failure as something you design once. Difficulty tuning treats it as something you adjust. The same lose condition can feel fair to one player and crushing to another. This chapter covers how to set difficulty by hand, how to let the game adjust it, and where adjustment goes wrong.
What difficulty tuning changes
Difficulty is the rate at which a player is likely to reach a fail or lose state. Tuning moves that rate without changing the rules of the game. You can tune in three places.
- Pressure on the player. Enemy health, enemy damage, timer length, resource scarcity, and the number of threats on screen.
- Tolerance for mistakes. Lives, hit points, checkpoint spacing, and how much a death costs.
- Information and help. Hints, aim assist, telegraphing of attacks, and visible objective markers.
These map to the chapters you have already read. Pressure shapes how often the lose condition is approached. Tolerance is the retry and recovery system. Information is fairness and readability. Tuning is mostly a matter of turning those knobs in a controlled way.
Static difficulty: presets chosen by the player
The simplest approach is a menu with a few named presets. Each preset is a set of numbers applied to the same game.
from dataclasses import dataclass
@dataclass(frozen=True)
class Difficulty:
name: str
enemy_damage: float # multiplier on damage dealt to the player
starting_lives: int
checkpoint_gap: int # meters of progress between checkpoints
aim_assist: float # 0.0 = none, 1.0 = full
PRESETS = {
"story": Difficulty("story", 0.5, 5, 50, 0.8),
"standard": Difficulty("standard", 1.0, 3, 100, 0.4),
"hardcore": Difficulty("hardcore", 1.5, 1, 200, 0.0),
}
def damage_taken(base_damage, difficulty):
return base_damage * difficulty.enemy_damage
print(damage_taken(20, PRESETS["story"])) # 10.0
print(damage_taken(20, PRESETS["hardcore"])) # 30.0Presets have clear strengths. The player stays in control, the behavior is predictable, and you can test each preset separately. They also have costs.
- Players pick a preset before they know how they play. Many choose "standard" or "hardcore" out of pride and then struggle.
- Every preset multiplies your testing work.
- Changing a preset mid-game is awkward unless the menu allows it.
Name presets by what the experience is, not by how skilled the player must be. A label such as "Story" tells the player what they will get. A label such as "Easy" can feel like a judgment.
Tune more than one number
A common mistake is to build "hard" mode by scaling only enemy health. Fights then take longer but are not more interesting, and the player just repeats the same actions more times. Better presets change several things together. Hard might also add enemies with new behaviors, shorten the checkpoint gap in the opposite direction by widening it, or remove a hint. The aim is to change what the player must do, not only how long they must do it.
Dynamic difficulty adjustment
Dynamic difficulty adjustment (DDA) is a system that changes difficulty during play, based on how the player is doing. The game measures something, compares it with a target, and nudges a knob.
DDA is a feedback loop, and it has the same parts as any controller:
- Signal. What the game measures, such as deaths in the last few minutes, health at the end of fights, or time spent on one section.
- Target. The experience you want, such as "about one death per section."
- Adjustment. The knob that moves, such as enemy damage or the number of enemies.
- Limits. The range the knob may move within, and how fast.
A small working example
This class tracks recent deaths and moves an enemy damage multiplier within fixed limits. It reuses the Outcome idea from earlier chapters only in spirit. It does not change what counts as a loss.
from collections import deque
class DamageTuner:
def __init__(self, low=0.6, high=1.4, step=0.1, window=4):
self.multiplier = 1.0
self.low = low
self.high = high
self.step = step
self.recent = deque(maxlen=window) # True = player died in that section
def record_section(self, died):
self.recent.append(died)
if len(self.recent) < self.recent.maxlen:
return self.multiplier # not enough data yet
deaths = sum(self.recent)
if deaths >= 3:
self.multiplier -= self.step
elif deaths == 0:
self.multiplier += self.step
self.multiplier = max(self.low, min(self.high, self.multiplier))
return round(self.multiplier, 2)
tuner = DamageTuner()
for died in [True, True, True, True]:
print(tuner.record_section(died))
# 0.9 (after the window fills with four deaths)Four design choices in this code matter beyond the code itself.
- A window. The tuner waits for four sections of data. Reacting to one death makes the game lurch.
- A step. Each change is small, so the player is less likely to notice it.
- A clamp. The multiplier never leaves 0.6 to 1.4, so the game cannot become trivial or impossible.
- A dead zone. With one or two deaths in the window, nothing changes. This stops the value from flipping back and forth on every section.
Assistance versus adjustment
Adjustment changes the numbers behind the game. Assistance gives the player something extra. Both lower the chance of failure, but the player experiences them differently.
| Type | Example | Visible to player? | Typical risk |
|---|---|---|---|
| Hidden adjustment | Enemies deal slightly less damage after repeated deaths | No | Player later feels their win was not earned |
| Offered assistance | "Skip this section?" prompt after several failures | Yes | Can feel like criticism if worded badly |
| Opt-in assistance | Accessibility menu with slower timers or extra health | Yes, chosen in advance | Player may not find it |
| Persistent aid | Aim assist, objective markers | Usually | Over-reliance if it replaces learning |
Hidden adjustment protects the feeling of success but relies on the player not noticing. Many players do notice, and once they do, they distrust every later result. Offered assistance respects the player but interrupts play. A good compromise is to adjust quietly in ways the fiction already explains, such as dropping more health pickups, and to offer explicit help only after sustained struggle.
Rubber banding in competitive games
In racing and sports games, a common form of DDA is rubber banding: trailing players get a speed boost and leaders are slowed. It keeps the field close and the finish tense. It also creates complaints.
- Skilled players feel punished for being ahead, because their earlier work is erased.
- Weak players may win without understanding why.
- Because the result is partly set by the system, competitive players tend to reject it.
Use rubber banding in casual or party games. Avoid it where the result is meant to reflect skill, such as ranked play. The multiplayer chapter returns to this.
Failure modes of adaptive systems
Adaptive systems fail in predictable ways. Check for each one in testing.
- Exploitation. Players learn the system and manipulate it. A player who dies on purpose for a few minutes gets a weaker enemy, then plays at full skill against it. If your signal is deaths, deaths can be faked.
- Oscillation. If the step is large or the window is short, difficulty swings up and down. The player experiences a game with no stable feel.
- Invisible ceiling. A clamp that is too generous gives the player a trivial game. A clamp that is too tight means the system never helps.
- Mismatched signal. Deaths are a poor measure of frustration for a player who is exploring or experimenting. A good signal matches the experience you are targeting.
- Hidden state in saves. If the multiplier is saved, a player who reloads may keep an advantage or a penalty they cannot see. Decide whether adaptive state persists and test it.
- Hard-to-reproduce bugs. A tester reports that a boss was too hard. Without logging the current multiplier, you cannot recreate their game.
Choosing between presets, DDA, and assistance
No single approach suits every game. Use these criteria.
| Question | Leans toward |
|---|---|
| Do players have very different skill levels? | Presets plus opt-in assistance |
| Is the game short and linear, with predictable sections? | Hand-tuned curve, minimal DDA |
| Is the game procedurally generated or very long? | DDA with strong limits |
| Is the result compared across players, such as on leaderboards? | Fixed presets only |
| Do you want to reach players who rarely play games? | Offered assistance and skip options |
Combining approaches is common. A game can offer three presets, apply gentle DDA inside each, and include an accessibility menu. Keep the layers independent so you can tell which one caused a behavior.
Interaction with retry and stakes
Difficulty and retry cost trade off against each other. A game with generous checkpoints can have harsher enemies. A game with permanent loss, as covered in the stakes chapter, usually needs gentler pressure and clearer information, because each failure costs more. When you change one, review the other. A common error is to raise difficulty and lengthen the replay distance in the same patch, which compounds into frustration that neither change would cause alone.
Practical process for tuning
- Define the target experience in numbers, such as "median player dies two to four times on the first boss."
- Choose the one or two knobs that most directly affect that number.
- Set the preset values by hand and test them with players of different skill.
- Add DDA only if a spread of skill remains that presets cannot cover.
- Bound every adaptive knob with a clamp, a step, and a window.
- Log the values and review them after playtests.
The last chapter covers how to run those playtests and read their results.
Exercise
Your DDA system lowers enemy damage whenever the player dies twice in a row. Testers report that some players die twice on purpose and then clear the next fight easily. Name the failure mode and give two changes that reduce the problem.
Show answer
This is exploitation of the signal. Two possible changes: use a longer window and require a higher death count before help applies, so that a couple of deliberate deaths do nothing; or change the signal to something harder to fake, such as health lost per fight or time stuck in one section. A clamp on how much damage can drop, and a cooldown after each adjustment, also limit the benefit.
Exercise
A racing game uses rubber banding in its ranked mode. Explain why this is a questionable choice and what you would do instead.
Show answer
Ranked play is meant to show skill, and rubber banding makes part of the result depend on the system rather than the players. Leaders lose the advantage they earned, and results are harder to compare between players. Use fixed rules in ranked mode, and keep rubber banding for casual or party modes, or replace it with skill-based matchmaking.