Thursday, July 7, 2011

Netcode revisted

After my last netcode post, and in light of the "new" TF2, I've got to expand on some things I talked about in this post.

First: The LERP is a good indicator of how well your computer is talking to the server. Orange and yellow values are fine; yellow means that the server is not keeping up with your computer for whatever reason (your connection is bad, or the server can't support the load of the players connected to it). I had previously thought that this was an absolutely bad sign--if the connection can't take it at "good" settings, then you're screwed.

BUT:  I've since learned that if you tune down your network settings (decreasing rate, cl_updaterate, and cl_cmdrate), you can "sync" your computer better to the server. If you're dropping packets, or the server has a lot of choke, decreasing the amount/quality of the communication between your computer and the server can alleviate your woes. Sure, it's not a perfect fix, but having a little bit of lag is much better than having packets drop left and right. TF2 is pretty bad in some ways about prediction (see: facestabs, meatshots that do zero damage) but it has its upsides: when your settings don't force the game to attempt constant communication, it can predict pretty darn well.

When you've got a good connection to a good server, try these settings:

cl_cmdrate "66"
cl_interp "0.016" // Change to 0.024 for hitscan
cl_interp_ratio "1"
cl_lagcompensation "1"
cl_pred_optimize "2"
cl_smooth "0"
cl_smoothtime "0.01"
cl_updaterate "66"
rate "60000"
When the connection is bad, for any reason, try these:
cl_cmdrate "40"
cl_interp "0.025" // Change to 0.0375 for hitscan
cl_interp_ratio "1"
cl_lagcompensation "1"
cl_pred_optimize "2"
cl_smooth "0"
cl_smoothtime "0.01"
cl_updaterate "40"
rate "35000"
Second: TF2 servers do not run the same way after the "Free" update. Whereas before, Valve had an eye on server quality, they've switched over to trying to get as many servers into the fray as possible. It's complex, but try to imagine this: A server is an instance of TF2 that runs for all the players connected to it. Based on how well the server can run the game, the players have a different experience. A server that can run the game at 100 FPS is going to be better than one running it at 30FPS (this is a gross oversimplification, and this explanation is misleading, but it works for my purposes of explanation). 

Before the free update, servers could run at a maximum of 1000FPS. However, now they are all capped at 500 FPS. This means that they can't support heavy loads as well, and those of you playing on crowded servers (especially 32 man) will see significantly more lag. The TF2 team is working on making servers more performance-oriented, but it's going to take some time.

If you want info like this about the server FPS, it's worth your while to subscribe to the HLDS mailing list here.

1 comment:

Let me know what you thought about this article! Your feedback helps me write more helpful articles!