"Honor of Kings supports 10-player real-time battles with tight latency requirements. How would you design the state synchronization mechanism?"
Honor of Kings (王者荣耀) is the world's highest-grossing mobile game and Tencent's flagship title. This question tests knowledge of game networking, which combines real-time systems, distributed computing, and optimization under extreme constraints.
Introduce the two major sync paradigms: deterministic lockstep and server-authoritative state sync, and explain why Honor of Kings uses a frame-based lockstep approach.
Describe the frame synchronization model: the server collects inputs from all 10 players each frame (66ms at 15 logic ticks/sec), broadcasts the input bundle, and each client deterministically simulates the same result.
Address latency handling: input buffering, local prediction for responsiveness, and rollback when inputs arrive late.
Discuss determinism requirements: fixed-point math instead of floating-point, deterministic random number generators, and strict execution order to ensure all clients produce identical state.
Honor of Kings uses a deterministic lockstep synchronization model. The server acts as a relay: each logic frame (roughly every 66ms), it collects player inputs, packages them into a frame bundle, and broadcasts it to all 10 clients. Every client runs the same deterministic simulation — given identical inputs, they produce identical game states. This approach minimizes bandwidth since only inputs are transmitted, not full state. To handle latency, the client uses input buffering and local prediction: it immediately applies the local player's actions for responsiveness, then reconciles when the server frame arrives. If a player's input arrives late, the server uses a brief buffer window before advancing the frame. Determinism is critical — the game uses fixed-point arithmetic to avoid floating-point inconsistencies across devices, a seeded PRNG for all random events, and a strictly ordered execution pipeline. Anti-cheat is enforced by periodic state hash comparisons across clients and the server's own simulation replay.
Distinguish between lockstep (used in MOBAs/RTS) and state sync (used in FPS) and explain the trade-offs.
Mention fixed-point arithmetic specifically — this is a hallmark of deterministic game engines and shows deep understanding.
Discuss the replay system as a natural benefit of lockstep: storing only inputs allows compact replay files.
Lockstep requires transmitting only player inputs, dramatically reducing bandwidth — critical for mobile networks. It also simplifies server logic since the server doesn't need to run the full game simulation, allowing it to host more concurrent matches.
The server maintains a small input buffer window (1-2 frames). If a player's input doesn't arrive in time, the server may advance using the player's last known input. Persistent high latency results in visible rubber-banding for that player while other players remain unaffected.
HireMe AI listens to your interview in real-time, detects questions, and generates instant answer suggestions — so you never freeze up again.
Try HireMe AI Free