Go Back   StrafeRight Forums > StrafeRight PC Gaming Forums > First-Person Shooters (FPS) > Counter-Strike: Source > Counter-Strike: Source Tech Support
New Posts Calendar Xbox Live Leaderboard Arcade Members List

Counter-Strike: Source Tech Support Hardware, Software and Patch Issues

 
 
LinkBack (1) Thread Tools
  1 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 03-01-2007, 03:01 PM
silentsentinel's Avatar
Gentoo FT... FT... FTSomething!
 
Join Date: Jan 2007
Location: Virginia
Posts: 875
silentsentinel pwns without cheats!
Send a message via ICQ to silentsentinel Send a message via AIM to silentsentinel Send a message via Yahoo to silentsentinel
Netcode & Rates Guide

There's a lot of misconception within the Counter-Strike: Source community about proper netcode settings. To the casual player or person still honing their computer skills, knowledge collected from other users is often one's primary source of information, as most people simply lack the time, will, or technical expertise to perform thorough, empirical testing of their own.

After acquiring countless hours of CS:S play under my belt, and getting a real feel for the game, I, like many others before me, became dissatisfied with my shot-registration performance. When you play first-person shooter games for as long as I have, you develop a very good feel for "leading" lagged shots, especially after playing older games on wretched dial-up connections. As is obvious to many, it became very apparent to me as well, that my shot-registration issues were not lag related.

Thus, I embarked on a journey I loathed to give thought to: drudging through Google searches for accurate data. I shuttered, wept a bit, then pressed on.

I found before me a festering hive of forums, blogs, and other websites, all of which professed to have the right answer. Not to my surprise, many claims from the denizens of these places offered no supporting evidence, nor counter-evidence to refute arguments which they disagreed with. I shuttered, wept a bit, then pressed on.

I, in many information gathering attempts on the Internet for various subjects, have a hard time taking many arguments at face value. When someone makes a post without any reason as to why they think the way they do, then it often leads me to believe they haven't thoroughly investigated the issue at hand, and very likely could be altogether wrong. Again, this is not always intentional, word of mouth is often accepted as 'fairly accurate', and various real-life constraints can leave people with no other choice but accept the given answer.

After searching for real, supported data for a long time, I've arrived at a point where I know of only 2 well researched, supported, coherent, and reliable sources of information. Both authors, Raggi and Whisper, frequent the Source administration community, and are extremely careful to advertise only information that has a reference for accuracy. Their data is primarily documented at Raggi's "Simplest Rates Guide Ever" thread, and Whisper's Wiki.

I will compile current information below for ease of use and simplicity, as changes have occurred with recent Steam updates, my hope is that this will prove useful to those trying to understand their CS:S netcode issues, and that having the information at hand will save a lot of time, and headaches.

_________________________
  • Accessing the Console
Launch CS:S, and open the console by pressing "`". If the console does not appear, make sure it's enabled under Options -> Keyboard -> Advanced.

  • Understanding the Netgraph
Once connected to a server, open the console and type "net_graph 3". You will see something similar to this picture:



I will quote a solid explanation of the graph from Whisper's Wiki:
Quote:
1. fps is how many frames per second the client is rendering. This is limited by the clients fps_max setting or the refresh rate of the monitors vertical refresh rate if Vertical-Sync is enabled.

2. ping is:

a) netgraph ping is the round trip time for game packets, NOT including any tickrate or updaterate induced calculation delays
b) Scoreboard latency (ping) is one way trip latency (I have to find out in which direction)
c) rcon status command ping, well nobody really knows what this means yet, but I am aiming to find out.

IN is what is being received by you the client, FROM the server.
OUT is what is being sent by you the client, TO the server.

The IN & OUT both have 3 components, starting from left to right:

3. The size of the game packet in bytes being sent and received (Not sure if this includes UDP Segment + IP Packet overhead)

4. The Average amount of KiloBytes Per Second being Sent or Received of GameData + UDP Segment + IP Packet overhead

5. The Average amount of Updates being Sent or Received per Second

If you multiply 3. by 5. and then divide by 1000 you will get a close approximation of the value of 4. which includes rounding errors because 4. and 5. are only averages. So using the numbers we see above, for IN we get (154*102.4/1000)=15.7696 with the value shown in the picture above for net_graph 3 being 15.16. Meh, close enough.

