Half-Life v1.1 Tweak Guide
Posted: June 10, 2000
Written by: Ryan "Xero" Martinez
Introduction
Recently, Valve released the 1.1.0.0 patch for Half-Life, and contained therein was brand new netcode and many engine changes. With these new changes came many new CVARs and commands that could be tweaked, and so your favorite (haha) Tweak Minion, xero, set out on a 5-year journey to boldly... uhh no wait, I set out to find the tweakable stuff & show Half-Life who's boss! This guide is the result, and I hope you all find it enjoyable. If you have any suggestions and so on, feel free to e-mail me. I'd also like to thank Yahn Bernier of Valve Software for his help with this guide.
Command Line Options
Half-Life has some command line options that allow you to tweak up the game a bit. These command line options can be entered in the game's shortcut command line. To reach the game's command line, just right-click on your Half-Life shortcut and click properties to bring up this box.
In the command line, you can enter the following options to enable/change certain options:
-console
This one is one that everyone should have in their command line. Besides disabling the annoying intro movies, it allows you to access the console from the main menu and from in single player mode. After enabling this, you can open the console in-game using the ~ key.
-32bpp
This option is used to enable 32-bit color in Half-Life. If you have a good video card or run in high resolutions, this will allow you to make the most of your excellent hardware. Note however that 32-bit color can be significantly slower than 16-bit color. With lots of transparencies on your screen (the smoke grenade from Counter-Strike 6.5 being a perfect example), having 32-bit color will multiply the slowdown caused. We recommend 16-bit for resolutions 1024x768 and above when seriously gaming.
-numericping
This option allows you to see actual ping times to servers instead of stupid dot ratings in the Half-Life server browser. Even if you use other game browsers, it's still informative, and doesn't have any drawbacks.
-nojoy
This disables joystick support in the Half-Life engine. It shaves a little bit off the memory footprint of Half-Life, so add this if you don't use a joystick.
-noipx
This disabled IPX support in the Half-Life engine, and like nojoy, it reduces memory use slightly. If you don't use IPX in your network, add this to your command line.
-heapsize XXXXX
Where XXXXX is, you can place a number, and Half-Life will allocate that much memory (in kilobytes) for use with the game. While many recommend setting this anywhere from 75 to 100% of your system memory, I have generally noticed performance seems much better when Half-Life does its own memory management. I leave this in the guide for you to experiment with however.
Command Line Options (cont.)
-game XXXXX
This option can be used to specify a mod folder for Half-Life to load whenever it is started. -game cstrike for Counter-Strike, -game firearms for Firearms, or -game tfc for TFC. This can save you some time if you only play one of Half-Life's mods.
+XXXXX
This nifty trick allows you to issue console commands right in the shortcut command line for Half-Life. This can have dozens of uses. For example, you could add +connect zzz.zzz.zzz.zzz:27015 (where zzz... is a server's IP address), and that shortcut would now connect to whatever server you told it to (it's great for making direct shortcuts to your favorite servers!). Here are some other ideas - +exec mysettings.cfg would exec your custom .cfg file whenever Half-Life was started, +net_graph 1 would turn the netgraph on for you. As you can see, this command line option can be very useful.
The New Netcode
One of the biggest changes in the netcode is the fact that client framerates are no longer dependent on network updates. The older netcode requested a network update for every frame rendered, leaving modem users with low-end framerates on high-end machines. Even people on the best broadband couldn't get perfect connections and 72fps at the same time. With the new netcode however, server updates, client updates, and framerates are all completely independent of each other. 100 beautiful frames per second are now possible on your modem connection.
But that's just one of the improvements... Valve has also programmed in lag compensation for aiming, allowing for LAN-like play on even 33.6 modems! The effect is very similar to client-side hitscan, but it's completely server side, meaning the netcode is just as secure as any average FPS game's netcode.
On top of all these things, Valve has reduced bandwidth and made huge strides in the efficiency of the code. Modem users can now expect to be able to take on much larger games with more opponents onscreen with less lag. And most important of all, Valve made the netcode highly tweakable.
How It Works
I know what many of you are wondering... how is Valve compensating for lag? Well it's quite simple and elegant: let's say a modem user with a 200 ping shoots at an enemy. The server receives that packet saying he shot, and checks the players ping, which is 200. It then checks to see if the enemy was where he shot 200ms ago; if he was, the hit is counted. If he wasn't, the hit isn't counted.
Now this does have some disadvantages. First, and most noticeably, sometimes bullets seem to curve around corners as they hit you, because it takes a while for the hit (which actually happened a little while ago) to catch up with you. This can be somewhat annoying, but similar problems happen due to client-side movement prediction to begin with. The other disadvantage is that when you shoot someone, the actual hit happens a bit later than if you were on a LAN. If an enemy were to kill you before your shot gets to the server, then you lose anyways. In this manner, low-pingers still hold an advantage. Whether these problems are worth the ability to aim like you're on a LAN is up to you.
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.
sv_unlag X
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.
sv_maxunlag X.XX
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.
sv_unlagsamples X
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).
Tweaking the New Netcode (Client, cont.)
cl_updaterate XX - This CVAR controls the number of network updates it requests per second from the server. It's similar to the "snaps" setting in Quake3, which the exception that you don't have to set it to divisors of 40 for optimal results. It defaults to 20.
People with broadband connections might want to set this to 30-40, but in larger games, 25 or less is recommended. Modem users should find the best mix of bandwidth usage/smoothness at 20, but if you are joining large games with a 33.6 or worse connection, setting this to 15 will cut your bandwidth use enough to keep you in the game. For those of you gaming on a LAN, 50 is an optimal setting.
Just to note, choppiness of average player movement is hard to notice until it's set below 13. The only times lower update rates become noticeable are when objects in game move very quickly (for example, a rocket flying towards your face).
cl_cmdrate XX - This CVAR is similar to cl_updaterate, but instead of updates from the server, this controls updates to the server. The separation of these two allows you to adjust them individually for your up/downstream bandwidth. This defaults to 30.
Due to the fact that your outgoing bandwidth doesn't change as much as your incoming bandwidth in large games, modem users can get away with keeping this CVAR set to 30. Broadband users will want this set to 40-50. 50 for LAN gamers.
fps_max XXX - This is the new all-in-one framerate limiter CVAR for the new Half-Life. This affects LAN, Internet and Single player play modes. Due to the fact that setting this high will no longer create lag, I'd suggest that users set this to its maximum value of 100.
This could be changed to a lower setting if the user wishes to reduce CPU load for some reason (such as running a dedicated server and client on the same machine).
rate XXXXX - This is an important setting. This CVAR controls how much data your connection will try to download at any given time from the server. We recommend:
14.4 Modem | Get a new modem :P |
28.8 Modem | 2500 to 3000 |
33.6 Modem | 2900 to 3900 |
56k Modem/1 Channel ISDN | 3600 to 5300 |
2 Channel ISDN | 5000 to 7000 |
Cable Modem | 5600 to 10000 |
xDSL, T1+ | 7500 to 20000 |
LAN (10MBps or 100MBps) | 20000 |
Unfortunately, many connections are rarely consistent enough to be able to download at a constant speed. As a result, you'll frequently find yourself adjusting this in game. These settings will give you a good general idea of common limitations, but don't be afraid to experiment in case your connection quality doesn't fit into "common limitations". :)
To find a setting that works well for you, keep an eye on your netgraph in the game. If your rate is set too high, you'll experience unstable ping and packet loss. If it's too low, your machine will begin dropping net updates to reduce bandwidth use. It's much better to err on the low side, so be conservative.
cl_allowupload X - Setting this to 0 stops your client from uploading any files to the server, such as your spray logo. This will keep other players from seeing it, and since it only lags you a little bit when you join the first time, leaving this enabled is probably fine. This is 1 by default.
Tweaking the New Netcode (Client, cont.)
cl_allowdownload X - This controls whether or not your computer will download any files (whether that be maps or logos) from the server. If the server changes to a map you don't have (which is common), you will be kicked off. Leaving this to 1 (the default) is highly recommended.
cl_download_ingame X - By setting this to 0, your client will not download new logos and so on as people join the server while you play. This can save you a lot of pain if you're a modem user with a poor connection. If logo downloading has ever caused you undue stress, disable this for wonderful relief. It will still download maps and extra files in between games as they are needed, however. 1 is the default.
Enabling & Reading the Netgraph
The netgraph (aka Lagometer for Q3 fans) in Half-Life has returned once again, retuned and refined to suit the new netcode. The netgraph can feed you useful information on your up/downstream bandwidth usage, ping, packetloss, framerate, network stability, and so on. To enable it, open your console, and type net_graph 1. This will enable a small display in the lower right corner of your screen telling you all sorts of info about your connection:
1. FPS Counter - Your current frame rate.
2. Network Latency - This is your current network latency. Unlike the Ping display on the game scoreboard, this readout does not count rendering & timing latencies into the number.
3. Your downstream bandwidth use.
4. Your upstream bandwidth use.
5. This is an animated graph displaying your ever-changing ping. The higher your ping, the thicker this graph gets. This also displays your lost packets in red.
6. Your current server update (incoming) rate.
7. Your current client update (outgoing) rate.
You can change the netgraph's position with the CVAR net_graphpos. Setting net_graphpos to 1, 2, or 3 will place the netgraph in the bottom right, center, or left section of the screen respectively. To change the width of the netgraph, use the CVAR net_graphwidth, which defaults to 192. You can change the graph's default height of 64 pixels by the CVAR graphheight.
Important Note: The new netgraph creates quite a drain on framerates. It's important that this be turned off when you're not testing your connection. If you prefer it turned on, decreasing its size can improve framerates drastically when it is on.
Other Client Tweaks
Custom.hpk
Custom.hpk is a file in your game directories (example: half-life/valve, half-life/cstrike, half-life/firearms, etc.). This file stores the spray decals of your various teammates and nefarious enemies. This file loads every time Half-Life loads into the game, and unfortunately, it never automatically empties itself of old, unused decals. As a result, if you frequent a lot of different servers with a lot of players, this file can quickly grow in size, anywhere from 5MB to 35MB+! As a result, load times in Half-Life can be slowed on even the fastest of machines. If you'd like to decrease your loading times, I suggest you delete this file (don't worry, Half-Life will make a fresh new one) about every one to two weeks. This will keep its size down and your load times faster.
Console CVAR Tweaks
Besides the netcode tweaks mentioned earlier, there are also numerous tweaks for the graphical engine and game itself. Many of these only make a tiny improvement on the framerate, so I'll try to stick to the ones that make a big enough difference to framerate or image quality to matter.
max_shells X - The max number of ejected ammo shells that can be seen at any one time. Once it hits this limit, the other ones begin to disappear (if they haven't already).
max_smokepuffs X - Just like max_shells, only this limits smokepuffs. (Duh :)
gl_texturemode - This tells the engine what process to use for texture filtering (Bilinear / Trilinear filtering). With most videocards, setting this to a higher quality value doesn't produce a lot of slow down, and the visual improvement is worth it.
GL_NEAREST_MIPMAP_LINEAR (Default)
GL_LINEAR_MIPMAP_LINEAR (High Quality)
This can be set to other values, but they look far worse, and don't improve framerates nearly enough to justify it.
gl_ztrick X - This option can be set to 1 or 0, and defaults to 0. This reduces the accuracy of the z-buffer, which can cause distant objects to flicker in and out and cause other depth-related inaccuracies. Its benefit is a reduction of memory bandwidth use. Most recent video cards (TNT1+) aren't taxing their memory bandwidth that much with Half-life, so it's not likely to help these cards at all. Older cards can see quite a nice boost however.
cl_himodels X - This turns on/off high quality models in the game, at the cost of polygon power. This improves models in TFC, HLDM, and many other mods drastically, but it tends to make Counter-Strike screwy. Leave it on 0 in CS, and try turning this to 1 for other games if you have the CPU power. 0 by default.
gl_polyoffset XX - This defaults to 4. This setting can cause decals (blast marks and so on) to flicker in and out of surfaces with some video cards. To fix this, you can try setting this to 20 to eliminate the flickering. Otherwise, leave it be.
con_color RRR GGG BBB - This nifty CVAR can be used to change the text color of your console text/in-game text. It works in an RGB method, so con_color 255 255 255 would change the text to white, for instance. con_color 31 72 127 would change it to Tweak3D blue. con_color 255 0 0 would change it to red. This one can be fun boys & girls. :)
Other Client Tweaks (cont.)
hud_fastswitch X - Turning this on changes the weapon switching method so that when you press the number for the weapon slot, it automatically picks it and brings it up, ready to fire. This is great for Counter-Strike, where Primary, Secondary, and Knife slots can only have one weapon. For any slot with more than one selection (for instance CS's grenade slot), it brings down the menu like normal. This is enabled by default in TFC, and disabled in Counter-Strike and HLDM.
hud_saytext_time XX - This is the amount of time, in seconds, that player chat messages stay on your screen before they scroll off. Setting this to 20 or so can make team communication much more effective, as you don't always have time to notice the messages as they come up. This defaults to 6.
hud_deathnotice_time XX - Similar to hud_saytext_time, this is the number of seconds that death notices stay on your screen. While this is normally 6, setting this higher can give you more time to notice the deaths of teammates or important enemies. This is very helpful in team games.
fastsprites X - This is a helpful tweak for Counter-Strike. Setting this to 1 decreases smoke grenade complexity, making it ugly, but much faster. 2 uses a different method which may be even faster depending on your machine. This defaults to 0, or off.
Bye Bye
Well, that's it for now, our dear readers. Don't forget to read through our other tweak guides so you can get your system working as fast as possible. If you liked/hated the guide, feel free to click here to email me.
Want to return to the normal guide? Click here!
All Content Copyright ©Dan Kennedy; 1998-2000