Team Fortress 2

Team Fortress 2

Not enough ratings
ELK's Hitreg Fix
By ELK
A guide for perfect hitreg and why your're likely using the worst settings.
   
Award
Favorite
Favorited
Unfavorite
TL;DR
If you have a great computer and internet connection and do not wish to read this guide then use these aggressive settings tuned for you.
cl_updaterate 66
cl_cmdrate 66
cl_interp 0
cl_interp_ratio 1.2*
rate 1048576**
cl_smooth 0

*Increase this value until the orange bars in the blue area at the bottom of net_graph 4 never go above the white line
**if your internet is not 10mbit+ (1.25mbyte/s when downloading) then you should set rate to 80% of your bandwidth to avoid packet offholds




TL;DR Explaination:
Almost all internet is fast enough to handle these settings
cl_updaterate 66
cl_cmdrate 66
rate 1048576

Ping is not a constant it is a variable that changes. You must increase your interpolation to compensate for this and so that the orange bars in the blue area on the bottom of net_graph [3,4] never go above the white line or hit reg will be bad and your perfect headshots will not count. This is because tf2 is resorting to extrapolation instead of interpolation.
cl_interp_ratio 1.2

Unlike the interpolation algorithm the smoothing algorithm is client-side only and may place your opponenet in a location that is not true to the data in the server's buffers thus hit reg will be bad and your perfect headshots will not count.
cl_smooth 0
Interpolation: The Most Important Thing
The History
In the late 90s and early 2000s internet was very slow. Dail-up was common. Video games could be played at 60fps+ but we did not have enough bandwidth to download a player's position 60 times a second. The position could be sent less often, maybe 20 times a second, but that made the target too choppy and hard to aim at. A fix was quickly found. If vector data was sent too then the client can exterpolate their opponents position every frame. Exterpolating is very simple. If the opponent is walking forward in a direction, then he keeps walking forward in that direction until the next update is recieved. This is what quakewolrd uses. Quakeworld is the FIRST online first person shooter.

Extrapolation's Problem
What if your opponent had not continued walking forward in that direction inbetween the updates you recieve? Things get ugly. Smoothing can fix this but I'm not going to explain smoothing in this guide because smoothing negatively affects tf2 hitreg and should be disabled. You have probably seen smoothing before and call it rubberbanding.

Interpolation Fixed extrapolation's problem.
Interpolation is quite simple too. When you download your opponents position instead of instantly showing it, it is stored in a buffer. The buffer is a set duration, maybe 100ms, but atleast long enough to contain 2 of your oppenents positions. Now when you run into that ugly problem, but what if my opponent changed directions inbetween updates? Well your computer already knows your opponent changed directions inbetween updates and draws everything perfectly smooth. The cool thing about tf2 is that the server uses the same interpolation algorithm as your computer, knows how long your buffer is, and also everybody's ping that exact update meaning if you shoot somebody in the head on your screen the server knows that you did. 100% perfect hitreg. loss, choke, and other performance problems can affect this.
smoothing
The smoothing algorithm isn't ran on the server because it can not know what predicition errors have happened on your end. To put this simple, smoothing changes the position of your opponent on your screen which may not line up with the server's position of that player. To put it even more simple, you might perfectly land a headshot and it will not count.

The most common mistake: cl_interp_ratio 1
The downfall to this buffer is lag. If your buffer is set to 100ms and your ping is 50ms then you will not see your opponent come around the corner for 150ms versus 50ms. Because of this people set their interpolation buffer as short as possible to still contain 2 of your opponents positions. Before I go on let me explain how the length of your interpolation buffer is calculated. It looks at 2 numbers and chooses whichever value is higher. The first number is the value of cl_interp. The second number is cl_interp_ratio divided by cl_updaterate. You will commonly see these settings
cl_updaterate 66;
cl_interp 0;
cl_interp_ratio 1 <--- DO NOT USE
Since cl_interp is 0 it will choose the higher value of cl_interp_ratio 1 divded by cl_updaterate 66, or 1/66 which is 0.01515... seconds, which is about 15.2ms.