The amount of IN Updates received by the client per second (controlled by cl_updaterate) will in most cases equal the servers tickrate, but will NEVER exceed:

* The Clients cl_updaterate
* The Servers sv_maxupdaterate
* The Server/Clients tickrate which are always the same, as the client will always use the same tickrate as the server it connects to

Which ever is the smallest of those 3 numbers will determine the number you see for Updates per second RECEIVED by the client.

If the clients AND/OR servers bandwidth is not sufficient, or is limited by the clients rate or servers sv_maxrate, then the client will NOT see the IN Updates received by the client per second equaling the servers advertised tickrate. This is one example of when the client will see choke.

If the server does not have enough CPU to sustain the servers fps above the servers tickrate, the client will NOT see the IN Updates received by the client per second equaling the servers advertised tickrate. This is another example of when the client will see choke.

The amount of OUT Updates sent by your computer per second (controlled by cl_cmdrate) will NEVER exceed:

* The Clients cl_cmdrate
* The Server/Clients Tickrate
* The Clients Frames Per Second

Which ever is the smallest of those 3 numbers will determine the number you see for Updates per second SENT by the client.

It may look like the OUT Updates sent by your computer per second does exceed the fps, but it reality it does not. It is that the net_graph 3 readings are not always perfectly in sync or there are rounding errors in the calculations, because the the two per second counts 4. and 5. shown in net_graph 3, are only averages. There is also the error in the net_graph 3 that occurs when the Average Updates Received by you per Second magically seem to exceed the servers sv_maxupdaterate, servers tickrate, and the clients cl_updaterate, which were all set to 100 at the time the screenshot was taken above, despite what is shown in the picture above.

6. Loss Are lost packets due to Network problems, either with your computers connection to your ISP, your ISP, or the ISP that is hosting the Server or anywhere in between. If you have loss then you will probably have choke. Do not bother trying to solve Choke problems if you have Loss problems. Resolving loss problems is done by following standard Network Trouble Shooting Procedures. Get a friend to help you or call your ISP, or ask in the Game Server Providers Forum for help. Helping you with network problems is outside the purview of this document, and people who know what they are doing get paid 3 or 4 figure dollar amounts an hour to solve them.

7. Choke Is quite simply the server wanting to send you data but cannot. The reason for this though are not always simple to understand, diagnose or fix. See the Choke explanation above.
Now that you have a comprehensive overview of how the netgraph actually works, you can begin to diagnose specific issues and correctly set the various client variables appropriately for your system.

  • RATE
In the console, type "rate". The console will output:
Quote:
Max bytes/sec the host can receive data
This means that you should set the "rate" variable to the maximum number of bytes your computer can receive per second, or, more simply, your Internet connection's maximum download speed.

If you have a 1mbps download speed, that equals approximately 100,000 bytes per second, which would translate to "rate 100000".

You will need to adjust accordingly to suit your connection speed. You will also want to ensure you are actually getting the speed you're paying for, as many connections do not reach their advertised theoretical maximum speed. DSLReports.com has a nice toolset you can test with to determine your actual speed.

Justification: The in-game console documentation specifies that rate should be set as such. Rate is a capping variable, you will get choke if the amount of incoming data exceeds this value, and loss if your connection is not fast enough or stable enough to handle the specified value. Both are bad, so proper rate flagging is essential.

As of the last CS:S update, testing has shown that rate is now capped at 30000. A higher value will still stick within the client, though, so feel free to keep a higher value set if applicable to your connection speed, as the limit may be removed in the future.

  • CL_UPDATERATE
The in-game documentation shown in the console for cl_updaterate is:
Quote:
Number of packets per second of updates you are requesting from the server
Take your value for "rate" and divide it by 200, this is your connection speed based maximum value for cl_updaterate. If you have a 256Kbps connection download speed, or 25,600 bytes, then 25,600 / 200 = 128.

A server generates one packet, or "tic", per frame. If your calculated cl_updaterate value exceeds the servers tic rate, then cl_updaterate instead should be set the equal the servers tic rate. If the server is not actually reaching the advertised tic rate, then set cl_updaterate to the amount of actual packets being sent.

