Sub topic 8
Dynamic Difficulty Adjustment and Its Limits
Assume you understand a game’s core loop, level structure, and basic data structures and functions. This chapter focuses on when a game should change challenge during play and how to keep those changes controlled.
Dynamic difficulty adjustment (DDA) changes game challenge in response to a player’s recent performance. For example, a game might reduce enemy accuracy after several failed attempts or add stronger enemies after a player wins easily. DDA is different from a difficulty preset. A preset is a choice made by the player, while DDA is a runtime system that reacts to play.
When DDA is useful
DDA works best when the game has a clear signal for struggle or mastery and can change challenge without breaking the player’s plan.
Useful signals include:
- Recent deaths or failed attempts.
- Time taken to complete an encounter.
- Health or resources remaining.
- Accuracy, damage dealt, or missed opportunities.
- Optional objectives completed.
- Repeated use of a checkpoint or retry.
A system should combine several signals when possible. A single death may result from experimentation, a bug, or a deliberate risk. Five failed attempts in similar situations provide stronger evidence.
Good targets for adjustment are local and reversible:
- Enemy health or damage.
- Enemy reaction time or accuracy.
- The number of reinforcements.
- Resource drops.
- Checkpoint frequency.
- The timing of a hint.
Avoid changing facts that define the player’s identity or long-term plan. Do not silently remove a chosen ability, rewrite a story outcome, or make a carefully learned puzzle solve itself.
A bounded adjustment model
DDA needs limits. Without limits, a struggling player may receive trivial encounters, while a skilled player may face impossible ones. A bounded system defines:
- A minimum and maximum challenge scale.
- A target outcome, such as a 30% failure rate.
- A minimum amount of evidence before changing anything.
- A maximum change per adjustment.
- A time or encounter delay between adjustments.
The following TypeScript example changes an enemy-strength multiplier only after five recorded attempts.
const clamp = (value: number, min: number, max: number): number =>
Math.min(max, Math.max(min, value));
const TARGET_FAIL_RATE = 0.3;
const MIN_SCALE = 0.7;
const MAX_SCALE = 1.3;
const MAX_STEP = 0.05;
function adjustScale(scale: number, outcomes: boolean[]): number {
if (outcomes.length < 5) {
return scale;
}
const failRate =
outcomes.filter((successful) => !successful).length / outcomes.length;
const delta = clamp(
(TARGET_FAIL_RATE - failRate) * 0.2,
-MAX_STEP,
MAX_STEP,
);
return clamp(scale + delta, MIN_SCALE, MAX_SCALE);
}
let enemyScale = 1;
enemyScale = adjustScale(enemyScale, [false, false, true, false, true]);
console.log(enemyScale);A high failure rate produces a negative change, so enemy strength falls. A low failure rate produces a positive change, so enemy strength rises. The clamp function prevents the scale from leaving the range from 0.7 to 1.3.
Limits and failure modes
DDA can solve the wrong problem when its measurements are unclear. A player may fail because an objective is confusing, controls are uncomfortable, or the camera hides important information. Reducing enemy health does not fix those problems.
DDA can also feel manipulative. If players notice that enemies become weak whenever they struggle, success may feel unearned. If the system becomes harder immediately after success, players may stop improving because mastery has no lasting reward.
| Risk | Likely cause | Safer response |
|---|---|---|
| Challenge swings sharply | Large changes or noisy data | Use a rolling window and small steps |
| Players feel watched | Hidden, unexplained changes | Explain the system or make changes subtle |
| The wrong issue is measured | Failure is caused by controls or clarity | Test and measure more than combat results |
| Players exploit the system | Intentional deaths or repeated retries | Detect unusual patterns and cap adjustments |
Decide whether to use DDA
Use DDA when the game’s enjoyment depends on sustained pacing, such as a long action campaign. Prefer fixed presets when mastery, competition, or predictable practice matters more. In either case, test with players who have different skill levels. Compare completion, retries, frustration reports, and whether players understand why an encounter changed.
Exercise
A player dies once while testing a dangerous shortcut. Should DDA immediately reduce enemy damage? Why or why not?
Show answer
No. One result is weak evidence and may be intentional. Wait for enough recent outcomes, then adjust gradually if the pattern shows sustained difficulty.