Reducing Lag
posted by Rogan - last update on 16/12/2007 by feroxy
This tweaks page is opened by saying "lag", when you're in our CSS server. It's also available through our website at www.invisibledanger.co.uk.
Our server runs at a tickrate of 66 on a dedicated Athlon 3700+ Gentoo box with 1Gb of RAM. This means that the server, apart from the odd lapse, should give perfect bullet registration. If it isnt, then youre having a problem.
Mostly these problems are easily fixed, and below youll find a list of quick tweaks to improve your connection.
Enable the console. Hit Esc then click Options>keyboard>advanced and tick the Enable developer console box to enable it then hit tilde, the button under escape to open. Now you can enter the Cvars (client variables) below.
First, to make the game smoother, enter cl_smooth 0 into the console. Smoothing doesnt work in CSS if it works in any game it seems to slow your graphics down and make them flicker. It also doesnt seem to help your reg. I do admit some success in changing cl_smoothtime to 0.01 but I prefer just disabling it.
You need a readout to monitor the client (your computer) and server; use net_graph for this. Enter net_graph 3 into the console and lo and behold netgraph pops up on your screen. It shows FPS and ping, as well as some less obvious numbers.
Loss shows you how many packets (chunks of information) youre dropping. This should ALWAYS be zero. If not - make sure no ones using P2P, that you have no viruses, and that your router has a gaming mode - normal routers prioritise downloads and web pages over gaming data. If none of these work then run a connection checker - like the one at ADSL-Guide (http://www.adslguide.org.uk/tools/speedtest.asp) to see that your net connection isn't broken.
The two numbers on the far right hand side of net_graph, display incoming and outgoing data. These show how many updates (Cvar: cl_updaterate) youre receiving from the server and how many commands youre sending out (Cvar: cl_cmdrate). A fast system should display numbers equal to the servers tickrate (our server is 66), sending out and receiving 66 updates per second.
A standard installation of CSS will not do this. Your client will be preconfigured with standard settings of cl_cmdrate 20; cl_updaterate 30. Instead of communicating 66 time a second youre only receiving 30, and sending 20. Change both of these values to 66.
This will make the choke rise, which you can see in the bottom right of netgraph. This otherworldly value tends to flux wildly during fire fights, and is related to FPS and the amount of data that youre trying to shift. If you look at the two numbers in the middle of net_graph (the ones in Kb/s) you can see your current data throughputs. As these rise youll get choke because your computer is sending and receiving more data than it can process.
To fix this we recommend reducing the overall data throughput (Cvar: rate). Our server limits the maximum rate to 25000 and the minimum to 9999. We recommend a value of 25000 normally, but if youre getting choke you should reduce this. Try values of 20,000, 15,000 and 10,000 to see if you get any improvements.
If you dont then the choke is probably coming from low FPS at your end. On a dual core or hyper-threaded CPU theres a quick fix to increase FPS. You need to change the running priority of steam.exe so its lower than that of hl2.exe, and on hyper-threaded processors you must assign them both to the same CPU.
To do this: Hit Ctrl-Alt-Del and select the processes tab. Find Steam.exe, right click it and Set Priority to low, then click it again and set the Affinity to CPU 0 only (deselect CPU 1). Then find HL2.exe and assign to CPU 0 also. This stops Steam.exe stealing processor time from HL2.exe and can give you lots of extra FPS.
Beyond that, youre pretty much on your own. But to give yourself the same chance as the rest of us, make sure youve done the tasks in the following paragraph. Remember, Google (www.google.co.uk) is your friend.
Windows make sure V-Sync is disabled in the advanced 3D section of your graphics control panel. Make damn sure that mouse acceleration or enhanced precision is set to none or off in your mouse control panel. Download the latest drivers for your entire system Video motherboard chipset audio. Make sure your disk is defragmented by right clicking it in My Computer and selecting defragment.
