PDA

View Full Version : Lerp/interp


$uCkY-p|aYeR
02-26-2010, 12:27 PM
I think I am going to start looking into these settings in old HL I understand it got to see if it's the same in TF2/HL2 engine. There some extra settings I think they done away with over time. Right now looking for a few people that are willing to try a few settings and tell me what they think of them and stuff. Probably will have some settings to try by Sunday morning.. Just got to do some research. I know that once I got my Net settings adjust right and fps so forth. That I was hitting really good and adjusting interp made it better. So now i want to do the same with the source engine.

right off the bat, taking a wild guess I think perfect lerp setting if it is in correlation with interp should be 3-5 more then your ping on net-graph so lets say you fluctuate between 50ms and 60ms set interp to .65 and if lerp changes from 100ms to 65ms I think that's where it should be. This is a guess based off of absolutely no research so probably will change in about 30 minutes lol.

Let me know if your interested in trying things and giving me your opinion on hit registry. I am not looking at someone enabling hit boxes and telling me if that works.. I want honest feed back on if you shoot at someone and they die or you hit where you aim not what a computer tells you.

$uCkY-p|aYeR
02-26-2010, 12:33 PM
question before I test some things. Does the server have forced setting on interp of can I adjust it freely or interp_ratio.

Jebus
02-26-2010, 04:34 PM
You may have seen this, but if not, it will help you understand lerp/interp. It is a DoD:S instruction, but it applies to TF2 all the same. It's what I used to get lerp set just right.

YouTube- DoD:S lerp

$uCkY-p|aYeR
02-26-2010, 06:50 PM
Thanks, man thats a pretty good video explains it pretty good.

I don't like hit boxes mostly it's based on calculations surely cause if my computer somehow knew where the correct hitboxes are then we wouldn't need interp/lerp. I have looked up alot of material today.. Tommorow morning I think I will put a few theories to the test and see what happens.

$uCkY-p|aYeR
03-01-2010, 10:01 AM
Well Seems Valve fixed it and every server I played in allowed me to set to anything over .050 at least I never tried lower then that. Lerp is whatever your cl_interp setting is such as cl_interp .070 would show up on net_graph as Lerp 70ms

Now I did read somewhere that cl_interp_all setting 0 enables the new interp that pretty much only interps what it needs too and setting it to 1 makes it interp everything like the old interp. I set it to 1 and seen good hit registry like in old HL..

I tried setting cl_interp .090, .075, .085, .050 for me my shots where hitting very well at .085. Which was about 10 more then my ping on net_graph.

So as of now until I see a big difference I am going with 10 more then your ping on net_graph just like in old HL. I guess I will write up something and add to my net_code explained.. Wait a week to do more testing to make sure.

$uCkY-p|aYeR
03-01-2010, 04:29 PM
I lied I started writing it but seeing that I don't have anything hard core I started using math and figuring out somethings. Took 1000ms and divided it by 66 cause thats the tic of most severs and found that you should receive an update every 15ms. Based on valves system it expects you to use 100ms setting for interp but cl_updaterate of 20. Which gives you an update every 50ms so you get 2 in 100ms. Since most of us is trying to get the full 66 updates from the server for better hit registry. I will use that information. My theory is this:

That if we get and update every 15ms per 66tic server then interp should be set to a multiple of 15ms plus not to go over 100ms really. So that gives us 15, 30, 45, 60, 75, 90, and 105. I know that I hit good at 85 and 90 but if I go below 85 and over 90 I start seeing more misses. don't get me wrong I can hit decent at 100ms interp but I see better hit registry between 85 and 90. Which I ping right at 75 - 80.

This makes me believe that ping has a little to do with it. I think based on your ping you should go up to the next multiple of 15ms on your interp. Lets say you ping at 48-55 then set interp to 60ms. If you ping at 60-65 put interp at 75ms.

If you want to test this for shits and giggles make sure you put cl_interp_all 1 in the console then type cl_interp .060 for 60ms or .075 for 75ms. You will know if you have the right setting cause on your net_graph 1 it will show lerp XXXms make sure that matches the number you want.

Philosoraptor
03-01-2010, 04:44 PM
I love you so much right now.

$uCkY-p|aYeR
03-01-2010, 04:49 PM
You being sarcastic lol

Philosoraptor
03-01-2010, 04:51 PM
No, lets put it this way i had no idea what to set my interp for awhile now, but thanks to your post i'm pretty sure i know what to set it at now.

