47 · Multiplayer · 2D and 3D

Authoritative server

The server decides what really happened.

If clients tell the server "I am here" and "I hit him", a cheater can simply send "I teleported" or "I hit everyone". With an authoritative server, clients send only inputs, the server simulates the game and validates everything, and the result it broadcasts is the truth.

A authority: client / serverC send a cheatUse the buttons

Try this: With client authority, press Cheat: the teleport and the 999 damage go through. Switch to server authority (A) and cheat again.

Press Cheat.

Prompt bit

Works for 2D or 3D in any engine (Unity, Unreal, Godot, web). Paste the short one for a quick fix, or the detailed one when you want it done properly.

Make the server authoritative: clients send only inputs, the server simulates movement, combat and pickups and rejects impossible actions (moves faster than max speed, fire rates under 0.1 s), and clients only display server results, even for the host player.

40 words · one sentence to paste as is

Where it's used

Common mistakes

Trusting client positions or damage values, validating nothing, letting the host skip the rules, sending hidden information to clients, and doing gameplay logic in client-only code that never runs on the server.

Writing this with an AI assistant? See our best AI coding assistants for game developers.

Missing a concept? Request one.

Related concepts

New concepts, in your inbox.

One short email when we add new concepts, plus our weekly roundup of AI tools for game devs. Unsubscribe any time.