
🎮 Gaming · Sequence
How a player gets into a match: joining the queue, skill-based matching, server allocation and connecting to the game server.
Drawing diagram…
Matchmaking sequence: the player clicks Play, the game client sends a ticket with skill rating and region to the matchmaking service, which groups 10 players with similar ratings (widening the range after 30 seconds of waiting). When a match is found it asks the server allocator for a dedicated game server in the nearest region, receives the server address and a join token, sends them to all players, and the clients connect to the game server over UDP.
sequenceDiagram
actor P as Player
participant C as Game Client
participant MM as Matchmaking Service
participant AL as Server Allocator
participant GS as Game Server
P->>C: Click Play
C->>MM: Ticket: rating 1450, region ap-south
loop Until 10 players found
MM->>MM: Match by rating and region
Note over MM: Widen rating range after 30s
end
MM->>AL: Allocate server in ap-south
AL->>GS: Start match instance
GS-->>AL: Ready at 10.2.3.4:7777
AL-->>MM: Server address
MM-->>C: Match found, address and join token
C->>GS: Connect with token (UDP)
GS-->>C: Match startingThe backend for an online multiplayer game: player accounts, matchmaking, dedicated game servers, leaderboards and in-game purchases.
The states of an online match on a game server: lobby, loading, in progress, pauses, reconnects and results.
How match results turn into leaderboards and rankings: result events, anti-cheat checks, rating updates and cached leaderboards.
How an online game runs servers close to players worldwide: regional fleets, a global matchmaker, and central account and store services.
How an in-game purchase is completed safely: store purchase, receipt validation on the server, granting items and handling refunds.
Tables for an online game: players, characters, items, inventories, currencies, purchases and match history.