Design an Authoritative Grid Chase Game
Run many concurrent single-player chase sessions on weighted terrain with low-latency controls, server-authoritative robots, and durable outcomes.
Problem statement
Design a real-time single-player chase game on a 500 by 500 terrain grid. Grid height changes movement duration. A player changes direction while several AI robots path toward the player; reaching the goal wins and contact with a robot loses.
The server owns authoritative state, many sessions run concurrently, and completed game history is durable.
For this exercise, assume maps are immutable during a session, robot count is configurable at creation, clients use a bidirectional connection, and a direction change may cancel an in-progress move according to an explicit rule. Rendering, account systems, and robot-learning algorithms are outside scope.
What to build
- A player can create or resume one game session on an immutable weighted terrain map.
- The client can submit ordered direction changes and receive authoritative state updates.
- The server advances configurable AI robots toward the player using bounded pathfinding work.
- The service decides win or loss exactly once and durably records the completed session summary.
At scale
- The source fixes the terrain at 500 by 500 cells and says terrain height changes movement cost.
- For this exercise, assume 100,000 concurrent sessions, up to 20 robots per session, and a 10 Hz authoritative simulation tick.
- For this exercise, target 100 milliseconds p95 from accepted control input to an authoritative update in a healthy region.
- For this exercise, keep active state available through a process failure and retain completed histories for 90 days.