Fps problems
From Whisper's Wiki
FPS Problems/Game Crashes Guide v2.0 (Orange Box Edition)
Contents |
Foreword
This guide was created to be the one stop solution to all major FPS troubles in the Source Engine (Counter-Strike: Source, Team Fortress 2, etc), but serves as a basic guideline as to how to tweak your PC, make games run stable and better your FPS in most games that are available today. It is not the final word, but will get the majority of problem cases out of the way. Here, this assumes the following:
- Your PC runs the recommended hardware designed for the game.
- Minimal spec just means you can load the game, but doesn't mean it's very playable. What you do here won't help much and you have no right to complain about bad FPS on outdated hardware.
- Your PC can run a blend test with Prime 95 without any errors for at least 8 hours.
- (If using an Intel CPU) Your PC can run 100 passes of Linpack/IntelBurnTest with all 'Residual(norm)' values being the same.
- IntelBurnTest is far more accurate than P95 is and will detect even minor instability within half an hour, as opposed to ~48 hours with P95.
- Your PC can run MemTest86 without any errors.
- Any issues you encounter here are hardware related and you will have to google your error to try to find a solution. It is outside the purview of this guide.
- You have a basic understanding of how to use Windows in regards to copying, installing and renaming file extensions.
- You have the patience and will to fix your problem by reading everything that this guide has to say. Most people fail this by skim reading.
Everything here is use at your own risk. That's not to say that it will cause more problems than you already have, but this guide and its author will not be responsible for what you may break so your mileage may vary.
One last thing to mention here is that NO ONE has permission to reproduce this page. 'Snippets' may be used but only when linking to this page.
Now that we have all that out of the way, let's begin!
PC Updates
Having the most up to date drivers and such for your hardware is the number one reason games tend to perform unexpectedly. There are a few things you need to follow to help this.
Windows
Use the Windows Update feature to keep all the main files of the operating system up to date. This includes stability fixes, security releases and performance features. You can do this by visiting the Windows Update Website in Internet Explorer, not Firefox. For Windows XP, users should install Service Pack 3 as this will update everything from the day Windows was released up until the time SP3 was.
The next thing you should do is update DirectX via the Web Installer as it will grab the very latest DirectX content that Microsoft has made available. It doesn't matter if you think you've already got the latest version. Even on Windows 7 that has DirectX 11, games can still crash because they have dependencies that for some reason are only included in the latest web releases of DirectX 9.
Hardware
Download and run CPU-Z which is a freeware application that gathers information on the specifications of your hardware. You will have to go to the manufacturer of your Motherboard to find any updates (Software or BIOS) that you may need to install or 'flash'. If you do not know the make of your Graphics Card, then you will have to right click 'Properties' on the desktop, hit the 'Settings' tab and look what it says down at Display. It will say something similar to 'Plug and Play Monitor on NVIDIA GeForce 9800GTX' depending on who makes your Graphics Card (Nvidia in this case) and what model it is (GeForce 9800GTX here).
You can then grab the appropriate official driver off the website of whoever makes it (Typically ATI or Nvidia) or choose the most common 'Third Party Tweaked Driver' from the list below or of course choose one not on this list if you've had better experiences with that particular driver.
* = Authors recommendation based on past experience
- XTreme-G Drivers * [Nvidia only]
- Omega Drivers [Ati / Nvidia]
-
Z-Tweaked Drivers[Nvidia only] - X Treme-G Warcat Drivers [Ati only]
- NGO Drivers [Nvidia only]
- LaptopVideo2Go Drivers [Nvidia / Laptops only]
Once you have downloaded your chosen driver, you will first need to remove your current one. You can do this by downloading either Driver Cleaner Freeware, Driver Sweeper (Which works on Vista and Windows 7) or buying the full featured Driver Cleaner over at the Official Site.
These are tools that will allow you to remove parts of drivers that are left after uninstalling the old drivers when you remove them via the control panel. It is for ATI, nVidia, Ageia and more.
Install driver cleaner and follow these steps:
- Uninstall your existing graphics driver (Usually via control panel)
- Run Driver Cleaner, update if needed and then run using the appropriate filters
- Reboot your PC
- Install the new drivers you have just downloaded (Your screen resolution will be smaller on Windows XP, due to using the default poor quality drivers)
- Reboot when finished
By running Driver Cleaner each time before you install a new driver, you're ensuring that old parts won't get left behind by the uninstaller thus meaning that you have a 'fresh install' of your latest graphics driver without having any old parts cause conflicts with what you've just installed.
General Tweaking
Just like a game, there are many things within Windows that are enabled because some people want/need it, but doesn't mean that you in particular do. Here, we'll go through basic outlines in generally tweaking your PC for better performance.
Services
Tweaking services can yield one of the best performance gains in Windows on low end hardware, due to freeing up RAM that is normally allocated to services you might not even need to use.
This is an advanced section however so I only recommend that technically competent users attempt to do this as it can be easy to disable or screw up something that you need.
There are two variants to Black Vipers guides, one for Windows XP Service Pack 3 and one for Windows Vista Service Pack 1.
In theory it should give you a small performance gain since there is less load on the RAM and CPU, along with decreasing your boot time.
If you're a more technically savvy user, I suggest that you make the services tweaks more permanent by using nLite to slipstream Service Pack 3 for XP or Service Pack 1 for Vista (along with everything else you need) and tweak your services using that program so that next time you format, you won't have to go through the problem of having to retweak your services.
Clean Booting
When you start Windows, typically there are a number of programs that start automatically and run in the background that may interfere with the game at hand. These programs may include anti virus and system utility programs. When you perform a clean boot, you prevent these programs from starting automatically.
You must be logged on as an administrator or a member of the Administrators group to complete this procedure.
- 1. Click Start, and then click Run.
- 2. In the Open box, type msconfig, and then click OK.
- 3. On the General tab, click Selective Startup.
- 4. Under Selective Startup, click to clear the following check boxes:
- Process SYSTEM.INI File
- Process WIN.INI File
- Load Startup Items
- 5. On the Services tab, click to select the Hide All Microsoft Services check box, and then click Disable All.
- 6. Click OK, and then click Restart.
Note: To restore your normal boot sequence, re-open msconfig and place a check in the items you previously disabled.
CPU and Memory Usage
By using the Task Manager (Alt+Ctrl+Delete), you should know what applications that you use (Eg: MSN, Steam), how much CPU usage that they normally take.
The reason for this is because programs such as Anti Viruses and Firewalls that you get at a retail store (Mcafee, Norton) are resource hogs and that there are far better and free alternatives out there.
Here is a list of common low memory footprint applications:
- Application Killers: Appkill. This is a simple program that will detect a running program and launch/kill the appropriate applications.
- Anti Virus: Avast! Anti Virus. This is far more efficient than Mcafee and Norton and is free for the general user.
- Firewall: Sygate Personal Firewall. A free firewall that prompts the user to allow any application that needs internet access.
- Security Suite: Agnitum Outpost Security Suite. An excellent all in one software package that stops viruses/trojans/hooks from even being executed on your system with its Host Protection feature. A perfect premium solution for every single user.
- MSN/IRC: Trillian. An all in one messenger with next to no memory footprint.
- CPU Overclockers: CPUIdle. This is only needed for non 64bit based CPU's. It will decrease the temperature by 10 degrees and is standard in modern CPU's.
- Music Player: Foobar2000. A simple music player that one can control with global hotkeys and have running from the task tray.
- Media Player: VLC Media Player. A simple media player that already comes with the most commonly used codecs, eliminating the use for K-lite Mega Codec Pack.
- Startup Applications: Autoruns and Startup Delayer. Autoruns manages what starts up and Startup Delayer, delays the startup of applications of your choice.
- Startup Delayer is great for applications such as Steam where it takes a while to launch so delaying it by 2 seconds can reduce the impact of having every application launch at once.
- Network Optimising Applications: TCP Optimiser. While it doesn't actually help get better FPS, it can potentially make your internet connection a whole lot better, which in turn gets better hit registration while playing.
There are many other applications that are no doubt worthwhile of adding here, so feel free to do so.
Defragmentation
Over the course of time, Windows gets cluttered with all the files that you've moved around, installed, uninstalled and so on to the point where it affects the reading time of the hard drive. To combat this, Windows comes with an inbuilt disk defrag tool that is typically found at Start -> Programs -> Accessories -> System Tools -> Disk Defragmenter.
You can also use powerful premium and more efficient tools such as Diskeeper, but you're required to pay for the use of this.
There are also very nice freeware / OSS defragmenters. For example Jkdefrag does a great job.
You should do the following when running Disk Defragmentor:
- Physically disconnect your modem from your PC
- Open Task Manager (Ctrl + Alt + Del)
- Open the Disk Defrag utility
- Shut down all applications that are under the User Name of the user that you are logged in as including explorer, but don't close the Disk Defrag utility. (Close taskmgr.exe last)
- Let the program do your hard drives while you go do something else
As long as all the non critical processes (The ones under your username) are shut down, Disk Defragmentor will be able to move every part of your hard drive instead of having parts that it is not allowed to access.
You should defrag at least every one or two months to keep your hard drives running optimally. Remember - by doing this, you potentially speed up your map load times!
Tuneup Scans
If you don't format regularly, having an application or two that can optimise the performance of Windows is a must since it's prone to get cluttered very quickly. Here we'll list some common applications that can help achieve this for you.
- Windows One Care Live (90 day free trial)
- Crap Cleaner (It has useful tools such as being able to clean the registry)
- AdAware (There is a free and premium edition)
- Spybot Search & Destroy (Useful to have both this and AdAware because if scanner misses something, the other will most likely pick it up)
- GameXP (Be sure to make a backup of your current system with this tool)
- TuneXP (Optimises aspects of the Windows File Management System)
Process Priorities
In some instances, having a program run higher or lower than normal may greatly benefit your PC. Why it might is up to the application, but we'll go through how to change the priority through what's known as 'Batch File Scripting', a popular tool used by server administrators used to automate tedious tasks.
First, you need to make sure you can see file extensions. Browse to 'C:\Program Files\Windows NT\Accessories' and look for wordpad. If it doesn't have .exe on the end, then you will need to 'Enable Extensions for Known File Types'. Now you're able to create a batch file! We'll use Steam as an example as to how to do this.
Create a blank notepad file and put the following text into it:
@echo off cd /d "C:\Steam\" start /low Steam.exe -silent
Replace C:\Steam\ with the direct file path of where your copy of Steam is installed to.
Click 'Save As', 'Save as Type - All Files' and name it steam.bat.
Save it to your Steam directory, or somewhere similar.
Open up the Steam directory and drag the steam.bat to 'Start ? All Programs ? Startup'.
This can also be done to set HL2.exe in a high priority / abovenormal priority. Just replace /low and -silent with the preferred priority alongside -applaunch XXX in the command line, substituting XXX with the appropriate Application ID.
Process Affinities
Anyone with a multi core processor should know that they're able to assign the affinity to individual cores to improve applications performance. For example, you could be running Counter-Strike: Source on one core and be able to launch your internet browser quickly on another core so you can browse while waiting to respawn without it affecting your FPS at all, since CS Source isn't optimised to use multiple cores.
Windows Task Manager is able to temporally assign a process an affinity, but once that application closes your changes are lost. This is because it works off the 'Process ID' and not the 'Process Name'.
To combat this, we have ImageCFG which allows a user to permanently assign an affinity to a process.
The author is not certain how exactly it works, so don't run it on a game executable where you can potentially get permanently banned by automated anti-cheat software due to a modified executable because it's better to be safe than sorry.
Use it for all other applications that you feel necessary, such as MSN/IRC or your music player. Be sure to back up any EXE you run this on before you use it, so there are no problems if you need to have the process run evenly on all cores or if a patch requires the original EXE to be unmodified before it can continue.
Overclocking
Disclaimer: Overclocking is an advanced means of making your hardware run faster by giving it more voltage, thus meaning it generates more heat and potentially shorten its lifespan by a considerable amount, voiding your warranty or even make your hardware completely fail. This guide is not a direct means to learn how to OC nor will the author be held responsible for any permanent damage you may cause to your hardware.
Now, if that hasn't scared you off then you can learn how to overclock your hardware using Cyb3rGlitch's OC'ing Tutorial.
If you are currently overclocking any components on your computer, please revert the memory timing and voltage to the settings recommended by the hardware manufacturer. Crashes and system instability which result from overclocking will not be supported by Steam Support or your hardware's manufacturer.
Hardware Maintenance
One of the major reasons of a PC's capabilities degrading over time (Aside from Windows) is that many people forget that they need to care for their machine. Things like an incorrect airflow through the case can easily cause dust build-up on the heatsink of your CPU, leading to degraded performance or even crashes due to the CPU not being able to disperse heat fast enough.
Overheating
The easiest way to check for problems here is to take the side of the case and put your hand inside the case to feel if anything is hot. Be careful because you can potentially burn yourself if you touch something that's seriously overheating. The best thing to do generally is just get a can of compressed air (Of if you're cheap, just vacuum it carefully) to blow all the lodged dust from out of the heatsink and other areas when the PC is turned off.
Otherwise, you can check the following areas for heat:
- The CPU (1)
- The Graphics Card (2)
- The sticks of RAM (3)
- The Power Supply Unit (4)
- The metal near your hard drives (5)
If something isn't burning hot, then it's most likely not your problem. If one of the places are however, you'll need to do something about this as the heat from one piece of hardware can drastically affect system stability.
Factors that can affect this are the following:
- The current room you're in and its ventilation
- Keep the PC near an open window perhaps as opposed to the corner of the room
- The elevation of the PC
- Sitting right on the carpet is generally bad if the case has vents at the base of the case
- The airflow of the case
- If you have a fan in front and in back, have the front blow IN air and the back fan blow OUT air so dust and heat get shot out quickly
- The wiring of the case
- Having wires that don't hang over the CPU or other areas will cause the airflow to move correctly instead of being obstructed and potentially creating more dust
The best thing to do is have the largest fans that your case can support and make sure they're spinning in the correct direction. If you can only have one fan at the back, have it blow out air. There are also PCI slot fans and even hard drive fans that you're able to purchase if any of these areas are of concern to you. This is something that you can pick up dirt cheap from any reasonable IT store like ITSdirect.
Another option is to go with Water Cooling which is what most PC/Overclocking enthusiasts go for, but can be very expensive to set up.
You're always able to get a new heatsink for your processor, along with proper thermal grease that will disperse heat from the CPU quicker, so this is the cheaper alternative if you just want to run your PC 'on air'. They're fairly easy to install, some require a screwdriver and at most a brain!
As a side note, if you own the ASUS M2N-MX motherboard and find your game freezes/hangs for seconds at a time, then your motherboard is overheating - the solution being that you should rig up a fan in between your CPU and back printer port.
Power Supplies
Poor power supplies and heat issues relating to your power supply can be a major contributor to overall system stability, as the quality of your power supply and the voltage/current it provides to all the various components is critical to how well your system will run. Your power supply controls the quality of the power to several key components, all which are very sensitive to the quality of the power supplied to them in today's systems, these being the following:
- CPU
- RAM
- Motherboard, particularly North & South bridges
- Video Card
The other problem is, the harder you work your system which is what happens when you are playing a game, is exactly the thing that causes the heat in your system that will make your power supply operate considerably less than at 100% efficiency.
A good explanation to why power supplies and their quality are becoming ever more crucial to today's systems, and why heat is a major factor, can be found here: PC Power & Cooling - Myths Exposed.
Steam Related Issues
Occasionally on some PC setups, Steam has been known to take up 50% of a core for what would seem absolutely no reason!
Most people will agree that Steam, a supposedly idling program should never take up as much CPU as pictured right, period.
The user that posted the first image had the specs of P4 3.4 ghz and 1024Mb RAM. (This picture was originally posted on the Steam Users Forums)
The second image was something that the author was experiencing and having it on a low priority didn't seem to help. The specifications used in that picture were a XP3000+ CPU and 1.25 RAM.
Even though this particular issue should be fixed, it's reasons like this is why you should be aware of what applications typically idle at so you know if something is going wrong.
If you still get the above issue, then please lodge a Support Ticket with Valve for them to find what is causing the issue and help you directly.
The number one thing that you have to know about Steam however is that clientregistry.blob that is located in the main Steam directory is the equivalent of the Windows Registry. It stores everything from user names and passwords, to what games an account owns, what content servers they currently have access to and a whole lot more. Therefore, if you ever have a problem in regards to the Steam client then it's best NOT to delete this straight up.
Follow the following steps if you have an issue with Steam:
- Shut down the Steam client
- Browse to your Steam install folder
- Delete Steam.dll
- Restart Steam
If this does not solve your issue, then repeat the same steps with clientregistry.blob. Both of these files will be automatically remade and this 'fixes' many problems.
Verify Game Cache
If you've ever had a failed update or you're getting errors in a game itself, the best thing to do before anything else here is to 'Verify the integrity of game cache'. This will run a check (Presumably a check similar to MD5 over all the files within the GCF) over your cache to confirm that everything is exactly as it should be. If there is an error, it will re download the affected content. In most cases, this is far better than reinstalling Steam.
Defrag Cache Files
The second most useful tool is the ability to defragment your Game Cache Files. You might already do this by means of tools such as Diskeeper, however this tool will defragment the internal structure of the cache file to improve its performance. The properties menu will tell you what your current level of fragmentation is and once it reaches 10 or 15 percent, Steam will suggest that you should defragment the affected files.
You can also automate this process by using an external application known as HLLib and running a batch file. To use it, you need to do the following:
- Download the file and extract the contents
- Browse to /bin and move HLExtract.exe along with HLLib.dll to your SteamApps folder
- Create a file inside your SteamApps folder called defrag.txt
- Cut and paste the following contents into the file and save:
-
@echo off -
for %%F in (*.gcf) do "HLExtract.exe" -f -p "%%F" -
pause
- Rename .txt to .bat (Making sure that you can see file extensions) and run the script.
This should open up a black window and run through all your cache files, defragging them all automatically.
This can save you a lot of time when loading each game, so it's important to do this once in a while because games can get defragmented on initial game download and update.
Clean Reinstall
Most people will assume that because they're having an issue with a particular game, that the only way to fix it is to reinstall Steam. Normally, you only have to remove the game from your SteamApps/~Username folder. EG: 'SteamApps\~Username\team fortress 2'. If that doesn't solve your problem and you have already verified the Game Cache, then you might want to perform a true clean reinstall of Steam.
You can do this by performing the following:
- Logout of Steam if you are able to do so
- Exit Steam
- Move SteamApps out of the Steam folder. (This is the folder that holds your games and configuration files so you want to keep it!)
- Restart if prompted
- Delete Steam folder if it still exists
- Click START → RUN → REGEDIT → *ENTER*
- Delete HKEY_CURRENT_USER\Software\Valve and HKEY_LOCAL_MACHINE\SOFTWARE\Valve
- Restart
- Download and install a fresh copy of the Steam installer from the SteamPowered Website
- Run the installer
- Exit Steam before you first have to login
- Move your SteamApps folder back
After you have done this, you can log in and you will have a clean install of Steam, but not your games. They will have been retained because you kept your SteamApps folder.
Separate Steam Partition
Although optional, you can save yourself a lot of hassle with Steam when you format by having it on its own 60+GB partition. By doing this, you don't need to back up anything when you format and when it finishes you only need to install the Steam client and your essential drivers and then you're in the game fragging away like it was yesterday.
It's best to have Steam on a hard drive that is physically separate to the hard drive that has Windows on it, as you can have one HDD read the contents of the game while the other HDD can do the Windows Paging File, especially when you don't have a lot of RAM to play with. On low end setups, this can save a lot of stuttering but even on high end setups it's great just to keep things organised for when you do actually format.
You can do this by using freeware partition tools or premium tools such as Acronis Disk Director. Although most partition programs are intuitive to the point where even new people can learn how to operate it quickly, you may still want to read up on the basics of what to do before you partition your hard drive from articles such as this PC World Step by Step Guide.
Source Engine Tweaking
Tweaking the Source Engine is where it starts to get fun and where you can potentially gain the most FPS that your setup can muster.
You have two main areas to play with, the command line and configuration files such as autoexec.cfg which will be both covered here in detail.
Command Line Parameters
To set the launch options (Command Line Parameters) for a Steam game, you need to do the following:
- Right click the Steam icon in the system tray
- Select Games
- Right click your game of choice
- Select Properties
- Click on the Set Launch Options button.
This will pop up the window that is seen right, where you can enter any of the following valid parameters into it:
* = Recommendation if your game crashes
- -autoconfig* - Restores video and performance settings to default for the current hardware detected. Ignores settings inside any .cfg files until this parameter is removed.
- -dev - Enables developer mode. Also disables the automatic loading of menu background maps and stops the quit dialog from appearing on exit.
- -condebug - Logs all console output into the
console.logtext file. - -console - Starts the game with the developer console enabled.
- -toconsole - Starts the engine directly in the console, unless a map is specified with
+map. - -dxlevel <level>* - Forces a specific DirectX version when launching the engine. This is useful if your graphics card is DirectX 9 capable, but a lot faster using only DirectX 8 (EG: NVidia GeForce 6600GT).
- Multiply the desired DirectX version to use with ten. E.g. for DirectX 8.0 you would use
-dxlevel 80.
- Multiply the desired DirectX version to use with ten. E.g. for DirectX 8.0 you would use
- -32bit - Forces the engine to start in 32-bit mode. Only useful on 64-bit Operating Systems.
- Multiplayer Source Engine games are not capable of running in 64 bit.
- -fullscreen - Forces the engine to start in fullscreen mode.
- -windowed* or -sw - Forces the engine to start in windowed mode.
- -noborder - Forces the engine to not use the Windows border when in windowed mode. (Orange Box Only)
- -w <width> - Forces the engine to start with resolution set to
<width>. - -h <height> - Forces the engine to start with resolution set to
<height>. - -refresh <rate> - Force a specific refresh rate.
- -heapsize <kilobytes>* - Specifies the heapsize (in kilobytes) the game will use.
- -nocrashdialog - Suppresses some 'memory could not be read' unhandled errors.
- -novid or -novideo - When loading a game with this parameter, the Valve intro video will not play.
- -nosound* - Forces the specific game to not use the sound card.
- -nosync - Forces the specific game to not use VSync.
- -low - Forces the specific game to launch in a LOW process priority.
- -high - Forces the specific game to launch in a HIGH process priority.
- -threads - Forces the game to use a specified amount of threads for a multicore CPU (2 for Dual, 4 for Quad). Defaults to a maximum of 3 due to various issues. (Presumed L4D Only)
- +<cvar> - Replacing
<cvar>with any console command will cause this to be run as soon as the engine loads.
-dxlevel
This is the primary hard hitter of the command line. As mentioned, it controls the DirectX version that the game will use which its valid values are 60, 70, 80, 81, 90, 95 or 98. If you aren't able to handle -dxlevel 95, then -dxlevel 81 is the best option to use as it will disable features and shaders in 95 such as Phong Lighting and Bumpmap. If you can do without the 'pretty graphics' and would prefer a solid FPS, then this is the best option to use alongside a configuration file to tweak the game to how you would like it. Generally, all cards prior to the Nvidia 6800 are best at handling -dxlevel 81 over -dxlevel 95. If you have a GPU more powerful than that, then it's up to you if you want FPS over pretty shaders.
You have two options of using this, which is listed here:
- Put
-dxlevel 81in your command line - Run the game
- Close the game after it is loaded
- Remove the parameter
Or the second option:
- Put
-dxlevel 81in your command line - Also specify
-w XXXXand-h XXXfor your screen resolution - Leave in there permanently
The lower you set the dxlevel, the higher your FPS generally is. This is not always the case though depending on your graphics card. This is because lower DirectX levels do not have certain types of graphical features enabled.
-heapsize
Heapsize is similar a pool of memory that the game has access to in order to load everything. Tweaking this used to be essential especially since it helped with gameplay in Half-Life 1, however when Half-Life 2: Episode 1 was released it came with what's known as 'Source Engine Base 2' which fixed heapsize based stuttering problems that people had with the Source Engine. Valve Developers now discourage the use of -heapsize, as posted by Jay Stelly:
-heapsize doesn't control the same resources it did in Half-Life. So it's probably not equivalent to hunkmegs in the other game you mention. (ED: COD2) -heapsize is not hooked to any cache management code that is actually thrashing at the default settings on a 1GB machine. If there were a possible performance gain by setting this higher we'd certainly let you do it. In fact, there's really no reason for it to be set any higher than the defaults (except maybe if you are loading some unusually large BSPs from a mod not made by Valve). The updated behavior is to allow people with 4GB+ on 64-bit OSes to init the heap properly. On those OSes the 32-bit standard windows calls return the wrong value for total/available memory; this update allows the user to bypass that check by using -heapsize (it's automatically detected and fixed in the version of the engine that ships with lost coast, but we pushed some of the code into the current version to help people who can't currently run the game because of this issue) Bottom line, unless you were running a 64-bit OS this doesn't affect you.
This basically states that heapsize isn't some magic command that will improve your framerate, however it can be useful if you're attempting to resolve a stuttering issue.
Increasing heapsize will allow the Source Engine access to more RAM that it typically doesn't need. If you do set it though, you should only set it to use half of your physical RAM as setting it above half can cause undesired operation and will result in your client crashing.
You can determine the exact number you need to use by using a Conversion Calculator, figuring out the amount of megabytes in RAM that you have, halving that number, then use that halved number in megabytes in the calculator and use the number outputted in kilobytes as your heapsize.
Example: If you have 1024Mb of physical ram, you halve that number, (512) put that in megabytes in the calculator and then use only the number that it gave you under kilobytes as your heapsize (524288 kilobytes)
- -heapsize 131072 If you have 256Mb RAM
- -heapsize 262144 If you have 512Mb RAM
- -heapsize 393216 If you have 768Mb RAM
- -heapsize 524288 If you have 1Gb RAM
Configuration Files
All config files are based in 'Steam\steamapps\~Username\<GAME>\<MODDIR>\cfg' and nowhere else.
- Autoexec.cfg - Run at startup
- Userconfig.cfg - Run when you change settings from the options menu
All configuration files are based around the Autoexec which will load everything when the game is start up. From here, you can put in console variables (cvars), execute other configuration files along with being able to place binds and aliases.
If you have been reading this guide from the start, you will already have your file extensions enabled which will allow you to create an Autoexec.
The major cvars that will always affect performance are the following:
- mat_picmip "0" // [!0] Texture Level
- mat_antialias "0" // [!0]
- mat_aaquality "0" // [!0] 4/2 = 8xCSAA, 8/2 = 16xCSAA
- mat_forceaniso "2" // [!2] Antiscopic Filtering
- mat_reducefillrate "1" // [!1] Shader Detail
- mat_hdr_level "0" // High Dynamic Range Lighting
- mat_bumpmap "0" // [!0] Bumpmap Texturing
- mat_specular "0" // [!1] Specular Lighting
- r_lod "1" // Model level of detail
- r_rootlod "1" // Root model level of detail
- r_decals "100" // Amount of decals (Bulletholes, sprays, etc) that can be on the world at one time
- r_drawdetailprops "0" // 'Detailed' props, such as grass
- r_drawflecks "1" // Impact debris
- r_shadows "1" // [!0] Player Shadows
- r_shadowmaxrendered "4" // The amount of how many fully rendered player shadows will be drawn - anything else is rendered as a blur oval shadow
- r_dynamic "0" // [!0] Dynamic lighting
- r_3dsky "0" // [!0] Render the 3D skybox projection
- r_waterdrawreflection "0" // Water reflection
- r_waterforceexpensive "0" // Detailed water
- r_waterforcereflectentities "0" // Allow water object reflection
- r_propsmaxdist "0" // Maximum visible distance of props
- r_worldlights "0" // [!0] Lights that reflect off your weapon
- r_renderoverlayfragment "0" // Overlaid textures that make up decal like effects
- cl_phys_props_max "0" // Maximum clientside physic props
- cl_ragdoll_physics_enable "0" // Enable/disable ragdoll physics
- cl_ragdoll_collide "0" // Ragdoll collisions
- cl_ragdoll_fade_time "0" // Time until ragdolls disappear
This won't make your game look horrible like certain other public configs, because mat_picmip is at a reasonable level and can go up to -10. Word of warning however, forcing mat_picmip too low will cause strain on your CPU as it has to automatically 'downscale' all the textures in the game at map load so you can save the amount of memory used in your RAM.
You can also use this nice cosmetic tweak to remove the ropes, since they're only a distraction:
- r_ropetranslucent "0" // Enable/Disable ropes
- rope_smooth "0" // Antialiasing effect on ropes
- rope_wind_dist "0" // Don't simulate wind on ropes past X distance
- rope_collide "0" // Collide rope with the world
- rope_subdiv "0" // Rope subdivision amount
For a basic outlook on the main quality cvars, take a look at Source Autoexec Tweaks.
Mat_queue_mode
Mat_queue_mode is a cvar that's been introduced to Half-Life 2: Episode 2 that allows multicore processors to take advantage of all the available cores when set to 2.
This causes many issues for players as their games crash near instantly. Although the multicore rendering is still undergoing changes, the author has found that on many computer setups that this following configuration will allow you to run MQM 2 without a hitch:
- mat_queue_mode "2"
- cl_threaded_bone_setup "0"
- cl_interp_threadmodeticks "0"
- cl_threaded_client_leaf_system "0"
- r_threaded_client_shadow_manager "0"
- r_threaded_particles "1"
- r_threaded_renderables "0"
- r_queued_decals "0"
- r_queued_post_processing "0"
- mp_usehwmmodels "-1"
- mp_usehwmvcds "-1"
The results received from users are mixed - some good and some bad, so as usual your mileage may vary. and use at your own risk. Also, certain people appear to have better stability when they use this in conjunction with host_thread_mode 1
The above configuration will disable all but threaded particles as some users may have changed variables that they shouldn't to try and get this to work. The instant crash itself stems from the mp_usehwm* variables which appear to not be compatible with multithreading but which gets enabled automatically when you have hardware that supports it. Valve are apparently working on an update to fix this, but it's estimated time frame is coming soon. It's also known that changing mat_picmip from its default value will also cause the game to crash more on map change on certain setups.
After you have tested this, feel free to enable any of the cvars that have been set to 0 and change them to 1 to see if they are stable and give you a gain in FPS. If in any case you start to get 'choppy' gameplay, you may want to try playing the game with a different priority in the Task Manager which you can then set permanently using the method mentioned in this guide or via Command Line. You might also get some success out of using fps_max 60 as Tyrael4 over at the Steam Forums has pointed out.
If you find your game will randomally crash to the desktop without even a warning, this is typically the game forcing a shutdown when the multicore rendering has encountered a problem with your systems stability - in which case, review the foreword of this article. Your system may also encounter serious stuttering issues, in the majority of cases it's the graphics driver. The catch to fixing this one though is to find a specific driver that doesn't stutter on you. For Nvidia users, this is typically the 181.00 driver. In certain cases however, it's related to plain old overheating.
TF2 Benchmarking
The author has made this thread on the Steam Forums that will allow users to test their ingame FPS to see tweaks before and after they're applied. Run timedemo from console to run your own benchmarks.
For the first average demo, a good return is around 60 FPS. For the second fire fight demo, a good return is around 15+ FPS.
L4D Tweaking
Left 4 Dead has 'locked out' the majority of cvars from the console made available to end users, so you can't use a config for graphics tweaking especially considering you're not able to run anything but DirectX 9 with it. There is video.txt however that allows you to add new settings into there - generally though you shouldn't play with it because it's all set from the options made available ingame.
From experience however, the majority of crashes in L4D either relate to mat_queue_mode (Straight crash to desktop) which you can refer to look here for more info or from Graphics Drivers (Crash with error message referencing a graphics DLL, eg: nvd3dum.dll) which you can try a variety of different drivers and be sure to use one of the driver cleaners mentioned here with that.
That's it. Everything else is up to user preference and basically won't give you anything extra for FPS.
Valve Support
If all else fails, you should send off a support ticket with Valve at their support page. This guide covers everything else that the author can think of, so you're able to tell Valve you have done what's suggested here (Don't lie and say you've done it all when you haven't, it makes you look bad) to let them help you with the problem. Before you send that support ticket though, take note of the following items:
General FAQ Links
- Troubleshooting Game Crashes
- Check DirectX Settings
- Crashing and Lock ups with Source-Engine Games
- Dual Core CPU Issues
- Failed to lock index buffer in CMeshDX8::LockIndexBuffer
- Erratic Character Limbs (VIA Chipset Related)
- Games freeze or crash with Looping Sounds
- Can't load lump x, allocation of x bytes failed! Engine Error
- General Troubleshooting Topics
- Hangs / Slow Performance on PC's with AMD Processors and VIA Chipset Motherboards
- Hanging at precaching resources
- Lag issues when playing
- Mouse Lock-Ups in Steam Games
- 'Page Fault Found In A Non Paged Area'
- Reset / Force video mode
- The Instruction at 0x####### referenced memory at 0x#######
- Verify GCF Cache Files
- Your map differs from the servers
- Steam Support Strings
If you get an error message that isn't listed here, be sure to search for it in Steam Support.
Gathering required PC information
If you go with lodging a support ticket, then you will need to do a MSINFO Report as this tells Valve what programs you have installed that could be conflicting with your game. The two main offenders are Teamspeak and Xfire.
Uninstall these programs if you have them installed and try again, as this is what Valve is likely to suggest.
If you're experiencing unexpected crashes, then be sure to include only your latest in date .MDMP file as this assists Valve as to why your game is crashing.
If you don't, they'll probally tell you to send one and to follow steps in this link!
If you're interested to see what is in a .MDMP file, you can follow this small guide if you have the proper know how.
You should have already verified your Game Cache Files and make sure that all your videocard/sound/motherboard drivers are up to date from the manufacturers web site.
Valve have also suggested in the past that renaming your game folder inside of \Steam\SteamApps\~Username to something else, after verifying your Game Cache Files would be able to help.
People have also stated that copying all the contents from \Steam\SteamApps\~Username\<GAME>\bin into \Steam\SteamApps\~Username\<GAME> has stopped their game from encountering errors.
If you have done all this and the game still doesn't work as it was intended to, then you can lodge a Support Ticket but be sure to include the steps you have already taken to try and stop this, otherwise the Valve representative you talk to is probably going to repeat something you've already done here.
Conclusion
If you've taken the time to read through all this, comprehend it and put it into practice then well done. Most people won't even get this far or just skim read it, ignoring valuable pieces of advice. If this guide hasn't solved your problem then please contact Valve support and if they solve your issue then please leave a note of it in the Talk Page.
Random Notes
- If you wish to put all those extra frames per second to good use, then be sure to check out Whisper's Very Basic Counter-Strike War Strategies.
- If you have everything fixed up and now want to worry about rates, check out my Source Rates Guide.
- Other related useful guides on this Wiki include Choke / Net_graph 3 Explanation, Source Autoexec Tweaks and Noob guide to Netgraph / Ping.
- If your game locks up at the loading screen or that you get the Unable to load library Steam.dll, then you should check your firewall, delete HL2.EXE and add it again. Valve suggest doing this on every update, but it's not always needed.
- Alfred Reynolds comment on the Counter-Strike Source Visual Stress Test -
The test is more about giving us data on cards being used and relative performance problems that we need to address, it wasn't meant to accurately predict in game framerates. - Alfred
- Alexroyces comments on HDR affecting people who turn it off -
The way HDR can impact a person who has disabled it is simply by the bigger .bsp size. If HDR is off there is NO performance loss. The map itself is exactly the same. The lighting information written into the bsp by Vrad is different though as Vrad compiles both LDR and HDR lighting. Basically, the filesize doubles because of the 2 sets of lighting. - alexroyce
- It is possible to play Source Engine games (Counter-Strike: Source) under other operating systems such as Linux. Using methods like WINE allows you to "emulate" DirectX, but unless you know what you're doing, getting it to work can be slightly difficult and you can't always expect the same amount of FPS that you get under a Windows based system.
- Thanks to various people that have taken the time to contribute new sections to this guide, including Whisper, Blickety, Azetab and Tomardern.
- Credit to rypt and Justanoob over at the Steam Forums for their contributions on mat_queue_mode stability.
- Do not under any circumstance, recreate this guide without my permission. Only link to this page!
- On that note, be sure to link to this guide or follow me if it has helped you in any way! :)
External Links
Here is a list of helpful websites - Sites mentioned here have in some way, helped me in the creation of this guide.
- Steam Users Forums
- Valve Developer Wiki
- GameArena - Bigpond's Gaming Channel
- Counter-Script: The #1 Counter-Strike Scripting Site
- Tweakforce - Home of the Xtreme-G Drivers
- NVIDIA Forums
- TweakXP.com
This is all I can currently think of and I will add more if and when I find it.
Remember, you can always format your PC when you need to but that is considered a worst case scenario solution.
- WaLLy3K
