Go Back   Steam Users' Forums > Steam Game Discussions > # - C > Counter-Strike: Source

Reply
 
Thread Tools Display Modes
Old 07-09-2010, 03:12 PM   #1
Echo
 
Hidden Path Entertainment
Join Date: Dec 2008
Reputation: 334
Posts: 653
How cl_interp and rates work

From the TF2 page:

The Source engine runs internal simulation at a tick interval of 15 msecs (66.67 ticks per second). Each client "usercmd" is a 15 msec timeslice (which makes it possible for prediction to work, since the inputs on both the client and server should result in the same outputs in most cases). The cl_cmdrate ConVar determines how many physical packets per second the client will try and send to the server. Note that this is decoupled from the tick interval. If the cl_cmdrate setting is low, or the client's actual framerate is low, then it's possible that a single physical packet from the client to the server will contain multiple actual "usercmd" payloads. Conversely, if the cl_cmdrate is higher than 66.67, it's possible that some physical packets will be sent to the server without any actual "usercmds" in them. Furthermore, if the client sets a low "rate" setting, then less physical packets could be sent to the server. The frequency of cl_cmdrate updates generally doesn't impact a player's ability to hit opponents, since lag compensation factors in the player's latency to the server and interpolation amount when checking whether shots would have hit opponents.

From the server side, the client's cl_updaterate setting determines how often the server will attempt to send a physical packet to the client. The basic formula is:

next packet time = current time + max( 1.0/cl_updaterate, bytes sent/rate setting )
Note:"bytes sent" includes the UDP packet header overhead of 28 bytes.In other words, if the player is requesting an updaterate of 20 packets per second, then the minimum time interval between physical packets is 50 milliseconds. However, if the player has a rate setting of 10000, and we just sent the player a 1000 byte packet, then the minimum time will be 1000/10000 or 100 milliseconds instead. If 1.0/cl_updaterate has elapsed and the server checks the "rate" part of the above equation and finds that it cannot yet send a packet, then the "choke" counter is incremented for the player. All this means is that the combination of rate, cl_updaterate, and physical packet size has forced the server to defer sending the player another packet. Thus, artificially setting cl_updaterate to a high number will usually increase "choke", especially in a busy scene, since the server is always trying to obey the user's specified rate setting. Choke is not necessarily a negative indicator, it could just mean that the cl_updaterate setting is too high.

The cl_updaterate, cl_interp_ratio, and cl_interp ConVars control interpolation (and lag compensation) in the following relationship. By default, Source games are tuned for an updaterate of 20 packets per second. This leads to an expected delta between packets of 50 msecs. Because packet loss can occur, the interpolator was tuned to allow for a single dropped packet without any hitch in the smoothness of motion perceived by the client. Thus, 100 milliseconds was chosen as the default for cl_interp (0.1 s = 2 x ( 1.0f / cl_updaterate default of 20 ) ). cl_interp_ratio defines the lower "bound" on what the actual interpolation amount used on the client. Specifically, the interpolation amount is:

min( max( cl_interp, cl_interp_ratio / cl_updaterate ), 0.25f )
Note:Server operators can clamp the allowable cl_interp_ratio and cl_updaterate settings and the clamped values are factored in to the above calculations.The Source netgraph now includes "lerp" indicator which shows the actual interpolation amount (usually 100 msec unless the server or user is forcing non-default settings). The indicator will turn yellow if the server's framerate (actual framerate on the remote machine) drops below this interval. This can be used to figure out why all of the objects in the world are no longer moving smoothly. In addition, the indicator will turn orange if the user or server has tuned the ConVars such that the interpolation amount is less than 2 / updaterate. This indicates that if there is any packet loss (or possibly choke if the choke is occurring for long periods of time due to large packets being sent over a low bandwidth rate setting) that the player will likely see sluggishness in the game.

From the network engineer at valve:

The default for cl_interp_ratio is two to allow for an occasional dropped packet w/o a visual hitch. I think amount of interp is max( cl_interp, cl_interp_ratio/cl_updaterate ) ... max( 0.1, 2.0/20.0 ) = max (0.1, 0.1) = 0.1, etc.

If update rate is 20, then packets come in at 50 msec. If interpolation is 100 msec, you can drop one packet, but get the next one, and not have run out of data to interpolate up to. That was the design of the original system and why interp was set to 0.1 seconds.

If they have a higher updaterate, then a lower interpolation amount can be fine. If they hardly ever have lost packets, I could see living with inter_ratio of 1.0. If they go less than 1.0, then the game will be somewhat stuttery, modulo at a high cl_updaterate with a fast server giving them updates close to the 66 hz max tickrate would make the visual hitching less noticeable. The other thing that impacts packet frequency is the amount of data being sent and the user's rate setting. We will "choke" packets if the rate setting for the client is too low, which will delay them. If they are only interpolating for 1/updaterate seconds, then if there is any choke at all, they will run out of data for interpolation, again causing visual hitching. This is another reason that keeping the default intep_ratio > 1 is good and why 2 is a reasonable compromise. Note that the lag compensation system takes into account the user's computed interpolation amount, so from an aiming point of view it shouldn't matter.

