group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
HitboxHistory.hpp File Reference

Server-side ring buffer of recent hitbox capsule snapshots per entity. More...

#include "ecs/components/AnimSnapshot.hpp"
#include "ecs/components/Hitbox.hpp"
#include <array>
#include <cstddef>
#include <cstdint>
#include <vector>
Include dependency graph for HitboxHistory.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  HitboxHistorySample
 Per-tick capsule snapshot stored in the history ring. More...
struct  HitboxHistory
 Ring buffer of recent hitbox snapshots for one entity. More...

Detailed Description

Server-side ring buffer of recent hitbox capsule snapshots per entity.

Phase 6 of the networking overhaul lays the plumbing for lag-compensated hitscan: the server records the world-space hitbox capsules of each player every physics tick into a per-entity ring, so when an attacker's shot arrives we can (eventually) rewind targets to where they were on the attacker's screen at the moment they pulled the trigger.

Today this component is populated by HitboxHistorySystem on the server but not consumed anywhere — rewindHitboxes is a no-op stub. The future "flip" is a one-line change inside the rewind guard that swaps HitboxInstance::capsules for the stored sample matching the attacker's tick. Wire format and gameplay are unchanged in Phase 6; this is purely scaffolding that ships compiled, runs, and earns its CPU budget so the eventual flip is risk-free.

The component is also defined in shared (ecs/) code so the rewind guard's view<HitboxHistory> query compiles into both server and client TUs. On the client, no entity ever has the component — the query is empty and the guard is automatically a no-op.