Justification: Valve has stated that 53.6Kbits per second, per player, of bandwidth usage on servers can be expected (Here.) On a 33 tic server, 53.6/33 would be around 1.6Kbits per packet, or roughly 200 bytes.

cl_updaterate shouldn't exceed the servers actual FPS rate. cl_interp_ratio Interpolation utilizes a timeline delay to make the client's 'view' smooth. If the interpolation delay runs out, then extrapolation occurs, which often results in a very inaccurate bullet registration, as the client is trying to guess correct player positions.

Server FPS will drop the actual packetrate to below the set ticrate. If your client is expecting a packet per tick, (i.e. cl_updaterate 100 on a 100 tick server,) and one doesn't arrive, you may expire your interpolation delay, and then extrapolation occurs, which causes stuttery gaming. The solution is to increase your interpolation delay by either setting cl_interp_ratio higher, or cl_updaterate lower to match the physical packet rate, which is the recommended choice for correct application, as your client will then no longer be expecting too many packets from the server, which causes choke.


  • CL_CMDRATE
cl_cmdrate is often one of the most important variables to consider to set correctly to ensure the most accurate possible hit registration!

For cl_cmdrate, you'll need to calculate your connection's upload speed. If you have 64Kbps upstream, or 6,00 bytes, divide the value by 200, which would equal 32.

Your average framerate is your second maximum limit for this value. So, set cl_cmdrate to the LOWER of either your bandwidth limit, or your average fps, OR an in game maximum of 100, if you're lucky enough to have an over 100 per-second framerate.

Justification: If you try to send more packets than your computer can generate, (as it will only make 1 packet per frame,) then you will get server side choke for your command packets, (such as your movements or firing). On the other hand, if your outbound connection can't take it, you'll get loss.

  • CL_INTERPOLATE, CL_INTERP_RATIO, & DEPRECATED CL_INTERP
Before the last CS:S update, it was often necessary to tweak cl_interpolate and/or cl_interp for proper hit registration. cl_interp, however, is now deprecated and is no longer used by Steam.

cl_interp_ratio replaces this old variable, and goes a long way to fix hitbox issues all across the board. Unless you're sure you're receiving the correct amount of incoming packets from the server with the correct cl_updaterate set, cl_interp and cl_interp_ratio are now best left at their default values to ensure optimal hitboxes.

  • Other Miscellaneous Variables
There are other lesser known variables, such as cl_smooth, cl_smoothtime, cl_lagcomp, cl_lagcomp_errorcheck, and others which have been discussed over time in various places. These are generally best left at their default values. Some have had bug issues in the past and have been resolved in later updates, others have been mis-explained and mis-applied and simply won't help improve hitbox registration. Again, I recommend leaving these variables at their defaults.

  • Questions, comments?
I'll be glad to help answer constructive questions in regards to ensuring you have the correct variables, or discussing any of the information at hand. Please make sure you've fully read all of the available material before asking questions which have already been outlined.

  • Closing Thoughts
I hope this guide helps people get the most out of their CS:S gaming experience, and clears up some misconceptions about Source netcode.

With a little patience and time, you can ensure your client is setup as best as possible, to deliver the best possible results in your gaming.

Good luck!
__________________

-- sR .:. silent.sentinel




contact:
--------
via aim - rolljester
via email - silentsentinel(at)straferight(dot)com
via icq - 699488
via xfire - silentsentinel
via yahoo - thesilentsentinel
Reply With Quote
  #2 (permalink)  
Old 03-01-2007, 03:24 PM
VincentVega's Avatar
Horrendiculous!
 
Join Date: Mar 2006
Location: S. Jerksey
Posts: 15,191
VincentVega No Hacks Involved Guys!VincentVega No Hacks Involved Guys!VincentVega No Hacks Involved Guys!VincentVega No Hacks Involved Guys!VincentVega No Hacks Involved Guys!VincentVega No Hacks Involved Guys!VincentVega No Hacks Involved Guys!VincentVega No Hacks Involved Guys!VincentVega No Hacks Involved Guys!VincentVega No Hacks Involved Guys!VincentVega No Hacks Involved Guys!
Send a message via AIM to VincentVega
holy long post, Batman. Excellent information. Thanks
__________________
Gaming Admin. PM VincentVega for assistance or post on forum.
Please keep thread posts relevant to the thread topic
Reply With Quote
  #3 (permalink)  