This sounds good on paper. All the benefit of interpolation with the minimum amount of lag. WRONG. Your ping does not stay microsecond(0.001ms) accurate with the server. If your ping increases from 10ms to 10.001ms then your buffer will not contain your opponents second position and tf2 will revert to extrapolation. To put it simple, you might perfectly land a headshot and it will not count. Your buffer needs to be increased to compensate for this jitter. A very agressive setting tuned for a great pc on great internet connection would be cl_interp_ratio 1.2
Perfectly Tuning Network Settings for your Computer&Network
TL;DR
rate [80% of your bandwidth in byte/s]
cl_updaterate 66
cl_cmdrate 66
cl_smooth 0
cl_interp 0 [adjust to minimum for jitter, and area 9 of the network graph]
cl_interp_ratio [adjust to minimum for jitter, and area 9 of the network graph]


Luckily we have the best tool in the world to perfectly tune our network settings, the network graph! To enable the network graph enter "net_graph 4" into the console. I will be referring to the network graph a lot and numbered areas in the network graph. To know what numbered area I'm talking about please visit this page:
https://developer.valvesoftware.com/wiki/TF2_Network_Graph

cl_interp_ratio
This is the most important network setting to tweak. TF2 looks at 2 numbers and chooses whichever value is higher. The first number is the value of cl_interp. The second number is cl_interp_ratio divided by cl_updaterate. This leaves you 2 options to tweak the duration of your interpolation buffer.
A. Set cl_interp to 0 and raise cl_interp_ratio above 1 [for example 1.2, 1.4, 1.5, 2.2, etc]
B. Set cl_interp_ratio to 1 raise cl_interp [for exmaple 18, 19, 20, 30, etc]
If you choose option A the duration of your interpolation buffer can be seen in area 6 of the network graph as "lerp:"
At the very bottom of your network graph (area 9) there is a blue area with orange bars. Every time these bars raise over the white line you lose hitreg because you are extrapolating instead of interpolating and your opponent does not line up with the server. Keep increase the duration of your interpolation buffer using option A or B until the orange bars never go above the white bar. Don't fine tune it too much. It's best that it has some room to work. Keep in mind you are only adding a few milliseconds of lag which is negligable compared to the benefits of interpolation.

cl_updaterate
Almost all the internet across the globe is fast enough to handle an updaterate of 66.

cl_cmdrate
Almost all the internet across the glove is fast enough to hand a command rate of 66. This also affects your mic quality. So if you're gonna use your mic or especially spam music please use a command rate of 66.

cl_smooth
smoothing negativetly affects hit reg.

Rate
Rate is probably one of the most simple settings, but also more important than you might think. It is a bandwidth limit in byte/s. If you enter "rate 100000" into the console your bandwith will be limited to ~100kbyte/s. The best setting for rate is 80% of your bandwidth. If your internet connection is 10mbit/s or faster (NOT BYTE) then you should set your rate to 8mbit/s (NOT BYTE). 8mbit/s is 1mbyte/s (back to bytes now) which is 1048576byte/s. 1048576byte/s is the maximum bandwidth limit allowed in tf2. To put this simple, if you download steam games faster than 1.25mbyte/s then enter "rate 1048576" into the console because it is the best setting for you. If your internet is not this fast then multiply your bandwidth by 80% and convert it to byte/s. Use this value for your rate. I'm not going to explain your ISP's networking, but setting your rate above your bandwidth will cause you to lose multiple packets instead of just one.
rate in depth
This information is not important. I included it for anybody curious or wanting to learn more. To figure out our maximum update size we will calculate rate divided by cl_updaterate. Let's assume we are using rate 66000 and cl_updaterate 66. The calculation would calculate 1000. Area 2 of the network graph shows you the size of the updates you are downloading in bytes. If I recieve an update larger than 1000 bytes than I have exceeded my bandwidth limit. cl_updaterate is confusing because nothing is actually done in "times per second." everything is done in milliseconds. Setting your cl_updaterate to 66 let's the server know to wait 15.1515... milliseconds to send you your next update. Servers actually update every 15ms so their true updaterate is 66.666... I have no idea why value choose to use "times per second." If I recieve an update that was 1001bytes it would wait ~15.1516ms before sending me the next update. Essentially a microsecond later. A larger update like 1200bytes would come about 3ms later.
5 Comments
what a waste Feb 11, 2021 @ 8:03am 
what. and thank tho
<3
sobranie turquoise Mar 18, 2020 @ 3:54am 
Please spam comments on my steam profile. im trying to collect comments ty
Bashie Mar 15, 2020 @ 8:01am 
<33
Grits Jun 2, 2019 @ 6:38am 
Thank you! :steamhappy:
FroggyFace Feb 6, 2019 @ 2:10am 
I really appreciate your dedication into making this