$uCkY-p|aYeR
03-01-2010, 04:54 PM
Oh, well this is still a theory(although based on facts I have read tho).. Please let me know if it works for you I got to test some too yet.. The more feed back the closer i know if my theory is pretty close or if I need to go another way.

Philosoraptor
03-01-2010, 04:56 PM
Will do.

Philosoraptor
03-01-2010, 06:18 PM
So far I've notice a improvement in shots connecting but give me a day or two and ill tell you if there's a big difference.

stewlounse
03-02-2010, 11:23 AM
I run cl_interp as close to zero as possible just because I want my damn rockets to come out when I tell them to, lol.

$uCkY-p|aYeR
03-02-2010, 12:05 PM
Interp doesn't effect what we send to the server. It only effects the updates we receive...and the more I keep reading and looking.. if you don't have any choke or loss then you probably aren't using interp at all. Actually I don't think it does anything if your getting choke only loss but I got to look up more info on that part.

stewlounse
03-02-2010, 12:55 PM
You know what I mean, right? If you run a high cl_interp and shoot a rocket..there's a delay in between when you click and when the rocket comes out. The closer you get cl_interp to 0, the smaller that gap gets. In other words it fires when you tell it to, instead of delaying. This change in delay is enough to make or break a good soldier. As well as other classes too...

$uCkY-p|aYeR
03-02-2010, 01:20 PM
You got it backwards yes there is always a delay in when you fire and the trip to the server. But cl_interp is the interpolation on updates that are received by the client and rendered on his screen. When you fire at at an enemy then that info is sent to the server and the server uses sv_unlag 1 to interpolate the packets coming from the clients.. I think it holds a history of 1 second according to Valve. Now I believe if you type cl_lagcompensation 0 then when you fire you actually see the delay of the shot. Turning it back on to 1 should make your shots fire right away.

http://developer.valvesoftware.com/wiki/Source_Multiplayer_Networking

Read under lag compensation..

I got my Interp at .090 and when i shot it hits if I miss its cause I actually didn't aim good. Now if you are playing against people with over a 100 ping you will see alot of shots miss when you aim perfectly I don't think the server interpolates right when they ping that high.

$uCkY-p|aYeR
03-02-2010, 01:39 PM
Going as close to 0 won't hurt.. I think as long as you stay above .0152 on a 66tic server that actually might be the way to go.. I haven't tried that setting yet.. But will tomorrow morning. I am not seeing a difference in .090 and .075 and anywhere in between.

stewlounse
03-02-2010, 03:26 PM
I have my autoexec to set cl_interp 0 but is always limited by the server at ~.01...
It behaves exactly how I described it, though. High cl_interp = big delay of rocket coming out. Almost zero cl_interp = rocket comes out nearly instantly.

I'll view the link at home..it's blocked here at work. But I'm not sure what my lag compensation is set to. I watched a sniping video on youtube last year comparing lag compensation 1 vs 0 but that was about hitbox/player model stuff.

For me to be effective as a soldier, I need my rockets to come out when I click...not a tenth or so of a second later, or else I won't hit a damn thing because of the launch delay.

$uCkY-p|aYeR
03-02-2010, 03:46 PM
actually I don't think the server limits. I think when you set it to 0 it makes it go with cl_interp_ratio change that to 3 or something I bet your cl_interp will change.. But that isn't really important. cl_interp .01 should work perfect as long as you have no packet loss. I am going to post more stuff later on to help people work out there interp maybe. I wish I could test this shit out at work lol..Then I wouldn't post as much as I do lol..

$uCkY-p|aYeR
03-02-2010, 06:19 PM
here is my final take on this.. I think I got it figured out pretty good. please let me know of any disagreements or if i don't explain my self well I really suck at writing stuff.

http://www.jason35.com/interp.htm

I think lag compensation, prediction errors, cl_smooth and smoothtime is my next focus another group of settings that people play with.

Homfry
03-02-2010, 07:31 PM
You got it backwards yes there is always a delay in when you fire and the trip to the server. But cl_interp is the interpolation on updates that are received by the client and rendered on his screen. When you fire at at an enemy then that info is sent to the server and the server uses sv_unlag 1 to interpolate the packets coming from the clients.. I think it holds a history of 1 second according to Valve. Now I believe if you type cl_lagcompensation 0 then when you fire you actually see the delay of the shot. Turning it back on to 1 should make your shots fire right away.