Old 03-01-2007, 03:28 PM
chode_messiah's Avatar
OVER THE LINE!
 
Join Date: Oct 2005
Location: Coruscant
Posts: 3,858
chode_messiah pwns more than FPS Doug!chode_messiah pwns more than FPS Doug!chode_messiah pwns more than FPS Doug!
Send a message via AIM to chode_messiah Send a message via MSN to chode_messiah
Nice post.
__________________



Reply With Quote
  #4 (permalink)  
Old 03-01-2007, 04:27 PM
Registered User
 
Join Date: Aug 2006
Posts: 1,282
knife rush ftw eats noobs for breakfast!knife rush ftw eats noobs for breakfast!
I tested out my connection speed with this:
Speakeasy - Speed Test

It says I have a download speed of 4924kbps. So, does that mean I should set my rate to 5042176?
( 4924 * 1024 ) = 5042176

That seems a bit high (and it says the cap is 30,000?).

Then that means the cl_updaterate should be 25211.
5042176 / 200 = 25210.88

That also seems really high.

My upload speed is 489kbps. So my cl_cmdrate should be 2504.
( 489 * 1024 ) / 200 = 2503.68
That also sounds too high. But it says I should use my average FPS, which is like 20.

So I should be using:
rate 5042176
cl_updaterate 25211
cl_cmdrate 20

Those first two numbers seem too high.
Reply With Quote
  #5 (permalink)  
Old 03-01-2007, 04:34 PM
silentsentinel's Avatar
Gentoo FT... FT... FTSomething!
 
Join Date: Jan 2007
Location: Virginia
Posts: 875
silentsentinel pwns without cheats!
Send a message via ICQ to silentsentinel Send a message via AIM to silentsentinel Send a message via Yahoo to silentsentinel
Quote:
Originally Posted by knife rush ftw View Post
I tested out my connection speed with this:
Speakeasy - Speed Test

It says I have a download speed of 4924kbps. So, does that mean I should set my rate to 5042176?
( 4924 * 1024 ) = 5042176

That seems a bit high (and it says the cap is 30,000?).

Then that means the cl_updaterate should be 25211.
5042176 / 200 = 25210.88

That also seems really high.

My upload speed is 489kbps. So my cl_cmdrate should be 2504.
( 489 * 1024 ) / 200 = 2503.68
That also sounds too high. But it says I should use my average FPS, which is like 20.

So I should be using:
rate 5042176
cl_updaterate 25211
cl_cmdrate 20

Those first two numbers seem too high.
knife rush: Those values are correct as far as bandwidth is concerned, but the server and client caps still apply, so given your data you'd most likely see the most benefit with:

