Spielerando

Difficulty Settings

Difficulty settings let the player choose how hard the game is. Each choice is a few multipliers for damage taken, enemy health and loot, and every other rule asks them. A hit never rounds down to nothing, an enemy is never born dead, and changing the setting mid-fight keeps each enemy's share of health.

Also called: Difficulty levels, Difficulty modes, Easy normal hard, Difficulty picker.

A tall goggled ostrich-like inventor turns a big brass dial to its third notch, and the stone guardian in the lit window grows huge and spiked while its pile of acorns shrinks.
Dortlewick Workshop, an invented puzzle-brawler game. Invented game, image generated with AI.

Paste this to your AI

Copy it into Claude, Cursor or ChatGPT. It already has good values and the usual mistakes in it.

Add "Difficulty Settings" to my game.

What it should do: Players come with very different skill and patience. A choice they make themselves lets a newcomer finish the game and gives an expert a real challenge, without building two games.

Build it exactly as this state machine. First check that it fits my game, then build it like this:

```mermaid
stateDiagram-v2
  [*] --> normal
  relaxed: Relaxed
  normal: Normal
  hard: Hard
  locked: Locked in
  relaxed --> normal: picks normal
  relaxed --> hard: picks hard
  normal --> relaxed: picks relaxed
  normal --> hard: picks hard
  hard --> relaxed: picks relaxed
  hard --> normal: picks normal
  relaxed --> locked: locks the choice
  normal --> locked: locks the choice
  hard --> locked: locks the choice
  locked --> [*]
```

Use these starting values:
- damageStep: 0.5 x
- healthStep: 0.25 x
- lootStep: 0.25 x
- minDamage: 1 points

Watch out for these common mistakes:
- A small hit rounds to nothing: Tell your AI: round the damage, then never go below the smallest damage you chose, and let a hit of zero stay zero.
- Changing the setting in the middle of a fight: Tell your AI: keep the same share of health on the new maximum, and never let a living enemy round down to zero.
- Small loot never improves: Tell your AI: round loot with a random roll that is passed in, so 1.25 gives one most of the time and two now and then, and the average is right.
- The multiplier is applied twice: Tell your AI: ask for the multiplier in exactly one place, where the damage reaches the player, and nowhere else.
- A locked choice that can be bypassed: Tell your AI: keep the lock beside the setting itself and check it in the one place that changes the level.
- Mixing the setting with other help: Tell your AI: keep help options separate from the setting, so the player can combine them.

Do not change anything else in the game. Do not claim anything without proof: model what it takes, and show me what your solution rests on and how I can see that it works. If you cannot show something, say you do not know. When you are done, tell me in plain words how to try it.

Or skip this and connect the MCP: your AI then finds all of this by itself.Connect the MCP

What it does

Players come with very different skill and patience. A choice they make themselves lets a newcomer finish the game and gives an expert a real challenge, without building two games.

How it runs, as a diagram

Everything it can be in, and what moves it on. Your AI builds from exactly this.

picks normalpicks hardpicks relaxedpicks hardpicks relaxedpicks normallocks the choicelocks the choicelocks the choiceRelaxedNormalHardLocked in
How it runs, as a diagram
  • Relaxed → Normal: picks normal
  • Relaxed → Hard: picks hard
  • Normal → Relaxed: picks relaxed
  • Normal → Hard: picks hard
  • Hard → Relaxed: picks relaxed
  • Hard → Normal: picks normal
  • Relaxed → Locked in: locks the choice
  • Normal → Locked in: locks the choice
  • Hard → Locked in: locks the choice

Good starting values

ValueStart withWhat it changes
damageStep0.5 xHow far damage taken moves from normal. At 0.5, relaxed takes half and hard takes half as much again. It stays below one, or relaxed would take no damage at all.
healthStep0.25 xHow far enemy health moves from normal. Smaller than the damage step on purpose, because a fight that lasts twice as long is felt more than a hit that hurts twice as much.
lootStep0.25 xHow far loot moves from normal, the opposite way: relaxed gives more and hard gives less. A small move keeps hard players from being starved.
minDamage1 pointsThe least a hit that was meant to hurt can do. One keeps every hit worth dodging, even on the most relaxed setting.

What usually goes wrong

A small hit rounds to nothing

A hit of 1 on a setting that halves damage rounds to 0 or 1 depending on how it is written, and with a stronger cut it rounds to nothing, so a whole weapon or trap stops mattering.

Fix: Tell your AI: round the damage, then never go below the smallest damage you chose, and let a hit of zero stay zero.

Changing the setting in the middle of a fight

If enemy health is recalculated, an enemy on half health can jump back to full, or die on the spot because its new maximum is below what it has left.

Fix: Tell your AI: keep the same share of health on the new maximum, and never let a living enemy round down to zero.

Small loot never improves

A drop of 1 times a multiplier of 1.25 rounds back to 1 every time, so the relaxed setting never gives more of the things that come one at a time.

Fix: Tell your AI: round loot with a random roll that is passed in, so 1.25 gives one most of the time and two now and then, and the average is right.

The multiplier is applied twice

If the weapon scales the damage and the enemy scales it too, a relaxed player takes a quarter and a hard player more than twice.

Fix: Tell your AI: ask for the multiplier in exactly one place, where the damage reaches the player, and nowhere else.

A locked choice that can be bypassed

A challenge mode that locks the setting is spoiled if the menu, a saved file or a hotkey can still change it.

Fix: Tell your AI: keep the lock beside the setting itself and check it in the one place that changes the level.

Mixing the setting with other help

If extras like a shorter timer are tied to the same setting, a player who wants easy fights but a hard clock cannot have both.

Fix: Tell your AI: keep help options separate from the setting, so the player can combine them.

How to check it works

Works well with

Clashes with Dynamic Difficulty: A game that adapts quietly can undo the setting the player chose, so a player on hard finds the game easing off. Make the adapting part work inside the chosen setting, or switch it off on the hardest setting and tell the player.

Common questions

what do i tell my ai to add difficulty settings

Paste this: Add difficulty settings with relaxed, normal and hard. Each is a set of multipliers for damage taken, enemy health and loot, asked in one place. A hit never rounds to zero, an enemy never has zero health, and changing mid-fight keeps each enemy's share of health.

how many difficulty levels should a game have

Three is a good start: one for people who want the story, one for the intended game and one for people who want a fight. More levels only help if each feels clearly different.

should the player be able to change difficulty during the game

Usually yes, because a wall that stops someone is worse than an easy game. Let them change it freely, apart from a challenge mode that locks it on purpose.

what should a difficulty setting change besides damage

Enemy health, loot, and how much help the player gets. Keep each as a separate number so you can tune them one by one, and keep the player's help options apart from the setting.

Where it comes from

We could not find a reliable origin for this one yet.

Where this mechanic comes from has not been researched yet.

Games are named only as references. Names and marks belong to their owners, and nothing here is endorsed by them.

What was checked

This is what separates the blueprint from a catalogue entry: the values on this page come from code that runs.

Your AI gets the code

Tested example code comes through the Spielerando connection, so your AI can use it right away. How to connect it