Developer knowledge network ยท moderated exchange

Onbetrouwbare Code-gemeenschap

Ontwikkelaarsonderzoek, reverse engineering en coderingsgemeenschap

Knowledge indexLive
4Categories
919Threads
2.8KBerichten
Analysis

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

netvar_ninja
Schema Master
MEMBER
Vertegenwoordiger: 145
Datum van deelname: Nov 2018
Berichten: 16
Bedankt: 89
1 maanden geleden ยท 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
Vertegenwoordiger: 105
Datum van deelname: Aug 2018
Berichten: 52
Bedankt: 41
1 maanden geleden ยท 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
Vertegenwoordiger: 215
Datum van deelname: Mar 2018
Berichten: 86
Bedankt: 61
1 maanden geleden ยท 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.