rate 30,000 (Given the cap, a higher number will offer no performance increase. If there were no cap, you'd use the bandwidth-limited number minus a small portion to leave room for overhead.)

cl_updaterate won't see any benefit over 100, as the server won't be higher than 100 tic. Again, note that you'll see bad performance effects with it set too high on a server that can't hit 100 frames, too.

cl_cmdrate is correct, if you're only getting 20 frames per second. However, if you're only getting an average of 20FPS, you really need to lower some detail settings to try to get higher overall FPS. Your hit registration and overall score will certainly see an improvement, as you're not sending that many outbound packets with it set at 20. With it set too high though, you'll get choke, so you need to lower detail settings and then set it to your new average.
__________________

-- sR .:. silent.sentinel




contact:
--------
via aim - rolljester
via email - silentsentinel(at)straferight(dot)com
via icq - 699488
via xfire - silentsentinel
via yahoo - thesilentsentinel
Reply With Quote
  #6 (permalink)  
Old 03-01-2007, 04:37 PM
Registered User
 
Join Date: Aug 2006
Posts: 1,282
knife rush ftw eats noobs for breakfast!knife rush ftw eats noobs for breakfast!
ok cool, thanks. I'll give it a try.

btw, whats the tic of the SR servers? Is it 100?
Reply With Quote
  #7 (permalink)  
Old 03-01-2007, 04:41 PM
silentsentinel's Avatar
Gentoo FT... FT... FTSomething!
 
Join Date: Jan 2007
Location: Virginia
Posts: 875
silentsentinel pwns without cheats!
Send a message via ICQ to silentsentinel Send a message via AIM to silentsentinel Send a message via Yahoo to silentsentinel
Quote:
Originally Posted by knife rush ftw View Post
ok cool, thanks. I'll give it a try.

btw, whats the tic of the SR servers? Is it 100?
I believe most if not all of sR's are 66 tic servers.

As a side note, if you're playing on a random server and aren't sure whether or not it's hitting advertised frames, check net_graph 3's inbound packets, (outlined above.) This will give you the servers current actual frames so you can appropriately set cl_updaterate.
__________________

-- sR .:. silent.sentinel




contact:
--------
via aim - rolljester
via email - silentsentinel(at)straferight(dot)com
via icq - 699488
via xfire - silentsentinel
via yahoo - thesilentsentinel
Reply With Quote
  #8 (permalink)  
Old 03-01-2007, 07:09 PM
basso4735's Avatar
Gangin' up on the Sun
 
Join Date: Nov 2005
Location: Umass
Posts: 6,131
gXboxLive Leaderboard: 69th
basso4735 pwns more than FPS Doug!basso4735 pwns more than FPS Doug!basso4735 pwns more than FPS Doug!basso4735 pwns more than FPS Doug!basso4735 pwns more than FPS Doug!basso4735 pwns more than FPS Doug!basso4735 pwns more than FPS Doug!basso4735 pwns more than FPS Doug!
office and d2 are 66 tic, assault is 33.
__________________
You're fucking up my cheese
Reply With Quote
  #9 (permalink)  
Old 03-01-2007, 07:12 PM
Tyrant's Avatar
Sparty
 
Join Date: Jun 2005
Location: Michigan
Posts: 4,373
Tyrant pwns more than FPS Doug!Tyrant pwns more than FPS Doug!Tyrant pwns more than FPS Doug!Tyrant pwns more than FPS Doug!Tyrant pwns more than FPS Doug!Tyrant pwns more than FPS Doug!
Send a message via AIM to Tyrant
We change the tic rates from time to time on different game servers to try to balance the load on our server box, but the tic rates are currently at:

Assault = 33
Dust2 = 66
Gun Game = 33
Office = 66
No AWP Office = 66


And my rates are always the same:

cl_cmdrate 100
cl_updaterate 100
rate 25000
Reply With Quote
  #10 (permalink)  
Old 03-05-2007, 05:21 PM
Craig's Avatar
m00tini!
 
Join Date: Nov 2003
Location: Some Hotel Somewhere
Posts: 16,865
gXboxLive Leaderboard: 78th
Craig is Pro.Craig is Pro.Craig is Pro.Craig is Pro.Craig is Pro.Craig is Pro.Craig is Pro.Craig is Pro.Craig is Pro.Craig is Pro.
Send a message via ICQ to Craig Send a message via AIM to Craig Send a message via Yahoo to Craig
amazing information...stuck!
__________________

Contact Info »
PM » Steam ID » XFire » Ventrilo » Twitter
Reply With Quote
Reply

Thread Tools


LinkBacks (?)
LinkBack to this Thread: http://www.straferight.com/forums/counter-strike-source-tech-support/170997-netcode-rates-guide.html
Posted By For Type Date
StrafeRight Forums - StrafeRight Office Tourney #7 This thread Refback 01-19-2008 08:33 PM

Similar Threads
Thread Thread Starter Forum Replies Last Post
Fix my rates? LaGrange Counter-Strike: Source 8 02-22-2008 07:34 PM
Frame Rates In CS:S smergle Counter-Strike: Source Tech Support 47 06-13-2006 10:36 AM
question about rates Senses Counter-Strike: Source 34 04-30-2006 07:04 PM
Help with CS:S frame rates.. CocaColaTheory Counter-Strike: Source Tech Support 12 08-16-2005 05:04 PM

Xecuter 3 Mod Chip | Loans | Debt Help | Libros de historia | Remortgages