Private tables: how friends play online with just a code
2026-11-29 · Sagar Studio
Twenty-six of our games have private online tables. You open a table, a short code appears, and a friend on their own phone or computer types it in, or taps a link you send. There is no sign-up, no friend list and no lobby of strangers to wade through. This post explains how that works and what it is designed to do when the network misbehaves.
A code, a link and a channel
A table code is five digits, chosen because digits are easy to say aloud and to type on a phone keypad. Creating a table picks a random code, opens a messaging channel named after the game and the code, and waits briefly. If someone is already sitting at that code, it picks another one. Joining checks that a table with that code exists and still has room; if not, you get a plain error.
The invite button builds a link to the same game with the code on the end. Opening it fills in the code and joins at once, so a friend never has to type anything. The messages themselves travel through a hosted real-time messaging service that relays small packets between the people in a channel. Our own game code adds no server logic of its own to it. When the build has no such service configured, the same code falls back to a browser feature that links tabs of one browser, which is how we test a whole match with two tabs on one laptop.
Kite Clash also has quick rooms, public tables with no code: a newcomer joins the fullest open room or opens a new one. The table code can also stretch beyond two players, up to six seats.
The host owns the game, and moves are numbered
The player who creates the table is the host. In a turn-based game, the host starts each match and holds the reference copy of the state. This one decision removes a whole class of bugs. If both phones rolled their own dice, the two games would drift apart in the first minute, so in Ludo Blitz the host rolls and sends the result. In Carrom Flick, the guest sends the shot, meaning its aim, power and striker position, the host works out where everything ends up, and the settled board is sent back, so tiny differences in floating-point arithmetic between two devices can never make the boards disagree.
The turn-based protocol is small. A match is started by the host with whatever starting information the game needs. After that, each move is a message with a sequence number: one more than the number of moves already applied. A receiver accepts a move only if its number is exactly the next one and the game agrees the move is legal for that player right now.
If a move arrives with a number from the future, a message was lost, so the receiver asks the host for a full snapshot and replaces its own state. If it arrives with an old number, it is ignored, or, when the host receives it, the host sends its snapshot to put the sender right. The host also pushes a snapshot whenever its friend connects or reconnects, and a guest that joins mid-match asks for the state immediately. The other message types are quick reactions, a rematch request that starts a new match only when both players have asked, and leave, sent when you quit on purpose so your friend is told straight away rather than waiting.
When the connection drops
Phones go through tunnels and switch networks. Each side sends a small ping every 2.5 seconds, and if nothing has been heard for 9 seconds the friend is treated as lost. A message appears with a 30-second countdown. If your friend comes back, the host sends a snapshot and the match carries on from the host's state. If the time runs out, the game reports that your friend left. Leaving through the menu is different: the game sends the leave message first, so there is no countdown.
Real-time games are different
A turn-based game can wait for a message. Air Hockey, Kite Clash and Hole Hungry cannot. For these, our brief calls for a host-run simulation. The guest sends only its input, a finger position or a held button, roughly 20 to 30 times a second. The host is the only one who runs the game and broadcasts a compact state, roughly 15 to 20 times a second. The guest draws what it receives, smoothed between updates with a short buffer of about a tenth of a second. We test these with artificial delay and jitter added, since an office network is a poor stand-in for a phone on a train.
Hidden cards
Card games raise a question: if every seat shares one channel, can a player read another's hand? In Card Clash the host deals and is the only one with the full state. Each seat is sent only its own view, and that view is encrypted with a key shared only between that seat and the host, agreed when the player sits down. Other players on the channel see unreadable data. Our poker, rummy and three-card games also keep hands encrypted. Guests send only what they want to do, such as play a card or draw, and the host checks it against the rules, so an illegal move from a modified client is simply rejected.
What is and is not kept
You need no account to play. What travels between you and your friend is what the game needs: moves, board snapshots, reactions and, at some tables, the names shown on the seats. Our game code does not save moves, hands or match histories anywhere. A table is a live channel rather than a saved record, so it ends when the people leave.
We should also be honest about testing. Most of our online testing was two browser tabs, with lag added on purpose, which is good at catching logic mistakes and weaker at catching what happens on a flaky mobile connection. If a table ever behaves oddly for you, we want to hear about it.