In the Forums...
Posted: June 10, 2000
Written by: Ryan "Xero" Martinez
Tweaking the New Netcode (Server)
You've read the previous bit describing how the new netcode works, and now you're ready to tweak it. We're going to start with the server-side commands first. These should be entered into the console, and only affect the game if it's the server.
This CVAR turns on/off Valve's lag compensation. We suggest that you leave this on. It helps most people, and those it doesn't can turn it off individually (see Client-side Tweaks below). 1 for on, 0 for off, this defaults to on.
This controls the maximum amount of time (in seconds) that the netcode attempts to compensate for someone's ping. When set to 1, it will account for 1000ms, or 1 full second. When set to 0.4, it would account for 400ms. You don't want to set this any higher than 0.55, because if a person with a high ping hits someone, the hit will catch up so late that the game's fun factor begins to drop. I don't recommend setting it below 0.35 however. This defaults to 0.5, or 500ms.
This determines how many of the client-sent packets are averaged to find the ping time to compensate for. This defaults to one, meaning it only takes the most recent packet and uses only that value. Setting it to 2 would take the 2 most recent packets and average them, 3 would take 3, and so on. This is best left set to 1 or 2, and it defaults to 1.
Tweaking the new Netcode (Client)
So you understand how the server is compensating for your lag now, and... what's that? You don't like it? Well never fear, you can turn it off for just yourself while others who play better with it can leave it on. Valve has included many options for you to setup the netcode how you play best. Let's get started.
cl_lc X - This tells the server you're playing on whether or not you want lag compensation. If you find that lag compensation sucks for you, setting this to 0 will get rid of it for you, allowing you to play by your latency. This defaults to 1.
cl_lw X - This controls whether the weapon animations/sounds are played client-side. If this is enabled (cl_lw 1), then the sounds and animations are played client-side, the instant you fire the gun (instead of waiting for the server to confirm it). There are disadvantages and advantages to this.
If left off (cl_lw 0), you'll see the gun firing as your lag allows, which also means you'll see the gun fire in sync with the hits. The problem with this is that if lag compensation is on, you'll have no bullet marks to adjust your aim by until it's way too late. This can work against you with random-trajectory weapons, such as Counter-Strike's AK-47.
The problem with turning it on is that your machine has to generate the random kick and inaccuracy. As a result, the bullet marks/kick being shown will likely not line up with the ones the server is randomly generating. If you're shooting a highly inaccurate weapon (once again using CS's AK-47 as an example), bullets that seem to hit might not really hit, and bullets that don't seem to hit might end up hitting anyways.
We recommend that you leave this on if you're playing with lag compensation. If you aren't, then turn it off. This defaults to 1 (on).
cl_lb X - This CVAR turns on/off blood prediction if client-side weapon-prediction is enabled. If you're playing a game with weapons that don't have much random kick, you may want to enable this, but I highly recommend disabling it in a game with any amount of random kick/accuracy. Keeping it disabled in these games will allow you to see when you've scored a true hit. This defaults to 0 (off).