Developer knowledge network · moderated exchange

Сообщество UnreliableCode

Сообщество разработчиков, обратного проектирования и кодирования

Analysis

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

netvar_ninja
Schema Master
MEMBER
Представитель: 145
Дата присоединения: Nov 2018
Сообщения: 16
Спасибо: 89
1 месяцев назад · 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
Представитель: 105
Дата присоединения: Aug 2018
Сообщения: 52
Спасибо: 41
1 месяцев назад · 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
Представитель: 215
Дата присоединения: Mar 2018
Сообщения: 86
Спасибо: 61
1 месяцев назад · 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.