Lesson 05 of 12

Shared State: Keeping Everyone Honest

In a fair game there has to be one version of the truth that everyone trusts — not whatever each player's computer claims. You'll learn what authoritative/shared state is and why it stops cheating, then store the game's important facts (scores, who's alive) in the service's shared state instead of trusting any one player. The service is the referee, so you never run a server.

⏱ 16 min read
Video coming soon
The written lesson is below. Video walkthrough publishes shortly.

In a fair game there has to be one version of the truth that everyone trusts — not whatever each player's computer claims. You'll learn what authoritative/shared state is and why it stops cheating, then store the game's important facts (scores, who's alive) in the service's shared state instead of trusting any one player. The service is the referee, so you never run a server.

The video walkthrough is coming soon. In the meantime, this lesson covers the topic from first principles, step by step.