Tank
08-18-2008, 06:24 PM
Rates - a mystery revealed
Author: |B.A.M| The Tank and Synthetic
Difficulty: Average
!!!Warning!!!
If you start working on your rates, make sure your internet is completely dedicated to your day of defeat game. make sure programs like skype, teamspeak, ventrillo are off. Also any auto-updating program or browser. No media players which download music information from the internet!
Table of Contents
1. Introduction
2. What are rates
3. Net_graph
- 3.1 Setting net_graph on
- 3.2 Net_graph colours explaned
- 3.3 Different levels of net_graph
- 3.3.1 net_graph 3
- 3.3.2 net_graph 2 & 1
4. Config.cfg/userconfig.cfg and autoexec.cfg
5. Setting your rates straight
- 5.1 Basic settings
- 5.2 Changes of rates - 1
- 5.3 Changes of rates - 2
- 5.4 Changes of rates - 3
- 5.5 Improving registry with cl_updaterate
6. Ex_interp and cl_smoothtime
- 6.1 ex_interp
- 6.2 cl_smoothtime
7. Credits
1. Introduction
Rates, a true mystery in the Day of Defeat 1.3 community. All the information you may have read about rates is either incorrect or outdated. This tutorial is written by Synthetic and I and provides updated information on rates. Before I begin I would like to ask you to clear anything from your mind what you know about rates. Myths like "cl_cmdrate\cl_updaterate is maxed out at 101 because that's a LAN setting" are not true.
2. What are rates
With setting your rates straight you want to remove the difference between what you see and what the server sees. A small explanation on that;
If the server sees a player at position X, you want to see him also at X or as close as possible to X. Rates which are not set straight will show weird events which only you see, like "getting shot around the corner".
3. Net_graph
The Net_Graph tool that is built into the Half-Life Client is one of the best tools to understand and tweak your performance and game settings. It's also is a wonderful tool to help diagnose connection problems and distinguish if they are Network related, Client related or Server related.
3.1 Turning net_graph on
The net_graph options can be accessed through the console as I will try to explain here:
by typing the following in console:
net_graph 3
you enable the net_graph. To turn it off type: net_graph 0
3.2 Net_graph colours explaned
red: player specific data for you only
yellow: other player data
purple: other entity data
light blue: event data
dark blue: temporary entity data
green: sound data
gray: user defined message data
white dots at top: signifies packet size (only if net_graph is set to 2)
3.3 Different levels on net_graph
With net_graph 3 you enabled the net_graph but there are different levels of net_graph. The following chapters will show you the diffences in the net_graph levels.
3.3.1 net_graph 3
What we see here is net_graph 3. I will try to explain what it all means. I hope you will be able to follow it though as this is more then just basic knowledge about Day of Defeat. Net_graph 3 basically lets you see the numeric information about the performance of your computer and its net connection. The screenshots are taken from my own computer, therefore I will refer to the client - you, as "my computer".
From top to bottom
First line:
My computer is is rendering frames at 85.9 frames per second and my computer believes that it has a 78 millisecond round trip message time to the server (this is a latency reading, rather than a pure ping, since it includes processing overhead on both ends).
Second line:
The last packet my computer received ("in") from the server was 37 bytes long. The average data rate over the last second or so from the server has been 2.51 kilobytes/second.
Third line:
The last command issued by my computer was only 21 bytes long and my computer is generating 4.83 kilobytes/second of upstream data.
Fourth line:
At the moment my computer has no loss or choke. Loss is data that isn't making it to the server and choke is when the connection/server is receiving more data than it can handle.
http://social.clanservers.com/tutorials/rates/net_graph3.JPG
net_graph 3
3.3.2 net_graph 2 & net_graph 1
Again you see the information provided as in net_graph 3 only now we have a graph along with it. We will put our focus on net_graph 1. Net_graph 2 only gives you a rough estimation of the size of each packet your client is receiving from the server. The scale defaults to 5 bytes of data per pixel. You can change the size of the upper part by typing the following in console: net_scale xx (with xx standing for the number, the lower the number, the bigger and more stretched out the graph will look).
Now for net_graph 1, we will go deeper into this later as we set our rates straight.
http://social.clanservers.com/tutorials/rates/net_graph2.JPG
net_graph 2 and net_graph 1 (net_graph 1 doesn't have the graph above the text but needed to delete one picture since I can only post 4 images in one post.
4. Config.cfg/userconfig.cfg and autoexec.cfg
I won't go in-debt on this topic as I already created a tutorial for them over here:Will be added later on.
I will explain however how to set your rates and where. First you want to create the files if you don't have them (read the tutorial linked a few lines above to learn how to create those files).
Basically all the commands like the following:
net_graph 1
net_graphpos 2
net_graphwidth 150
cl_cmdrate 50
cl_updaterate 50
cl_rate 9999
go into your (user)config.cfg. The following commands can go into your autoexec.cfg (if you use config.cfg instead of userconfig.cfg) or your userconfig.cfg:
ex_interp 0
rate 20000
5. Setting your rates straight
5.1 Basic settings
You will need the following settings so you can clearly see everything:
net_graph:
net_graph 1
net_graphpos 2
net_graphwidth 150
rates
cl_cmdrate 50
cl_updaterate 50
ex_interp 0
cl_rate 9999
rate 20000
Ok, now you will see this in the middle bottom of your screen:
http://social.clanservers.com/tutorials/rates/net_graphwrong.JPG
net_graph 1, graphpos 2, net_graphwidth 150
What we are aiming in here in this picture are all the colours in this picture below the numbers. So the bottom graph (for an explanation about the colours in this graph, check "3.2 Net_graph colours explaned".
Set the following settings in your console to start with. This will be our basic setting in which we will start changing stuff (remember, if you have your config.cfg on read-only access or you us your userconfig.cfg you will have to set the final settings in your config file).
cl_cmdrate 50
cl_updaterate 50
ex_interp 0
cl_rate 9999
rate 20000
Setting and finetuning your rates can be a lenghty process but you will benifit so much from it that it's worth going through with it. Perhaps you get lucky and get your rates perfect at the first attempt.
!!!Remember!!!
That raising cl_cmdrate and cl_updaterate are not maxed out at 101!!!
5.2 Changes of rates - 1
Now open you console again and slowly start raising your cl_cmdrate with 5 or 10 by choise (to finetune your connection, the lower the increments, the better the rates are finetuned, it only takes longer) until the red dots at the bottom are gone. At first you will see that the line gets broken, go until you can't find any red, yellow or orange dots at the bottom anymore. (can't see right, make a screenshot and magnify that). If the red, orange and yellow dots are gone, then you can read on at "5.5 Improving registry with cl_updaterate". However if this didn't work, you should read on.
5.3 Changes of rates - 2
If you can't get rid of the red, yellow or orange dots then try it this way. Lower your cl_updaterate by 10, make sure your ex_interp is still set at 0. So see it like this:
cl_updaterate 50: raise cl_cmdrate
cl_updarerate 40: raise cl_cmdrate
cl_updarerate 30: raise cl_cmdrate
...
If this works, read on at "5.5 Improving registry with cl_updaterate". However, if this still didn't work, then keep reading on.
5.4 Changes of rates - 3
Make sure you still have the basic settings set. Now lower your rate with a 1000 to start with. So rate is now set on 19000, now try the changes at "5.3 Changes of rates - 2". If this didn't work then keep changing the rate by a 1000 while doing the changes decribed at chapter 5.3.
5.5 Improving registry with cl_updaterate
The red, orange and yellow dots are now gone. You will have a graph like the following:
http://social.clanservers.com/tutorials/rates/netgraph.gif
A net_graph with perfectly set rates,this is how it should look like
You will still have to set your registry straight. This is done by cl_updaterate. This is basically not measureable and should be done on "feeling". Start playing the game and while playing really notice on the shots you are making. If you have the feeling registry is off, raise your cl_updaterate with 10. Keep continueing doing that until you are satisfied with your registry.
6. Ex_interp and cl_smoothtime
6.1 ex_interp
Ex_interp allows the hitboxes to be in phase with the servers, making the models seem to "skip" around, but showing the client a more accurate demonstration of the real models location in the server. In other words the models are in the right spot for registration, with your ex_interp set too high the hitboxes can be behind the model.
What you want is as less interpolaration as possible, with ex_interp 0.001 you can "force" it as low as possible, with ex_interp 0 you let the client set the best ex_interp for you.
6.2 cl_smoothtime
I think Valve said it best when they said:
Valve writes that "corrections of prediction errors can be quite noticeable and will cause your view to jump a bit. To visually smooth that effect, the prediction error is corrected gradually over a short amount of time ( cl_smoothtime )." If cl_smoothtime is set to 0(or cl_nosmooth to 1), the interpolation won't be "smoothed" or "corrected" and the actual position of the player player models will be shown. Note that a setting of 0 this will cause "jerking" of the player models, however the position of the models will be correct.
7. Credits
In these credits I would like to thank Synthetic from Weak-Sauce for all his knowledge and insight on this huge problem in the Day of Defeat 1.3 community. He is the first who taught me exactly how the rates work nowadays as all the information I gathered through the years was outdated stuff. If you see him around the community and you set your connection straight with the help of this tutorial, then thank him.
Author: |B.A.M| The Tank and Synthetic
Difficulty: Average
!!!Warning!!!
If you start working on your rates, make sure your internet is completely dedicated to your day of defeat game. make sure programs like skype, teamspeak, ventrillo are off. Also any auto-updating program or browser. No media players which download music information from the internet!
Table of Contents
1. Introduction
2. What are rates
3. Net_graph
- 3.1 Setting net_graph on
- 3.2 Net_graph colours explaned
- 3.3 Different levels of net_graph
- 3.3.1 net_graph 3
- 3.3.2 net_graph 2 & 1
4. Config.cfg/userconfig.cfg and autoexec.cfg
5. Setting your rates straight
- 5.1 Basic settings
- 5.2 Changes of rates - 1
- 5.3 Changes of rates - 2
- 5.4 Changes of rates - 3
- 5.5 Improving registry with cl_updaterate
6. Ex_interp and cl_smoothtime
- 6.1 ex_interp
- 6.2 cl_smoothtime
7. Credits
1. Introduction
Rates, a true mystery in the Day of Defeat 1.3 community. All the information you may have read about rates is either incorrect or outdated. This tutorial is written by Synthetic and I and provides updated information on rates. Before I begin I would like to ask you to clear anything from your mind what you know about rates. Myths like "cl_cmdrate\cl_updaterate is maxed out at 101 because that's a LAN setting" are not true.
2. What are rates
With setting your rates straight you want to remove the difference between what you see and what the server sees. A small explanation on that;
If the server sees a player at position X, you want to see him also at X or as close as possible to X. Rates which are not set straight will show weird events which only you see, like "getting shot around the corner".
3. Net_graph
The Net_Graph tool that is built into the Half-Life Client is one of the best tools to understand and tweak your performance and game settings. It's also is a wonderful tool to help diagnose connection problems and distinguish if they are Network related, Client related or Server related.
3.1 Turning net_graph on
The net_graph options can be accessed through the console as I will try to explain here:
by typing the following in console:
net_graph 3
you enable the net_graph. To turn it off type: net_graph 0
3.2 Net_graph colours explaned
red: player specific data for you only
yellow: other player data
purple: other entity data
light blue: event data
dark blue: temporary entity data
green: sound data
gray: user defined message data
white dots at top: signifies packet size (only if net_graph is set to 2)
3.3 Different levels on net_graph
With net_graph 3 you enabled the net_graph but there are different levels of net_graph. The following chapters will show you the diffences in the net_graph levels.
3.3.1 net_graph 3
What we see here is net_graph 3. I will try to explain what it all means. I hope you will be able to follow it though as this is more then just basic knowledge about Day of Defeat. Net_graph 3 basically lets you see the numeric information about the performance of your computer and its net connection. The screenshots are taken from my own computer, therefore I will refer to the client - you, as "my computer".
From top to bottom
First line:
My computer is is rendering frames at 85.9 frames per second and my computer believes that it has a 78 millisecond round trip message time to the server (this is a latency reading, rather than a pure ping, since it includes processing overhead on both ends).
Second line:
The last packet my computer received ("in") from the server was 37 bytes long. The average data rate over the last second or so from the server has been 2.51 kilobytes/second.
Third line:
The last command issued by my computer was only 21 bytes long and my computer is generating 4.83 kilobytes/second of upstream data.
Fourth line:
At the moment my computer has no loss or choke. Loss is data that isn't making it to the server and choke is when the connection/server is receiving more data than it can handle.
http://social.clanservers.com/tutorials/rates/net_graph3.JPG
net_graph 3
3.3.2 net_graph 2 & net_graph 1
Again you see the information provided as in net_graph 3 only now we have a graph along with it. We will put our focus on net_graph 1. Net_graph 2 only gives you a rough estimation of the size of each packet your client is receiving from the server. The scale defaults to 5 bytes of data per pixel. You can change the size of the upper part by typing the following in console: net_scale xx (with xx standing for the number, the lower the number, the bigger and more stretched out the graph will look).
Now for net_graph 1, we will go deeper into this later as we set our rates straight.
http://social.clanservers.com/tutorials/rates/net_graph2.JPG
net_graph 2 and net_graph 1 (net_graph 1 doesn't have the graph above the text but needed to delete one picture since I can only post 4 images in one post.
4. Config.cfg/userconfig.cfg and autoexec.cfg
I won't go in-debt on this topic as I already created a tutorial for them over here:Will be added later on.
I will explain however how to set your rates and where. First you want to create the files if you don't have them (read the tutorial linked a few lines above to learn how to create those files).
Basically all the commands like the following:
net_graph 1
net_graphpos 2
net_graphwidth 150
cl_cmdrate 50
cl_updaterate 50
cl_rate 9999
go into your (user)config.cfg. The following commands can go into your autoexec.cfg (if you use config.cfg instead of userconfig.cfg) or your userconfig.cfg:
ex_interp 0
rate 20000
5. Setting your rates straight
5.1 Basic settings
You will need the following settings so you can clearly see everything:
net_graph:
net_graph 1
net_graphpos 2
net_graphwidth 150
rates
cl_cmdrate 50
cl_updaterate 50
ex_interp 0
cl_rate 9999
rate 20000
Ok, now you will see this in the middle bottom of your screen:
http://social.clanservers.com/tutorials/rates/net_graphwrong.JPG
net_graph 1, graphpos 2, net_graphwidth 150
What we are aiming in here in this picture are all the colours in this picture below the numbers. So the bottom graph (for an explanation about the colours in this graph, check "3.2 Net_graph colours explaned".
Set the following settings in your console to start with. This will be our basic setting in which we will start changing stuff (remember, if you have your config.cfg on read-only access or you us your userconfig.cfg you will have to set the final settings in your config file).
cl_cmdrate 50
cl_updaterate 50
ex_interp 0
cl_rate 9999
rate 20000
Setting and finetuning your rates can be a lenghty process but you will benifit so much from it that it's worth going through with it. Perhaps you get lucky and get your rates perfect at the first attempt.
!!!Remember!!!
That raising cl_cmdrate and cl_updaterate are not maxed out at 101!!!
5.2 Changes of rates - 1
Now open you console again and slowly start raising your cl_cmdrate with 5 or 10 by choise (to finetune your connection, the lower the increments, the better the rates are finetuned, it only takes longer) until the red dots at the bottom are gone. At first you will see that the line gets broken, go until you can't find any red, yellow or orange dots at the bottom anymore. (can't see right, make a screenshot and magnify that). If the red, orange and yellow dots are gone, then you can read on at "5.5 Improving registry with cl_updaterate". However if this didn't work, you should read on.
5.3 Changes of rates - 2
If you can't get rid of the red, yellow or orange dots then try it this way. Lower your cl_updaterate by 10, make sure your ex_interp is still set at 0. So see it like this:
cl_updaterate 50: raise cl_cmdrate
cl_updarerate 40: raise cl_cmdrate
cl_updarerate 30: raise cl_cmdrate
...
If this works, read on at "5.5 Improving registry with cl_updaterate". However, if this still didn't work, then keep reading on.
5.4 Changes of rates - 3
Make sure you still have the basic settings set. Now lower your rate with a 1000 to start with. So rate is now set on 19000, now try the changes at "5.3 Changes of rates - 2". If this didn't work then keep changing the rate by a 1000 while doing the changes decribed at chapter 5.3.
5.5 Improving registry with cl_updaterate
The red, orange and yellow dots are now gone. You will have a graph like the following:
http://social.clanservers.com/tutorials/rates/netgraph.gif
A net_graph with perfectly set rates,this is how it should look like
You will still have to set your registry straight. This is done by cl_updaterate. This is basically not measureable and should be done on "feeling". Start playing the game and while playing really notice on the shots you are making. If you have the feeling registry is off, raise your cl_updaterate with 10. Keep continueing doing that until you are satisfied with your registry.
6. Ex_interp and cl_smoothtime
6.1 ex_interp
Ex_interp allows the hitboxes to be in phase with the servers, making the models seem to "skip" around, but showing the client a more accurate demonstration of the real models location in the server. In other words the models are in the right spot for registration, with your ex_interp set too high the hitboxes can be behind the model.
What you want is as less interpolaration as possible, with ex_interp 0.001 you can "force" it as low as possible, with ex_interp 0 you let the client set the best ex_interp for you.
6.2 cl_smoothtime
I think Valve said it best when they said:
Valve writes that "corrections of prediction errors can be quite noticeable and will cause your view to jump a bit. To visually smooth that effect, the prediction error is corrected gradually over a short amount of time ( cl_smoothtime )." If cl_smoothtime is set to 0(or cl_nosmooth to 1), the interpolation won't be "smoothed" or "corrected" and the actual position of the player player models will be shown. Note that a setting of 0 this will cause "jerking" of the player models, however the position of the models will be correct.
7. Credits
In these credits I would like to thank Synthetic from Weak-Sauce for all his knowledge and insight on this huge problem in the Day of Defeat 1.3 community. He is the first who taught me exactly how the rates work nowadays as all the information I gathered through the years was outdated stuff. If you see him around the community and you set your connection straight with the help of this tutorial, then thank him.