Developer knowledge network · moderated exchange

Społeczność UnreliableCode

Badania programistów, inżynieria wsteczna i społeczność programistów

Knowledge indexNa żywo
4Categories
919Threads
2.8KPosty
Analysis

CS2 Server Lag Compensation & Backtracking Tick Math: tick_count - LerpTicks [v2.4 Technical Discussion]

netvar_ninja
Schema Master
MEMBER
Rozpustnik: 145
Data dołączenia: Nov 2018
Posty: 16
Dzięki: 89
1 miesięcy temu · Jul 1, 2026 7:02 PM
#1

How CS2 server backtrack validation operates in Source 2:

When a shot usercmd is received, the dedicated server rewinds the target player hitboxes to the exact historical client render tick:

$$\text{TargetTick} = \text{ServerTick} - \text{LatencyTicks} - \text{LerpTicks}$$

Where:

  • $\text{LerpTicks} = \frac{\text{cl_interp}}{\text{interval_per_tick}}$
  • Server stores up to 64 historical player record ticks (approx. 1000ms window).

If you store the past 12 ticks of CSkeletonInstance bone matrices per enemy, you can hit targets during high-ping player peeks reliably!

matrix_math_guy
Math Specialist
MEMBER
Rozpustnik: 105
Data dołączenia: Aug 2018
Posty: 52
Dzięki: 41
1 miesięcy temu · Jul 2, 2026 12:32 AM
#2

Clean breakdown of sub-tick latency compensation math. Storing the past 12 ticks of bone matrices is the standard approach.

vtable_slayer
Senior Reverser
MEMBER
Rozpustnik: 215
Data dołączenia: Mar 2018
Posty: 86
Dzięki: 61
1 miesięcy temu · Jul 2, 2026 7:14 AM
#3

Make sure you filter out ticks where the enemy player was dead or in teleports to prevent invalid hitbox rewinds.