http://developer.valvesoftware.com/wiki/Source_Multiplayer_Networking

Read under lag compensation..

I got my Interp at .090 and when i shot it hits if I miss its cause I actually didn't aim good. Now if you are playing against people with over a 100 ping you will see alot of shots miss when you aim perfectly I don't think the server interpolates right when they ping that high.

This is Lag Comp
TF2 Hitboxes

According to the tf2wiki

Projectiles are NOT lag compensated.

Porjectiles are deal with in a different manner

So entity based weapons such as the Pills, Rockets, or Huntsman arrows are not lag compensated (as opposed to hitscan; shotgun, minigun, sniper rifle etc.).

From the dev wiki you posted:

*This is assuming default settings

"
Entity interpolation causes a constant view "lag" of 100 milliseconds, even if you're playing on a listenserver (server and client on the same machine). So if you turn on sv_showhitboxes the player hitboxes are drawn in server time, meaning they are ahead of the rendered player model by 100 milliseconds. This doesn't mean you have to lead your aiming when shooting at other players since the server-side lag compensation knows about client entity interpolation and corrects this error. If you turn off interpolation on a listen server (cl_interpolate 0 and cl_lagcompensation 0), the drawn hitboxes will match the rendered player model again, but the animations and moving objects will become very jittery.
"

So this is the classic if you crouch it wont show up on your entity on the server until 100ms later. The same is applied to a projectile. When you click you essentially create an entity with a certain path and trajectory. However, when you click it you are dealing with the lag of 100 milliseconds. Reducing your lerp reduces the lag from firing the projectile to it actually appearing on the server.

As a demo I set my lerp to 0 and the servers will force it to whatever the lowest value is. Somethine like .0152 or whatever it is. They don't just change your ratio.

$uCkY-p|aYeR
03-03-2010, 10:11 AM
Ok... lets think this thru logically. Don't think about who is right or wrong. Concentrate on just the video and none of the other information at all. First what your saying is that from the clients machine you can showhitboxes and the hitboxes is where the server is saying your at and the rendered player is where the client thinks you are. Now if this is correct then your saying that somehow even tho my computer knows where the player is in real server time. That it renders the player in a different place. So even tho we have lag somehow in this awesome game they found a way to have none. But don't want us to be lag free so they make sure we are 100ms behind.. I am pretty sure that is what your saying.


Try doing what they did in the video and leave lag compensation 0 or even 1 bet it would work either way. now instead of interp 0 try setting it to .090 and watch the hit boxes go back even farther away. All the hitboxes show you is what your interp setting is the bigger lerp the farther away hitboxes are. Which only means that you will interpolate that far back to calculate player positions if you interp.

Now on the ratio let me explain: First way back when I first started playing source games just about when tf2 was released. You couldn't type cl_interp 0 or any other setting actually the game forced you to cl_interp 0 cause it was considered a cheat. So the only way you could change your interp was to use the cl_interp_ratio command. So mani mod and all those decided to force players to cl_interp_ratio 1 or 2 usually so you couldn't go higher since everyone agreed that those ratios where the best. So now people still use mani mod and so you go into a server with cl_interp 0 it will force cl_interp_ratio which changes your interp to .0152 which is 1/66 tick 1 being the cl_interp_ratio. But now whats funny is that even tho some mani mods still force it you could type cl_interp .050 and it would by pass that I bet cause I have been able to set my interp in every single server I have tried.. I just haven't tried to use interp ratio.


The reason I work so hard on figuring this stuff out is so many people rely on whatever anyone posts with out looking it over and trying it there self. Hence about 3 years ago when everyone said rate 30000 any higher is lan. So I tested that setting and works beautifully join a empty server my net_graph shows perfect no choke or loss. I join semi busy server and cl-updaterate 100 in a 100tic server playing CS:S and choked all the time my clan complained about choke everyone said yeah its just a bad server. So I started looking into why people choke and tried rate 100000 and bam no more choke on that server. I told the rest of the clan and they got rid of there choke.. My point is you can find several sites still saying that.. doesn't mean there right. Now the only reason they get choke is when the server gets to busy then the server chokes for the most part.


