code wiki / (root) / nx_lagcomp.nx

nx_lagcomp.nx

buildroot/runtime/nx_lagcomp.nx

1206 B20 linesdepth 0pulls 0 transitivereach 1 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_lagcomp.nx -- SERVER-SIDE LAG COMPENSATION. The authoritative server keeps a ring of recent entity positions (~1s of history). When a client acts on what it SAW -- its view is (latency + interpolation-delay) in the PAST -- the server rewinds to that exact moment and adjudicates the action (catch / hit / ability) against the HISTORICAL state, so it "connects" fairly despite the 150ms ocean RTT. Without this, a correctly-aimed throw misses because the target has already moved on the server. Cited: Valve (1s history, ExecTime = ServerTime - PacketLatency - InterpolationDelay), favor-the-shooter asymmetry. Pure integer. license_tier: ORIGINAL

dependencies 0 imports · 1 importers

nx_lagcomp.nx nx_lagcomp_gate.nx

imports: none

imported by: nx_lagcomp_gate.nx

structs

none

consts

none

functions

9func lc_rewind(hist: *i64, now: i64, rewind_ticks: i64) -> i64
called by 1: main
15func lc_hit(aim_pos: i64, target_pos: i64, radius: i64) -> i64
called by 1: main