Skip to content
Lesson 15.1Defensive Design and Anti-Cheat

Why Games Need Anti-Cheat

Separate a player's requests from the game's decisions, and connect prevention, detection, and fair enforcement.

Lesson 15.1
Read or listenPrint chapter or book
About 7 minutes

Keyboard shortcuts

?
Open this guide
Alt + B
Show or hide the lesson list
Alt + O
Show or fold the lesson outline
Alt + N
Open or close notes
Alt + H
Toggle semantic colours
Alt + D
Toggle page brightness
Alt + C
Toggle code brightness
← →
Move through a focused code trace
Home End
First or final step in a focused trace
Escape
Close this guide or an open panel

Reader shortcuts pause while you type in a text field.

Cheatsheet for Lesson 15.1Key ideas, reference and questions

A one-page summary of “Why Games Need Anti-Cheat” you can keep beside your notes. Plain Markdown.

Lesson 15.1 — Why Games Need Anti-Cheat: cheatsheet

  • Remember: Protect the shared result first. Decide what a suspicious request means using its context.

Key terms

  • false positive: A false positive is an honest case incorrectly marked suspicious.
  • false negative: A false negative is cheating that the detector misses.
  • Telemetry: Telemetry is recorded information about a running system.

Review

  • Q: A client claims score 99 in the toy world. The server has score 3 and one available one-point coin. What should determine the final score? A: The server validates the pickup and awards its one-point reward
  • Q: Who controls the computer running a game client? A: The player using that client
Download cheatsheet (.md)

A multiplayer game asks several computers to agree on one world. Each player controls a client, the program that sends their input and draws their view. The player also controls the machine running it. That machine cannot be the sole authority for shared positions, scores, and rewards.

Anti-cheat combines controls that prevent, detect, and respond to unauthorized advantages in the shared game. It includes game design, server validation, client protection, investigation, and enforcement. A scanner alone cannot repair a game that accepts any score a client sends.

An authority boundary separates a request from the party allowed to decide its result. In Lesson 9.10, a Source client predicts movement, while the server owns the accepted simulation.

The server refuses a jump of 800The server knows the player was at x = 100 and allows at most 5 units per tick.
  1. Request move to x = 900

    Step 1: Client to Server: x = 100

    A request, not a new position.

  2. Alone 900 − 100 = 800 > 5: refuse

    Step 2: Server: x = 100 (alone)

    The step is measured from the server’s own position.

  3. Reply you are at x = 100

    Step 3: Server: x = 100 to Client

    The client’s view snaps back.

The server knows the player was at x = 100 and allows at most 5 units per tick.

The server accepts an ordinary stepThe same check passes a request that fits the rules.
  1. Request move to x = 104

    Step 1: Client to Server: x = 100

    A small step.

  2. Alone 104 − 100 = 4 ≤ 5: accept

    Step 2: Server: x = 100 (alone)

    The server applies it to its own state.

  3. Reply you are at x = 104

    Step 3: Server: x = 100 to Client

    The server, not the client, decided that.

The same check passes a request that fits the rules.

Consider a toy game with three points already earned. One uncollected coin is worth one point. A client claims that its score is now 99. The server ignores that claimed total. It checks whether the player’s simulated position reaches the available coin. A valid pickup removes the coin and adds its reward: 3 + 1 = 4.

Watch it happenRequests do not own the score

The claimed 99 is ignored. One accepted pickup adds one point. Score ends at 4.

Read the steps
  1. The server starts with score 3. The client can request an action, but cannot replace that score.
  2. A claimed score of 99 travels toward the boundary. The server does not use it.
  3. The claim stops at the authority boundary. Score remains 3.
  4. The server simulates the player reaching the coin position.
  5. The valid pickup consumes the available coin and sends its one-point reward to the score update.
  6. The final score is 4: 3 + 1. The claimed 99 never becomes the server's score.

This toy world starts with 3 points; an available, reached coin is worth one point.

This simulation needs JavaScript. The lesson text around it works through the same numbers.

The boundary prevents this score manipulation even if the client display has been changed. Detection can still help explain the attempted request, but protecting the result does not have to wait for an account ban.

Different advantages leave different observations

Section titled “Different advantages leave different observations”

An information advantage exposes something the player should not know, such as an opponent behind a wall. An input advantage automates decisions or timing that the game requires the player to control. A state advantage changes movement, damage, inventory, or another accepted result.

Other problems involve message order and volume, account abuse, or the game’s economy. A reward request arriving twice may be a normal retry after packet loss. The game must prevent duplicate rewards before deciding whether the repetition was malicious.

These categories overlap. They describe changes to available information, control of actions, or accepted game state. An accessibility device and an automation tool may both produce unusual inputs. Policy, supported controls, and the actual advantage matter when interpreting them.

Prevention stops an invalid effect. A server rejects movement through a solid wall or refuses a purchase without sufficient currency. Detection identifies an observation worth investigating. A sequence of inconsistent movement commands may trigger a recorded flag. Deterrence makes abuse less attractive through clear enforcement policies and credible consequences. Mitigation reduces harm while a case is being resolved.

These jobs need different evidence. A malformed request can be rejected immediately. An irreversible accusation needs stronger support than an unusual mouse movement. Publicly accusing a player also exposes them to harassment, so a defender should separate internal investigation from public messaging.

A false positive is an honest case incorrectly marked suspicious. A false negative is cheating that the detector misses. Neither rate can be understood by looking only at players already banned.

Telemetry is recorded information about a running system. Useful telemetry includes the version of the check, server state, command timing, and the reason a check failed. It lets an investigator reproduce a decision and notice when a game update changes legitimate behavior.

An enforcement system also needs corrections and appeals. Keep the evidence needed to review a case, limit who can access it, and stop collecting data that does not help protect the game. This chapter studies defenses in owned offline examples. It does not require testing a live service or another player’s machine.

Knowledge check

Who owns the reward?

A client claims score 99 in the toy world. The server has score 3 and one available one-point coin. What should determine the final score?

Finished Lesson 15.1?

Mark it done and the lesson list shows a beside it. A chapter whose lessons are all done is marked done too. Progress is saved in this browser only.

Chapter 15: 10 lessons

This book grew out of the original Game Hacking Academy by attilathedud and has been rewritten as a beginner-first course. Like the original repository, its source is published under the Apache License 2.0.