Updated--
here's some good community (unverified by us) information:

Sheyster's post on tradeoffs with cl_interp:
http://forums.steampowered.com/forum....php?t=1358325

__________________
Defense Grid Developer

Last edited by Echo: 07-12-2010 at 11:51 AM. Reason: cl_rate -> rate
Echo is offline  
Reply With Quote
Old 07-09-2010, 03:31 PM   #2
polka
 
Join Date: Mar 2004
Reputation: 561
Posts: 8,747
agree 99.9999%
the 0.00001% i disagree with is that cl_rate doesnt exist anymore, im thinking the OP meant "rate" and not "cl_rate"

do i get a hair-splitting hat?

if not, i should do
polka is offline   Reply With Quote
Old 07-09-2010, 03:44 PM   #3
AnAkIn
 
Join Date: Oct 2006
Reputation: 369
Posts: 4,345
Quote:
Originally Posted by polka View Post
agree 99.9999%
the 0.00001% i disagree with is that cl_rate doesnt exist anymore, im thinking the OP meant "rate" and not "cl_rate"

do i get a hair-splitting hat?

if not, i should do
You are correct, cl_rate only exists on the HL1 Engine and was removed on the Source Engine shortly after its release in 2004.

rate is server=>client and cl_rate was client=>server

I am not sure if rate is now both server<=>client or if it's still server=>client and the client=>server rate is fixed to a value.
AnAkIn is offline   Reply With Quote
Old 07-09-2010, 03:59 PM   #4
coltftw
 
Join Date: Jun 2010
Reputation: 10
Posts: 152
finally maybe some of the idiots that post in this forum can learn from this
coltftw is offline   Reply With Quote
Old 07-09-2010, 04:26 PM   #5
n69ky
 
Join Date: Feb 2009
Reputation: 5
Posts: 21
add hats!
n69ky is offline   Reply With Quote
Old 07-09-2010, 04:26 PM   #6
ClickeR509
 
Join Date: May 2010
Reputation: 1
Posts: 88
im confused

so whats the best rates values now ?
ClickeR509 is offline   Reply With Quote
Old 07-09-2010, 04:29 PM   #7
Sinonim
 
 
 
Join Date: Oct 2008
Reputation: 36
Posts: 349
good work. and n69ky - shut up.
Sinonim is offline   Reply With Quote
Old 07-09-2010, 05:33 PM   #8
beegoody
 
Join Date: Apr 2006
Reputation: 233
Posts: 2,523
Very interesting read. One question tho, is it important to cap the value of "rate" or is it fine to put it to its maximum value? (rate 1048576)
beegoody is offline   Reply With Quote
Old 07-09-2010, 07:59 PM   #9
tnk343
 
Banned
Join Date: Mar 2010
Reputation: 121
Posts: 1,946
All the plays with those parameters gave me very contradictionary results.
Don't want to waste my time diggin further.
Maybe I'm not smart enough for all that but I'm positive that all those manipulations are very far beyond the array of information which this game user should know and operate to simply play this game on a casual level like I always did.

In L4D2 and TF2 there are no need to be so precise in shootong, so all this mess with rates are kind of tolerable and even maybe imperceptible but in CSS all this becomes awful.

I think you guys should find some solution to this problem quickly instead of starting wall-o-text threads.
Don't you understand that the quite big part of this game's community are people who don't read the forums and the more so do not want to know wtf interpolation is?

Do you think this game is for techno-geeks who must understand how exactly OB engine works?

I know how to change oil, but I don't know how to dissmantle an engine.
I know how to install software and how to tweak it using standard and advanced menus, but I don't know how it's code looks like.
And you know what? I don't want to learn all these things.
I'm not a coder and I'm not a motor mechanic either. I have my own job to do and I have some much more interesting things to learn.

This game was just a 15min/day fun for me. But now you guys tell me that I should know interpolation, lerp and stuff.
It's the same thing if my motor mechanic told me after another scheduled maintenance checkup that after today I'm not able to drive fine as it was before this procedure in case I don't learn how exactly my car's reloaded engine works.


Good luck with upcoming updates.

Last edited by tnk343: 07-10-2010 at 06:07 AM.
tnk343 is offline   Reply With Quote
Old 07-09-2010, 08:41 PM   #10
Rillz
 
Guest
Posts: n/a
I'm not sure if anybody from Valve even reads these posts, nor do I know if this would be the right place to suggest something, but I'll post here anyways.

I could complain about a number of things/bugs/issues about this update, but I'm past that. I just want to move on, and get things back to normal.

Since rates seem to be a huge thing with the hit registry now (I suppose they were before too with our 100tick servers), why haven't you guys (Valve) added the ability for servers to control their clients' rates?

As server owners we want to provide the best experience possible for people playing on our servers, and to do so we have to enforce people changing their rates, but guess what... most people have no clue how to do so, and don't want to do it.
So many people join our servers with 30/20/10000 rates and we get stuck spending hours a day explaining how to change them, what to change them to, etc etc.

The ability for us to control clients rates server side would be great.
  Reply With Quote
Old 07-09-2010, 09:54 PM   #11
coltftw
 
