Sub topic 11
Letting Players Change Settings Mid-Game
This chapter assumes you know the preset and override model from the earlier chapters (a preset plus partial overrides resolving to one settings object). It also assumes you can read short TypeScript. Here you will decide which settings can change during play, when each change takes effect, and how to offer help without pushing players into it.
Why players change settings mid-game
A player's first choice is a guess. They picked Normal before they had played a minute. Players also change over time:
- Skill grows, and a setting that felt necessary becomes a crutch.
- A boss spikes the challenge far above the rest of the game.
- Life gets in the way. A player returns after a month away, or plays one-handed while holding a child.
- Fatigue, pain, or a temporary injury changes what the hands can do tonight.
If the only way to change settings is to restart, players either quit or grind through frustration. Treat the first choice as a draft and make revisions cheap.
Decide when each setting can change
Not every setting can change instantly without side effects. Sort each one into a timing class.
| Timing | Meaning | Typical settings | Reason |
|---|---|---|---|
| Immediate | Applies on the next frame | Aim assist strength, subtitles, input timing windows, hints | Changes how the player's input is read or presented, with no world state to repair |
| Next checkpoint | Queued until the game reaches a safe point | Enemy health, enemy damage in a scripted fight | Rescaling live enemies can break a fight in progress |
| New run | Applies only when a new run or save begins | Permadeath, world seed, resource scarcity | The setting defines the run, so changing it midway makes the run meaningless |
Most assists belong in the first row. Settings that shape the whole run belong in the third, and you should tell the player before they start, not after they find the option greyed out.
A queued change must be visible. If a player lowers enemy damage and nothing seems different, they will assume the option is broken. Show a line such as "Takes effect at the next checkpoint" next to the setting.
Model timing in code
The settings model from the earlier chapters has no concept of when a value applies. A small session object adds that. It keeps the active settings, a queue of deferred changes, and a history of what changed. The history is useful for telemetry and for the competitive rules covered in a later chapter.
interface DifficultySettings {
enemyDamageMultiplier: number;
enemyHealthMultiplier: number;
aimAssistStrength: number;
checkpointFrequency: 'sparse' | 'normal' | 'frequent';
infiniteRetries: boolean;
}
type ApplyTiming = 'immediate' | 'checkpoint' | 'newRun';
const APPLY_TIMING: Record<keyof DifficultySettings, ApplyTiming> = {
enemyDamageMultiplier: 'checkpoint',
enemyHealthMultiplier: 'checkpoint',
aimAssistStrength: 'immediate',
checkpointFrequency: 'immediate',
infiniteRetries: 'immediate',
};
interface ChangeRecord {
key: keyof DifficultySettings;
from: unknown;
to: unknown;
at: number;
}
class SettingsSession {
private active: DifficultySettings;
private pending: Partial<DifficultySettings> = {};
readonly history: ChangeRecord[] = [];
constructor(
initial: DifficultySettings,
private now: () => number = Date.now,
) {
this.active = { ...initial };
}
get current(): Readonly<DifficultySettings> {
return this.active;
}
get queued(): Readonly<Partial<DifficultySettings>> {
return this.pending;
}
request<K extends keyof DifficultySettings>(
key: K,
value: DifficultySettings[K],
): ApplyTiming {
const timing = APPLY_TIMING[key];
if (timing === 'immediate') {
this.commit(key, value);
} else {
this.pending[key] = value;
}
return timing; // the UI uses this to explain when the change lands
}
onCheckpoint(): void {
this.flush(['checkpoint']);
}
onNewRun(): void {
this.flush(['checkpoint', 'newRun']);
}
private flush(allowed: ApplyTiming[]): void {
const keys = Object.keys(this.pending) as (keyof DifficultySettings)[];
for (const key of keys) {
if (allowed.includes(APPLY_TIMING[key])) {
this.commit(key, this.pending[key]);
delete this.pending[key];
}
}
}
private commit(key: keyof DifficultySettings, value: unknown): void {
if (this.active[key] === value) return; // ignore no-op changes
this.history.push({ key, from: this.active[key], to: value, at: this.now() });
Object.assign(this.active, { [key]: value });
}
}
const session = new SettingsSession({
enemyDamageMultiplier: 1,
enemyHealthMultiplier: 1,
aimAssistStrength: 0.4,
checkpointFrequency: 'normal',
infiniteRetries: false,
});
console.log(session.request('aimAssistStrength', 0.8)); // "immediate"
console.log(session.request('enemyDamageMultiplier', 0.5)); // "checkpoint"
console.log(session.current.enemyDamageMultiplier); // 1, still queued
session.onCheckpoint();
console.log(session.current.enemyDamageMultiplier); // 0.5
console.log(session.history.length); // 2request returns the timing so the interface can show the right message. The commit method skips values that match the current one, so toggling a switch back and forth does not fill the history with noise.
The next diagram shows the life cycle of one setting.
Repair live game state when values change
An immediate change to a multiplier that live entities already used can leave them in an odd state. Take an enemy at 50 of 100 health. The player switches enemy health from 1.0 to 0.75. If you set the new maximum to 75 and leave current health at 50, the enemy jumps from 50% to 67% health. If you clamp health to the new maximum, the player can see the enemy gain or lose health for no reason.
The usual fix is to preserve the health ratio.
interface Enemy {
health: number;
maxHealth: number;
}
function rescaleEnemyHealth(enemy: Enemy, oldMult: number, newMult: number): Enemy {
const ratio = enemy.maxHealth > 0 ? enemy.health / enemy.maxHealth : 0;
const baseMax = enemy.maxHealth / oldMult;
const newMax = Math.round(baseMax * newMult);
const newHealth = enemy.health > 0 ? Math.max(1, Math.round(newMax * ratio)) : 0;
return { health: newHealth, maxHealth: newMax };
}
console.log(rescaleEnemyHealth({ health: 50, maxHealth: 100 }, 1, 0.75));
// { health: 38, maxHealth: 75 }The Math.max(1, ...) guard keeps a living enemy from rounding down to zero and dying the instant the player touches a slider. Dead enemies stay dead. Many teams skip this work and queue enemy changes until the next checkpoint, which is the simpler and safer choice. Choose it unless you have a strong reason to support live rescaling.
Make changes reversible and free of friction
Follow these rules for every setting that can change mid-game:
- Put the settings in the pause menu, one or two steps from the game. Do not hide them behind a profile screen.
- Let players change a setting in both directions at any time. A one-way door (easier is allowed, harder is locked) punishes the player who needed help for one hard section.
- Keep the old value visible so the player can undo the change.
- Apply the change to the current save. Do not force a new save slot.
- Do not charge currency, progress, or story consequences for changing a setting.
Consequences that do exist, such as an achievement being unavailable, should be stated once, plainly, before the change. A single clear sentence is enough.
Offering help at the right moment
Many players never open the settings menu, even when they are stuck. A game can notice struggle and offer help, but it should offer, not change anything unprompted. Silent changes are the dynamic difficulty approach, with the limits discussed in the earlier chapter. An offer keeps the player in control and teaches them that the options exist.
A reasonable rule has three parts: enough evidence, a cooldown, and a stop condition when the player declines.
interface StruggleState {
consecutiveFails: number;
lastOfferAt: number | null; // milliseconds since epoch
offersDeclined: number;
}
const FAILS_BEFORE_OFFER = 5;
const COOLDOWN_MS = 10 * 60 * 1000;
const MAX_DECLINES = 2;
function shouldOfferHelp(state: StruggleState, now: number): boolean {
if (state.offersDeclined >= MAX_DECLINES) return false;
if (state.consecutiveFails < FAILS_BEFORE_OFFER) return false;
return state.lastOfferAt === null || now - state.lastOfferAt >= COOLDOWN_MS;
}The wording matters. "Want to adjust the challenge? Options are in Settings" is neutral. "Struggling?" is not. The offer should link straight to the relevant setting, such as the checkpoint or damage options, and not to the full menu.
Offering help is also a good place to suggest a different lever than the one the player expects. A player who fails a platforming jump ten times may not need lower enemy damage. A more forgiving input timing window might fit the problem better.
Edge cases to plan for
- Save files: Store the active settings in the save, not only in global preferences. When a player loads an old save, apply that save's values or ask which to use. Decide this up front and tell the player.
- Sudden jumps: After a long break, a player may want to drop back to easier settings. Make "reset to preset" available as a single action that keeps their other overrides.
- Saved queue: If a change is queued and the player quits before the checkpoint, persist the queue or discard it. Either is fine. Losing it silently while the menu still displays it is not.
- Multiplayer: Settings that affect shared state, such as enemy health in co-op, need a rule about who can change them. Options include host only, vote, or per-player scaling. Settings that affect only one player's input, such as aim assist, can stay personal.
- Cloud sync and platforms: A change on one device should not overwrite a different save's values without notice.
- Accessibility settings: Treat presentation and input options (subtitles, contrast, remapping, timing windows) as always immediate and always available, including in cutscenes and loading screens where possible.
Record changes for later analysis
The history array in the session class is the raw material for the telemetry covered at the end of this tutorial. Useful questions it answers are where in the game players lower settings, how often players raise them again, and whether a particular fight triggers many changes. A spike of reductions at one boss usually points to a tuning problem in that boss, not to a problem with the players. Log the setting, the old and new value, and the game location, and avoid collecting anything personal.
Some changes also matter to competitive systems. A run whose assists changed midway may need a flag on its leaderboard entry. The next chapters cover that. For now, keep the history so those rules can be added without rewriting the settings code.
Common mistakes
- Locking difficulty after the opening hour, or when the player passes a certain point.
- Applying a damage multiplier in the middle of an enemy attack animation, which makes one hit land with the wrong value.
- Changing the setting visually but not in the save, so it resets on reload.
- Treating a returned value from
requestas a success and never telling the player the change is queued. - Offering help every time the player dies, which becomes nagging.
Exercise
A player lowers enemy damage during a boss fight. Your game applies enemy damage settings at the next checkpoint. What should the settings screen show, and what happens if the player quits before reaching the checkpoint?
Show answer
The screen should show the new value as queued, with a line such as "Takes effect at the next checkpoint," so the player knows the change was received. If the player quits before the checkpoint, you must choose between persisting the queue and discarding it. Either works as long as the menu matches the real state on reload. Showing a pending value that was silently dropped is the failure to avoid.
Exercise
An enemy has 30 of 120 health at a 1.0 health multiplier. The player changes the multiplier to 0.5 and your game rescales live enemies by preserving the health ratio. What are the new health and maximum health?
Show answer
The ratio is 30 / 120 = 0.25. The base maximum is 120 / 1 = 120, so the new maximum is 120 x 0.5 = 60. The new health is 60 x 0.25 = 15. The result is 15 of 60.
Exercise
Explain why a game should offer help after repeated failures instead of lowering difficulty automatically, and name two guard conditions for the offer.
Show answer
An offer keeps the player in control, shows them the options exist, and avoids the feeling of being quietly judged or having an achievement changed without consent. Two guard conditions are a minimum number of consecutive failures (enough evidence) and a cooldown between offers. Stopping after the player has declined a set number of times is also valid.