Server Rewind Hit Validation for a Tactical Shooter
Last updated: November 29, 2026
Quick Overview
Implement server-side hit validation: given a target's recent position history, the shooter's round-trip time and interpolation delay, rewind the target to what the shooter saw (capped at a maximum rewind), then test whether the shot ray hits the target's hitbox.
Riot Games
November 29, 20260
0
0 solved
Implement server-side hit validation: given a target's recent position history, the shooter's round-trip time and interpolation delay, rewind the target to what the shooter saw (capped at a maximum rewind), then test whether the shot ray hits the target's hitbox.
Inspired by the server-authoritative model behind VALORANT, where the server rewinds the world to the shooter's view but limits how far back it will go. Interviewers on gameplay networking teams check binary search plus interpolation over snapshots, a correct ray versus circle test, and a sound explanation of why the rewind cap exists.
What the Interviewer Expects
- Compute the time the shooter actually saw from RTT and interpolation delay
- Cap the rewind window and explain the fairness reason
- Binary search snapshot history and linearly interpolate
- Write a correct ray versus circle intersection that rejects targets behind the shooter
- Name the precision and tick rate concerns
Key Topics to Cover
How to Approach This
- Clarify input constraints and edge cases before writing code.
- Walk through your approach verbally and confirm with the interviewer before coding.
- Start with a brute force solution, then optimize. Mention time and space complexity.
- Test your solution with examples, including edge cases like empty input or duplicates.
- Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
- How would you extend this to 3D capsules for head, body and legs?
- How do you keep a bounded history buffer per player at 128 ticks per second?
- What does the defender experience when a high-ping shooter is rewound, and how does the cap trade that off?
- How would you detect a client that lies about when it fired?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice DSA ProblemsSample Answer
Requirements
History is a time-sorted list of (t_ms, x, y) snapshots for the target. The client renders others about one interpolation delay in the past and its input reaches the server about half an RTT late, s...
High-Level Design
- Compute rewind and clamp it. 2. Binary search the snapshot just after
t_seenand interpolate between it and the previous one, clamping outside the buffer. 3. Normalize the ray direction, project ...