Join Date: Jun 2010
Reputation: 10
Posts: 152
Quote:
Originally Posted by Rillz View Post
I'm not sure if anybody from Valve even reads these posts, nor do I know if this would be the right place to suggest something, but I'll post here anyways.

I could complain about a number of things/bugs/issues about this update, but I'm past that. I just want to move on, and get things back to normal.

Since rates seem to be a huge thing with the hit registry now (I suppose they were before too with our 100tick servers), why haven't you guys (Valve) added the ability for servers to control their clients' rates?

As server owners we want to provide the best experience possible for people playing on our servers, and to do so we have to enforce people changing their rates, but guess what... most people have no clue how to do so, and don't want to do it.
So many people join our servers with 30/20/10000 rates and we get stuck spending hours a day explaining how to change them, what to change them to, etc etc.

The ability for us to control clients rates server side would be great.
rates have been widely needed in the past just as they are now.

yes, server owners can force rate settings on the players in the server using server commands.

zblock will also help in enforcing rates just as it did in the previous version of source.

right now it will all seem confusing, but you'll be able to play this game casually without worrying about rates sooner than you think
coltftw is offline   Reply With Quote
Old 07-09-2010, 09:56 PM   #12
coltftw
 
Join Date: Jun 2010
Reputation: 10
Posts: 152
Quote:
Originally Posted by tnk343 View Post
All the plays with those parameters gave me very contradictionary results.
Don't want to waste my time diggin further.
Maybe I'm not smart enough for all that but I'm positive that all those manipulations are very far beyond the array of information which this game user should know and operate to simply play this game on a casual level like I always did.

In L4D2 and TF2 there are no need to be so precise in shootong, so all this mess with rates are kind of tolerable and even maybe imperceptible but in CSS all this become awful.

I think you guys should find some solution to this problem quickly instead of starting wall-o-text threads.
Don't you understand that the quite big part of this game's community are people who don't read the forums and the more so do not want to know wtf interpolation is?

Do you think this game is for techno-geeks who must understand how exactly OB engine works?

I know how to change oil, but I don't know how to dissmantle an engine.
I know how to install software and how to tweak it using standard and advanced menus, but I don't know how it's code looks like.
And you know what? I don't want to learn all these things.
I'm not a coder and I'm not a motor mechanic either. I have my own job to do and I have some much more interesting things to learn.

This game was just a 15min/day fun for me. But now you guys tell me that I should know interpolation, lerp and stuff.
It's the same thing if my motor mechanic told me after another scheduled maintenance checkup that after today I'm not able to drive fine as it was before this procedure in case I don't learn how exactly my car's reloaded engine works.


Good luck with upcoming updates.
you dont have to worry about interpolation or lerp.

right now you do, because no one knows how to enforce it like they could in the previous version of source. and zblock has to update their server plugin also. which should be completed soon.

in the near future, ppl will have server commands that will force the rates you use so that you dont have to worry about a thing.

you can just join a server and start fragging.
coltftw is offline   Reply With Quote
Old 07-10-2010, 01:19 AM   #13
milton
 
Join Date: Dec 2007
Reputation: 12
Posts: 419
Quote:
Originally Posted by Rillz View Post
Since rates seem to be a huge thing with the hit registry now (I suppose they were before too with our 100tick servers), why haven't you guys (Valve) added the ability for servers to control their clients' rates?

As server owners we want to provide the best experience possible for people playing on our servers, and to do so we have to enforce people changing their rates, but guess what... most people have no clue how to do so, and don't want to do it.
So many people join our servers with 30/20/10000 rates and we get stuck spending hours a day explaining how to change them, what to change them to, etc etc.

The ability for us to control clients rates server side would be great.
AFAIK this ability is already there and has been for a long time.

sv_minrate, sv_maxrate etc. determine and overrule the client's settings. As server owners you should know this.

Last edited by milton: 07-10-2010 at 01:24 AM.
milton is offline   Reply With Quote
Old 07-10-2010, 03:11 AM   #14
vic_123
 
Banned
Join Date: Mar 2009
Reputation: 9
Posts: 152
Dear Echo
Please remove sv_client_max_interp_ratio and sv_client_min_interp_ratio.
set cl_interp_ratio=2, and remove this cvars console client.
thanks.
vic_123 is offline   Reply With Quote
Old 07-10-2010, 04:13 AM   #15
J3Di
 
Join Date: Aug 2009
Reputation: 139
Posts: 316
Quote:
Originally Posted by vic_123 View Post
Dear Echo
Please remove sv_client_max_interp_ratio and sv_client_min_interp_ratio.
set cl_interp_ratio=2, and remove this cvars console client.
thanks.
That would not be fair on LAN/high quality connection players.
People with low speed internet connections or which suffer packet loss could also find the game jittery.
It is best left configurable, just the vast majority have no idea how it impacts their game. Really they should just leave it as default.
J3Di is offline   Reply With Quote
Reply

Go Back   Steam Users' Forums > Steam Game Discussions > # - C > Counter-Strike: Source


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



All times are GMT -7. The time now is 07:26 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site Content Copyright Valve Corporation 1998-2014, All Rights Reserved.