CS:S - Interpolation (LERP, CL_INTERP)

OG buckshot jr

TD Admin
Lots of people wonder what the fuck LERP is, when viewed in the "new" net_graph. Interpolation is how your client updates what's happening in the game.

In CS:S, interpolation directly affects hitboxes. The more the game is interpolated, the further away the hitboxes lay from the actual body on screen. Using Source's default value of cl_interp 0.1 (LERP 100ms) and cl_interp_ratio 1 would yeild hitboxes that are more off than using the correct cl_interp.

** I know. According to the equation in green (found below), the values don't add up because a default 100ms LERP doesn't equal 1 divided by .1. In fact, 1 / .1 = 10ms, however LERP shows 100ms. I don't know why, apparently it's a netcode fuckup.


Here's how to correctly calculate your cl_interp:

Firstly, realize this:
LERP = 1 / cl_interp

By default, cs:s will set your cl_interp at 0.1, showing 100ms LERP in net_graph = WRONG! Here's how interp SHOULD be calulated:

**QUICK NOTE = LERP (shown in net_graph) is the direct result of the calculations below. You should not calculate to get the lowest possible LERP, but rather the correct cl_interp.**

Moving on:

Code:
[B]cl_interp = cl_interp_ratio / cl_updaterate.[/B]

As an example, here's my rates (probably most other people's rates as well, seeing as how our server caps it out):

Code:
rate = 25000
cl_cmdrate 66
cl_updaterate 66
cl_interp_ratio 2

So, for those numbers, let us calculate cl_interp, then LERP:

cl_interp = cl_interp_ratio / cl_updaterate

cl_interp = 2 / 66

cl_interp = 0.03; therefore

Lerp = 1 / cl_interp

LERP = 1 / 0.03

LERP = 33.3ms (the correct setting for a 66-tick server, according to valve, google it yourself).

So instead of using source's default setting of cl_interp 0.1 (giving me a LERP of 100ms), I should use 0.03 (giving me a LERP of 30.3ms), which by Valve's network interpolation system, is correct.

Alternatively, the same calculations above using cl_interp_ratio 1 (if you use cl_interp_ratio 1, use this method):

cl_interp = cl_interp_ratio / cl_updaterate

cl_interp = 1 / 66

cl_interp = 0.01515... ~ 0.015; therefore

LERP = 1 / .01515

LERP = 66ms

HOWEVER...

The problem is that some people's computers/networks cannot handle cl_interp_ratio 1 and cl_interp 0.015, as it show a sometimes orange/yellow LERP. An orange/yellow LERP is a bad thing -> it means the interp setting is too low for your computer, and you'll get shit reg (pretty much the opposite of using the default values).

I eventually got an occasional orange/yellow LERP from using cl_inter_ratio 1 and cl_interp 0.015 so I switched to a better fitting cl_interp_ratio 2 and cl_interp 0.03, and now reg is much better.

Don't expect every shot to be perfect hit like a lazer, however it should improve your hit registration.


****************** WARNING! ****************


Remember the first paragraph: interpolation affects how close hitboxes are to players = lower interp, means faster interpolations = hitboxes are closer to bodies on screen. Setting a correct interp will tighten the gap between on-screen bodies and hitboxes.

So if you're one of those clowns (no names here, tee-hee) who shoot 2 metres infront/behind a guy and get a headshot, and would like to stick to it, then don't change shit. Alternatively, if you're like me, and actually aim and love to see good shots being made, then set your shit right!

Enjoy!
 

Shortbus

Professional Cocksucker
Just skimmed through your post and just wanted to add, i think setting cl_interp 0 makes it so it sets itself.

Also, youll know you have the right lerp/lowest when its in white (the default color). Adjusting it lower than what you can handle, like BJ said, will cause it to turn yellow/orange.
 

OG buckshot jr

TD Admin
Shortbus said:
Just skimmed through your post and just wanted to add, i think setting cl_interp 0 makes it so it sets itself.

So I've read, but I haven't tried. I've also seen ex_interp 0 (however I think that's a 1.6 command). Does it work Shortbus?

If so, I'll add to this tutorial.
 

Shortbus

Professional Cocksucker
OG buckshot jr said:
So I've read, but I haven't tried. I've also seen ex_interp 0 (however I think that's a 1.6 command). Does it work Shortbus?

If so, I'll add to this tutorial.

I couldnt tell ya, i have not seen that command. I only read about this stuff recently when i was fiddling around with my autoexec.cfg.

2 things i did find out are that cl_interpolate has been removed and the level of mat_picmip has been cap'd.

Apparently the latter was used to see through smoke or something which im sure some abused on the server.

Edit: All the stuff i read was with Source and i didnt coem across anything about ex_interp.

Also, after doing a search i read somewhere that ex_interp was a 1.6 command.

Edit2: Inputting ex_interp in console also gave me an "unknown command".
 

Shortbus

Professional Cocksucker
OG buckshot jr said:
Tru tru... I meant does the cl_interp 0 work to autoset, and if so, does it set it correctly?

I believe so. I normally have mine at cl_interp 0.04 which gets me a lerp of 40ms. If i set cl_interp 0, it sets to 0.02 but lerp stays at 40ms.

Edit: I think it would be better if someone tests it to see if they can reproduce the results. It might just be like that for me because it cant go lower (?).

Edit2: Whatever the case, avoid using the default, cl_interp 0.1 because that gives you 100ms and you'd want the lowest possible.
 

Shortbus

Professional Cocksucker
Lately ive been seeing lotsa people shoot behind players and hit. Not by chance, i mean they actually aim behind people. Is that to do with interp? Does it give some sort of advantage?
 

Leroy

2012 Troll of the Year
The only reason I'd say aiming behind someone would give you an advantage is if they ran behind a corner.

That exact advantage would be negated if they ran from AROUND the corner, you'd aim on them, fire, but hit nothing.

Honestly, I've tooled with my rates exceptionally, due to my geographical retardedness. (I'm still waiting for telus to come through and wire in my uber line)
 

Shortbus

Professional Cocksucker
Today i was just speccing random people when i was dead and noticed the top fraggers all shared this and i was just wondering why.

I guess thats why many times i as well as others have died behind walls then.
 

OG buckshot jr

TD Admin
Shortbus said:
Lately ive been seeing lotsa people shoot behind players and hit. Not by chance, i mean they actually aim behind people. Is that to do with interp? Does it give some sort of advantage?

That is, in fact, interp. That's exactly what interp does. Those must be players who use cl_interp 0.1 (default). The hitboxes are behind/ahead of the player.

Advantage/Disadvantage?

- depends if you're used to it
- If you're like me, and actually AIM at players, then it's a major fault, and one that makes people whine when they can't hit shit and when they die when someone's "looking the other way" stuff.
 

Hinouchi

TD Admin
Question haha I wanted to ask you about this at the meet but forgot to =P. So when I set the cl_interp to LEAP 25ms, will this effects my character only? or everyone else characters?
 

OG buckshot jr

TD Admin
Its how yiur computer interperates the game. However, other people use different settings, so you might still get fagged behind a wall with laggy rates n interp.
 
Top