cl_interp whatever setting you use will work perfectly for anyone as long as you have 0 loss the whole time thru the game.. You can set it and go into the game and think that your shots are going to hit. Interp only works if you are losing packets if you don't lose packets then you don't interpolate. Thats why cl_interp 0 works.

$uCkY-p|aYeR
03-03-2010, 10:13 AM
oh and the reason that even on a listen server you 100ms behind is cause cl_interp is .0152 change it and even on listen server it will move hitboxes back farther. If there was a way to disable interpolation all together then the hitboxes would be right on the rendered model.

Tiger
03-03-2010, 10:52 AM
hitscan classes- higher interp
projectile classes- low interp

$uCkY-p|aYeR
03-03-2010, 01:41 PM
So reading more about lag compensation particularly server side which is what determines if you shot the player or not. It seems default server is set to save 1 second in the past all the history of everything that is going on in the server. When you shoot its basically time stamped and where you shot at the server then goes back in time to see if a player was there at that time and calculates it as a shot hit or missed depending on the servers history of course this happens so freaking fast you don't see it. This is how when you aim at someone directly it will show a perfect hit but on the persons machine you shot they maybe around the corner and think you shot through a wall. Mostly this should happen more often with someone that is high pinged like 300-400 he will shoot a lower lagged player and it won't register on the lower lagged players screen until he is somewhere different.

I would think that if you set sv_unlag 1 and sv_maxunlag .010 then high pingers would have horrible horrible hit registry.

oh crap got to go will finish up later.

Homfry
03-03-2010, 04:32 PM
Judging from your responding post I believe that you are still a little confused.

Let me just break it down with some repeat information to make it all clear.

Interp matters for projectiles

Just go into a game

join demoman or solly

type cl_interp 0

Fire a few projectiles and get used to the delay of the pill coming out from your weapon based on time.

Then

type cl_interp 1

Fire a few more projectile and you will really see the difference. with cl_interp 1 the server will force it to whatever but it is a large number and the pill will come out long after the firing sound clip is over. It is actually pretty silly :).

This shows that projectile are affected by interp setting.
Q.E.D.

Lag comp is when even though the model is separated from the hitboxes lag comp will give you a hit when you hit the model not the hitbox. When lag comp is off you can shot the model all you want but you actually have to hit the hitbox for a hit to be registered. It has nothing to do whatsoever with the hitbox in relation to the model.

Interp is used to insert an artificial latency delay on the model in order to smooth the previous frames together so that if there is packet loss or some other artifacts then it will interpolate the missing frames with the know frames to smooth it out. Hence the term interpolate. Otherwise you would get jerky motion and therefore jerky hitboxes. if interp was off then hitboxes would match model, yet have the potential to be jerky. It would be even worse when you add ping into the equation.

Projectile users want low interp so the bullets come out when they click. The reason being since you are interpolated over the minimal time then the game does not need to insert artificial latency. Cause whenever you click the game has to wait for the delayed interpolation to sort of catchup to your current frame of reference before it can insert your entity. Otherwise you would be inserting entities "back in time". So the smaller the interp the less you have to wait for it to catch up. You don't necessarily care about jerky movement because the projectiles use the larger projectile box. So reaction time and speed are the dominant factors not a jerky model.

Hitscan users want smooth enemy motion because when you click to fire on the model lag comp will take care of any interp or ping delay. So the dominate factor is model smoothness and your ability to predict it. You want the model to be smooth because if you click and it jerks you just lost damage. You don't really care about the artificial delay because hitscan happens instantly.

I'm not sure why you are disagreeing so fervently with the fact the projectiles are affected by interp the way stew and I mentioned. It only takes 1 minute to prove to yourself that have an incorrect understanding of the relationship of projectiles and interp. In general, though it seems you have an alright understanding of interp. However, you are not comfortable with it enough to see it from all angles and seem to only be able to understand from your own point of view.

The only reason I'm on your case about this is because you basically told stew to GTFO over this interp projectile thing, which after all this time I still think you haven't done the basic cl_interp 1 fire, cl_interp 0 fire test I explained above. You also tend to make claims without a lot of backing or evidence behind it.

$uCkY-p|aYeR
03-03-2010, 05:15 PM
You would think that it would be easy to prove but I set interp to 0 or 1 and have no delay on any projectiles. so there must be another setting that you have set to make this happen..That you guys are failing to mention. Otherwise I would have already seen the results just cause I dismiss it isn't because I don't believe you its cause I haven't seen it happen.. Now thinking maybe if you turn cl_lagcompensation off then maybe I would see the delay. But even lag compensation should work for projectiles as well.

