π₯οΈ What is a Server?

You just built and shipped your very own game. π Now for the dream: playing it with your best friend across town β the same game, at the same moment. Butβ¦ their computer and your computer are totally separate machines.
So how do they agree on where everyone is standing β at the exact same time? Meet the secret hero of every online game: the server.
The big idea: one shared brain
Right now your game lives inside yourcomputer's brain (its memory). Your friend's game lives in theirs. Two separate brains can't magically know each other's thoughts.
So we add a third computer in the middle that both connect to: a server. The server keeps the one true versionof the game. Everybody sends their moves to it, and it tells everybody what the world looks like now. It's the referee β what it says, goes.
Your computer is called the client. The shared one is the server. A Minecraft βrealmβ or βserverβ is exactly this. π₯οΈ
Your turn: be the referee
Below are two screensβ yours and your friend's β and a server in the middle. Move your red player around, then flip the server on and off and watch what happens to the two screens.
Your friend (blue) wanders on their own. You control the red one.
Discovery missions
Try each one, tick it off, then peek at the secret.
β With the server ON, move yourself left and right. Do both screens agree?
πNow turn the server OFF and move. Watch the two screens.
π€ͺLeave the server off and let your friend wander too. How bad does it get?
πTurn the server back ON. What happens to the screens?
π§ Think: who decides the βrealβ position when players disagree?
π You leveled up! You now know:
- π§ Your game lives in your computer's brain; your friend's lives in theirs.
- π₯οΈ A server is one shared brain that everyone connects to.
- π‘ The server holds the ONE true copy and broadcasts it to all players.
- π€ͺ Without a server, nobody agrees β multiplayer falls apart.
- π± Your computer is the βclientβ; the shared one is the βserverβ.
π¬ Behind the scenes β what's next?
In our lab, messages zipped to the server instantly. But the server might be hundreds of miles away! Those messages have to actually travelacross the internet β and that takes time. How do they get there, and why does βlagβ happen? Let's follow a message. π