Futon'D, HNIC (09-26-2011), Madoff (07-14-2010), Net (07-12-2010), reechard (08-16-2010), Rydash (07-11-2010), Shaman Bond (07-12-2010), Skidz (07-11-2010), Spybait (09-26-2010)
LAST UPDATED: (07/14/10)
This thread is undergoing revision. Clarifications will be made on many topics and I will be expanding on the OP considerably.
NOTE: THIS THREAD IS NOT AN ENCYLOPEDIA FOR TERMINOLOGY. If you do not know what something means do a search on Google for it.
I will only explain what it does not what it means or why it works.
If you are struggling with performance and/or stability problems in any Source game this thread is for you.
Both performance and stability issues can be caused by a number of things and they can be solved a number of different ways. Many people prefer to blame the server they reside on saying that it is out of their control. This is in most cases untrue and just plain ignorance. Even if it isn't your problem there is nothing stopping you from optimizing your installation to run as smoothly as possible.
I will be covering both Launch Options and Configuration Files [.CFG].
――――――――――――――――――――――――――――――――――――――――――――― ―――――Launch Options"Where are these? I don't even."
All games in your Library have launch options. These options instruct the program to execute certain commands on launch, thus the term Launch Options.
They can be found the following way:
- Right-click on the game title under the My games tab in Steam and select Properties.
- Under the General tab click the Set launch options... button.
Now that you have that dialog box open the rest is fairly simple. It’s just a matter of knowing the correct commands. It should be noted that these parameters will work with any Source engine games (Half-Life 2, Counter-strike: Source, etc.).
The next section will give an in-depth list of all the commands you need to know. If an anything is missing from this section don’t hesitate to notify me and I will expand the list to include the missing information.
NOTE: Not all of these commands are required. The ones I highly recommend that EVERYONE include in their launch options will be coloured GREEN. Commands coloured RED are either obsolete or detrimental to performance/stability. Do Not Use Them.---------------------- Forces the game to use the specified # of threads for a multicore CPU (2 for Dualcore, 4 for Quad).Code:-threads #---------------------- When loading a game with this parameter, the intro Valve video will not play.Code:-novid
The inclusion of this command in your launch options will result in the game loading up faster as the start-up video does not need to load and play.---------------------- Specifies the heapsize (in kilobytes) the game will use.Code:-heapsize #
Heapsize refers to the amount of RAM your system allocates for the game engine to use. The general rule of thumb is that you allocate 50% of your total RAM using -heapsize.
To make it simple use the following to figure out what number your heapsize should be:
1GB of RAM: -heapsize 524288512 megabytes = 524 288 kilobytes2GB of RAM: -heapsize 10485761 gigabyte = 1 048 576 kilobytes4GB of RAM: -heapsize 20971522 gigabytes = 2 097 152 kilobytes6GB of RAM: -heapsize 31457283 gigabytes = 3 145 728 kilobytes8GB of RAM: -heapsize 41943044 gigabytes = 4 194 304 kilobytesIf you have any further questions regarding heapsize, RAM, or conversions between gigabytes and kilobytes please consult Google.
Google was used for all calculations. Ex. Search for "2GB to KB"---------------------- Enables developer mode. Also disables the automatic loading of menu background maps and stops the quit dialog from appearing on exit.Code:-dev---------------------- Logs all console output into the console.log text file.Code:-condebug
This can be used both as a launch option and as a console command. When used as a launch option it creates a log every time the game is launched and fills it with everything in the console from the time you boot to the time you exit. These files can be HUGE. So I’d advise against using it as a launch option. HOWEVER, condebug can be used as a console command to dump the console to a log file when you enter the command. This can be very useful for getting evidence of a troll abusing chat, or for diagnosing errors and crashes.---------------------- Starts the game with the developer console enabled.Code:-console---------------------- Starts the engine directly in the console, unless a map is specified with +map.Code:-toconsole
I personally have not tried this command.---------------------- 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 (e.g. NVidia GeForce FX 5200). Multiply the desired DirectX version to use with ten. E.g. for DirectX 8.0 you would use -dxlevel 80. For DX9 there are three possible values depending on the Shader Model the graphics card supports. See mat_dxlevel.Code:-dxlevel
I have found conflicting information throughout my use of the source engine since it was released. Currently I would recommend against using -dxlevel to define your DirectX level. According to The Valve Developer Community:
Taking this information from Valve into consideration I would recommend that you use -mat_dxlevel to define your DirectX Level.Originally Posted by The Valve Developer Community
---------------------- Forces the engine to start in 32-bit mode. Only useful on 64-bit Operating Systems.Code:-32bit---------------------- Forces the engine to start in fullscreen mode.Code:-fullscreen or -full
This is useless in my opinion. Unless you are too lazy to go to options and switch from Run in a Window to Full Screen.
And with the information I provided here no one reading this should be running fullscreen anyways.---------------------THE FOLLOWING COMMANDS MUST BE USED TOGETHER. DO NOT USE -noborder WITHOUT -windowed. DOING SO WILL RESULT IN CRASHES.
- Forces the engine to start in windowed mode.Code:-windowed---------------------- When used with the game set to windowed mode, will make the game act as if in full screen mode (no window border), potentially making Alt+Tabbing faster.Code:-noborder---------------------- Forces the engine to start with resolution set toCode:-h. Ex: -h 768 ---------------------- Forces the engine to start with resolution set toCode:-w. Ex: -w 1360
I highly recommend that even if you have no problems whatsoever make sure to use the last 4 commands. It changes nothing visually but completely eliminates any problems with alt+tabbing, accidentally hitting the windows key, or in my case hitting that pesky 12th mouse button that opens a search dialog.
Now there are additional commands which I will not document because I do not feel they are very helpful in terms of solving performance/stability problems.
However, descriptions for these and for the commands above can be found at the following link:Command Line Options - Valve Developer CommunityFor those of you who are curious as to which launch options I use here they are:
――――――――――――――――――――――――――――――――――――――――――――― ―――――Code:-threads 4 -novid -heapsize 1048576 -noforcemaccel -noforcemparms -noforcemspd -mat_dxlevel 98 -windowed -noborder -h 768 -w 1360 -consoleConfiguration Files [.CFG]"Where are these? I don't even and Rainbows make me cry."
If you found the previous section complicated I suggest you stop reading here.
These are much more complicated and can cause instability in the worst cases.
A lot of the time they do provide improvement but require lots of "trial and error" style testing.
SO....Where can you find these so-called Configuration Files?
First hit the Windows Key + R, this will bring up the run dialog.
Then type:
Now if you look around in the folder you should see a file called:Code:32 bit systems: C:\Program Files\Steam\steamapps\\team fortress 2\tf\cfg 64 bit systems: C:\Program Files (x86)\Steam\steamapps\ \team fortress 2\tf\cfg
If this file does not exist copy one of the class files and paste it then change its name.Code:autoexec.cfg
If there is no association for the file type double click and choose Notepad as its default program.
Great! So if you are still with me I'll step it up a bit with a listing of some generic and useful commands that can make life easier and increase performance on multicore systems.
Misc. Useful Commands
Multi-core CommandsCode:"exit" hmm... Closes game? "kill" Kills yourself "explode" Kills yourself(you explode) "hud_fastswitch" Turns fast-switch (0 disables 1 enables 2 disables [consoles style]) "showmapinfo" Shows info about map "+showscores" Shows scoreboard "impulse 201" Sprays your logo "toggleconsole" Opens console "screenshot" Makes a screenshot (TGA) "jpeg" Makes a screenshot (JPEG) "fps_max" Limits your FPS "mat_bumpmap" Enables/Disables bump mapping "mat_compressedtextures" Enables/Disables textures compression "mat_dxlevel" Sets DirectX level "mat_specular" Enables/Disables spectacular lighting "cl_showfps" Shows fps, but not net graph statistics (upper left) "jpeg_quality" (0-100) - Changes the quality of jpeg screenshots, 90 = default.
Alright so now you have basic knowledge of what does what. Keep in mind all of these can be entered through the console.Code:"mat_queue_mode -1" Auto-detection, enables threaded rendering if you have multiple cores "mat_queue_mode 0" Disables threaded rendering "mat_queue_mode 2" Enables threaded rendering it even if you don't have multiple cores
BUT, anything with the prefix mat_ should NOT be entered in the console during game-play. The results of doing so vary greatly.
I encourage you to use all mat_ prefixed commands in your autoexec only. Again these are not essential commands as the Advanced portion in the Video tab assigns values to these automatically.
There are a few additional commands I use that assist with Multi-core usage:
Use these with CAUTION. They work for me but that doesn't mean the will work for you.Code:host_thread_mode "1" r_threaded_particles "1" r_threaded_renderables "1" snd_mix_async "1"
If instability occurs REMOVE host_thread_mode “1”.
Last command for you:
DO NOT USE THIS. According to new information I found the Source Engine AUTOMATICALLY enables these instruction sets based on what your hardware is capable of.Code:r_sse2 "1"
Performance issues, Stability problems, and random crashes can occur by using this command to FORCE the use of an instruction set that is not supported.
I apologize for the false information.
Ok, so I hope you learned something and any feedback is welcome and appreciated.
Futon'D, HNIC (09-26-2011), Madoff (07-14-2010), Net (07-12-2010), reechard (08-16-2010), Rydash (07-11-2010), Shaman Bond (07-12-2010), Skidz (07-11-2010), Spybait (09-26-2010)
CHANGE LOG
v0.2 - 07/14/2010
- LAUNCH OPTIONS SECTION COMPLETE
- Added 8 additional commands with personal description
- Updated existing entries with my take on the usefulness and purpose of the command
you forgotget out lolCode:-noforcemaccel -noforcemparms -noforcemspd
nice guide so far, but two things.
you might want to put something in there about the relationship of config.cfg and autoexec.cfg and how (iirc...) config runs first and then autoexec runs on top of it, overriding any of the same commands with different values.
also, if you're going to discuss performance, you might want to try and throw something in there about custom configs (fps configs/high quality congifs/etc.). I know there's some people, including me, who don't have super ultra super computers, and could use a bit of a performance boost. I use a modded version of an fps config and i've got my game looking and performing just like i want it to.
Not to be a pain in the ass, and it doesn't really matter, but why heapsize 1048576?
I would assume that most users would probably want to use a max of 1024000. This assumes the average person has 2gb of RAM. People with 1GB should only use 524288. You can double it for 4gb but I'm not sure it really makes a performance diff beyond 1024000.
Personally I use -threads 4 -novid -heapsize 1024000 -windowed -noborder -h 1080 -w 1920 -noforcemaccel -noforcemparms -noforcemspd
Quad Core Proc on Windows XP. You shouldn't have to use the mouse commands for Windows 7, just XP because it's a bitch.
Latest update alt tabbing can still $#@!ing crash the game. I have always been able to alt tab no problem but lately it's just being a whore.
Thanks for the info. I did not know you could do that with the window mode makes alt tabbing so much easier.
This thread
This thread
This thread
This thread