Skip to main content
Apart from each player’s own movement, your server owns every fact in the game: the score, the round timer, which doors are open, what’s in each player’s inventory, who won. Players never change those facts directly. They ask the server, the server checks the request against who they are and the current game, and then everyone sees the result. That’s what keeps every player’s game the same, and what stops a modified client from cheating.

Games like this

Among Us

Shared tasks, doors and votes, plus secret roles.

Hearthstone

A shared board, with a private hand for each player.

Overcooked

One kitchen everyone works in at the same time.

Minecraft servers

Blocks, chests and items everyone shares.

What your players get

The server owns the facts. Shared facts like the score and a door go to every player. A private fact like one player's hand of cards goes only to that player. The server owns the facts. Shared facts like the score and a door go to every player. A private fact like one player's hand of cards goes only to that player.
  • One game for everyone. Every player sees the same score, the same open door and the same coin gone once it’s picked up.
  • Joining late just works. A player who joins mid-match gets the current score, doors and everything else straight away.
  • Secrets stay secret. A player’s hand of cards, wallet or secret role only ever reaches that player’s device.
  • Fair requests. Picking up, buying, opening and voting all go through the server, which checks them first.

Pick your setup

Most games use all four of these together.

Shared facts everyone sees

The score, the round timer, a door, who’s holding the flag. Your server keeps the value and every player gets it, including anyone who joins later. When the server changes it, every player sees the change.

Share the score, doors and timer. The server owns them; every player sees the same values.

Private facts only one player sees

A hand of cards, a wallet, an inventory, a secret role. The server keeps it like any other fact but sends it only to the player it belongs to. If that player drops out and comes back, they get it back.

Give each player private state. Hands, wallets or roles that only their owner sees.

Requests: collect, buy, open, ready

When a player wants to do something that changes the game, their game asks the server. The server knows exactly who is asking and checks the request against the current game: is the coin still there, is the player close enough, can they afford it? Then it accepts and changes the game, or refuses with a reason your game can show. A player asks to open a door. The server checks the request. If it accepts, the door opens for everyone. If it refuses, only the player who asked hears why. A player asks to open a door. The server checks the request. If it accepts, the door opens for everyone. If it refuses, only the player who asked hears why.

Let players ask the server. Collect, buy, open or ready up, checked by the server.

One-off effects

A sparkle when a coin is collected, a sound, a hit flash. The server sends these to everyone once, as they happen. Unlike shared facts they aren’t kept, so a player who joins later doesn’t replay old sparkles. Use them for things that only matter in the moment. A player who joins mid-match gets the current score and door straight away, but not the sparkles that already happened. A player who joins mid-match gets the current score and door straight away, but not the sparkles that already happened.

Add one-off effects. Sparkles, sounds and flashes every player sees as they happen.

Not sure which fits?

Plan the game state for my multiplayer game. Your agent lists every fact and who sees it. No code.

Testing it on your machine

Local Play runs your server and several game windows on one computer. Check that every window shows the same shared facts, that private facts only show in their owner’s window, and that two players trying the same thing at once get one clear answer each. Then run it again with added delay and packet loss. See Make your game multiplayer.
Does this not help you? Reach out on Discord!