$uCkY-p|aYeR
03-03-2010, 05:31 PM
I will be retesting that.. and I think deleting all my config files so there all on default to make sure nothing on my end is causing me to not see the delay and will post tomorrow.

$uCkY-p|aYeR
03-04-2010, 10:04 AM
Finally it did do it and started checking things out after that and even finally got my lerp to turn orange. So this helps tremendously on getting this figured out.. I understand now the closer to 0 the faster it fires and even the explosion(I timed it to be sure it was exploding late as well as visually being late..

Now what I have read about lerp turning orange supposedly this means you are not interpolating correctly and in fact you are extrapolating. Do you agree with this or not. I can't find anything else that says any different. So I would say that even tho your weapons fire faster at close to 0 interp that in fact if lerp is orange you would want to raise it just enough to turn it white. Which would give you more accurate interp for player positions.

Now I have to play around with the setting on sniper cause I don't see any non smooth player motion at lerp 30ms vs 100ms. It seems very smooth until I go down really low like 0 but then my lerp sometimes turns orange then. I understand higher lerp is suppose to be better. Just got to see the results with my own eyes so maybe try this out tomorrow.

Well Sorry for not agreeing with you, I just read try and if I don't see the results or what is suppose to happen I usually dismiss it.

stewlounse
03-04-2010, 11:19 AM
Looks like you notice the delay now. I was going to suggest trying cl_interp 0 and then cl_interp 4 (just a huge number so you see how ridiculous the delay gets).

$uCkY-p|aYeR
03-04-2010, 11:46 AM
Yep for sure.. Now when you say high lerp for hitscan weapons you don't mean like 500ms do you?

Homfry
03-04-2010, 03:41 PM
When interp goes orange or yellow or red it means the it doesn't have enough imformation in order to interplate correctly. However, all this means is that the models MAY be a little jerky doesn't mean they are actually going to be. It really only becomes an issue when there is loss. Without lose there really is only slight interpolation. From the network guide it mentions the the client is given 20 snapshots a second of entities position. so every 50 milliseconds you get a new update. The jerkyness comes from if for example you turned interp off then people would basically jump around to a new position every 50 milliseconds. So a scout running and zig zaging would look pretty funny. Interpolation tries to smooth those actions together to make it look clean. The more interp you have to more data it has to smooth that over. The less interp the less data. Loss causes additional jerkyness because if you missed one packet you would have an update 100 millsecond later instead of 50. Interpolation also tries to fix this by using surronding data points to smooth over that loss. with very little interp if you lost a pack it would probably be pretty easy to notice.

Some people like to say the playing with your interp for a hitscan weapon is mostly a placebo effect. Just have it high enough that it doesn't go orange or yellow.

I personally play with interp 0 for demoman, and it is orange or yellow depending on the server. The jerkyness doesn't really bother me because you never really see it or it is hardly noticiable because hiting with a pipe is orders of mangnitude above micro jerkyness.

The standard number you will see around on the internet for hitscan is something like .33

high enough for the interp to never go orange or yellow even on a bad server but not super high.

The other rule of thumb is just go into a server and have binds to lower and raise it. and basically lower it until it goes yellow or orange and then back up until it's white.

Not somethine huge to stress about. Just for a projectile class you want it as low as your comfortable with for the fast response.

The more important things to make sure you take care of is loss and choke.

It's no big deal I just couldn't believe that you didn't verify / didn't notice the interp difference of the pipes. It wasn't that you just didn't believe it, but you even fought it :). I couldn't understand why you wouldn't just check it out. I'm sure now that you have seen it you can understand what sort of difference it makes.

Lol it's pretty silly when the sound clip starts and then ends and then like a little later the pill just flies out :)

$uCkY-p|aYeR
03-04-2010, 03:53 PM
Yea it was the sound happening real time and picture later that made me time it to make sure the explosions where delayed.. I was thinking an interp just before it turned orange would work for the hitscan weapons which depending on the server would be around .030

Homfry
03-04-2010, 05:09 PM
Yea it was the sound happening real time and picture later that made me time it to make sure the explosions where delayed.. I was thinking an interp just before it turned orange would work for the hitscan weapons which depending on the server would be around .030

whoopse I meant .033 not .33 :)