Developer knowledge network · moderated exchange

UnreliableCode Topluluğu

Geliştirici Araştırması, Tersine Mühendislik ve Kodlama Topluluğu

Knowledge indexCanlı
4Categories
919Threads
2.8KGönderiler
Analysis

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

netvar_ninja
Schema Master
MEMBER
Temsilci: 145
Katılım Tarihi: Nov 2018
Gönderiler: 16
Teşekkürler: 89
1 ay önce · 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
Temsilci: 105
Katılım Tarihi: Aug 2018
Gönderiler: 52
Teşekkürler: 41
1 ay önce · 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
Temsilci: 215
Katılım Tarihi: Mar 2018
Gönderiler: 86
Teşekkürler: 61
1 ay önce · 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.