Go Back   Overclockers Forums > Software > Games > Configuring The Source Engine: HL2 and CSS
Reply
 
Thread Tools
Old 05-18-06, 02:16 PM   #1
mantaphor
Member



Join Date: Dec 2004
 
Arrow Configuring The Source Engine: HL2 and CSS

Configuring The Source Engine: HL2 and CSS

As some of you may know, the configurability and range of options available to a gamer extends far beyond the in-game menu of Half-Life 2 or Counter-Strike: Source. How is this done? You can change options and variables for various video, network, and client settings in either game. This guide will briefly explain how this is done, and how you can improve your game's visual quality or performance with ease.

PART ONE: COMMAND LINE

[COLOR="White"]To start, let's take a look into the Steam application. This is the primary setting location. Run Steam, and open the "Games" window. Next, select "My Games". Right click on Counter-Strike: Source or Half-Life 2, and select "Properties". In this window is a button called "Set Launch Options". Click this. You now have in front of you a quick-access to the hl2.exe command line system. There are a variety of commands available for use here. I will only explain the three (or four, depending on perspective) most important to this guide.

1. '-dxlevel'
This command will set the desired DirectX level of the game. Here is a run-down of the options. Click on a number to see a screenshot of it being used in-game.

-dxlevel 70 - The most basic DirectX level. Provides good performance on older cards (MX440 era), but lacks features such as shadows, specularity, and water translucency.
-dxlevel 80 - This DirectX level provides excellent performance, and still retains shadows and specularity (notice the shiny floors in the image). However, water is still strictly opaque.
-dxlevel 81 - Exactly like DirectX 8.0, but water now has the option of being translucent (See Part 2).
-dxlevel 90 - The most commonly used DirectX level. Performance takes a severe hit for a minimal gain in visual quality. Special effects include enhanced explosions and increased texture depth in smoke grenades. However, several glitches are present. Flash grenades can superimpose your windows desktop icons on the screen, and specularity/bumpmapping errors are common.
-dxlevel 95 - The same as DirectX 9.0, with the option of using High Dynamic Range lighting (HDR).


2. '-heapsize'
This command determines how much memory (RAM) is allocated strictly for hl2.exe. The general agreement is that this number should reflect how much memory is installed in your system. Here is the equation:

Your System Memory (In Megabytes) / 2 * 1024 = Your Heapsize

Examples:
512MB / 2 * 1024 = -heapsize 262144
1024MB / 2 * 1024 = -heapsize 524288
2048MB / 2 * 1024 = -heapsize 1048576

Applying this setting will stabilize your game performance greatly - with no reduction in visual quality. Textures are better handled by the game, and the game has an increased ability to cache resources.


3. '-w' (and '-h')
[SIZE=2]This is your resolution setting. Setting one variable automatically sets the other in most cases, but it is sometimes necessary to set both, such as in the case of 1280x960 vs 1280x1024(LCD). This is useful by applying the resolution BEFORE the game is launched, giving you enhanced control of unexpected problems or performance tweaking.

Examples:
-w 800 -h 600
-w 1024 -h 768

PART TWO: AUTOEXEC

The next part of this guide is about configuration files. These files are text documents containing commands that alter various settings within the game. There are two main files: autoexec.cfg and config.cfg. config.cfg is your default configuration file, it is usually not necessary to edit this. autoexec.cfg is a file that splices a list of commands INTO config.cfg each time the game is started. This is the file we will be working with. First off, where is this file? The file can be found in this directory:

C:\Program Files\Steam\SteamApps\YourName\counter-strike source\cstrike\cfg\
-or-
C:\Program Files\Steam\SteamApps\YourName\half-life 2\hl2\cfg\

The file 'autoexec.cfg' may not be present in your directory. In this case, it must be created. This can be done using notepad, and saving the file under "All Types" with a '.cfg' extension. Within this file, the coding structure is simple. Here is a quick formula for a command:

command variable \ comment
command "variable variable" \\ comment

Do not worry yet, you will understand what this means to you in a few moments. These commands are the same ones entered into the in-game console (to activate the in-game console, check its box under Options > Keyboard > Advanced in game). There are several hundred commands available for use in the console. I will, again, only cover a few that are most relevant to the game's performance and visual quality.

mat_picmip (0-4) - Texture quality. Lower numbers are higher-quality textures. All images above were done using picmip 0 - the highest quality textures available. Variables 3 and 4 are very low quality, and are not recommended. Variable 2 is a great combination of texture quality and performance. Increase for a framerate gain.
mat_bumpmap (0-1) - Texture depth. Enabling this (1) will increase the detail of textures even further, but it is a bit costly to framerate. Disable for a framerate gain.
mat_specular (0-1) - Texture "coating". This enables the shiny surfaces as seen in the DirectX 8.0 screenshot, but also may cause errors as seen in the DirectX 9.0 screenshot. Disable for a framerate gain.
r_shadows (0-1) - Disable/Enable shadows. Very helpful in gameplay. Disable for a framerate gain.
r_decal_cullsize (0-15) - The distance from which bulletholes are visible. Higher numbers mean a shorter viewing distance. Setting this to '0' allows you to see bulletholes at any distance. Increase for a framerate gain.
r_waterdrawreflection (0-1) - Reflect the environment onto the surface of the water. Disable for a framerate gain.
r_waterdrawrefraction (0-1) - View the floor surface through the water. Disable for a framerate gain.
cl_phys_props_enable (0-1) - Disable/Enable the visibility of bricks, cans, and trash objects (only objects with which you may not interact with). Disable for a framerate gain.
fps_max (10-300) - Limit your framerate. I recommend setting this to your monitor's refresh rate (60Hz on most monitors, although some monitors meet or exceed 100Hz).

Those are the most important commands available. Here is a brief example of a working configuration:


mat_picmip 0
mat_bumpmap 0
mat_specular 0
r_shadows 1
r_decal_cullsize 0
r_waterdrawreflection 0
r_waterdrawrefraction 0
cl_phys_props_enable 0
fps_max 60


Again, this text is contained in a text-file called 'autoexec.cfg', in the directory specified above. You must restart HL2/CSS for any changes to this file to take effect (without using the console, of course).

------

Well, that basically concludes this brief guide. Feel free to try it out or to ask questions. With settings like these I am able to hold far beyond 100FPS on any map during gameplay, although I normally play with 'fps_max 60' (stability is key to games like these). I hope I have enlightened someone with this. Good luck and have fun with Half-Life 2 and Counter-Strike: Source!

Last edited by mantaphor; 01-11-08 at 07:53 PM.
mantaphor is offline   Reply With Quote
Old 05-18-06, 02:39 PM   #2
chevro1et
Member

 
chevro1et's Avatar 

Join Date: Nov 2005
Location: 35.012N/ 129.052E
 
Nice little summary there for sure... Thanks!!

__________________
Dell Inspiron 640m
Intel C2D T5500 Centrino (1.66 ghz/ 667 fsb)
2x1 gig RAM (533 fsb)
WD Scorpio Blue 500gb hdd
Intel 950GMA integrated graphics
14.1" widescreen (1440x900) w. Truebrite
Vista Home Premium
5in1 card reader/ Bluetooth/ 3945abg wireless
chevro1et is offline   Reply With Quote
Old 05-18-06, 02:51 PM   #3
boris_37
Member

 
boris_37's Avatar 

Join Date: Jan 2006
Location: Calgary, Alberta
 
config #3... buy a decent pc... this game isn't that new!!!! lol

even sempy/x700 runs it fine, with graphics running quite well

__________________
Core 2 E6400 @2.13ghz stock TTBT Heatsink <>Forton Blue Storm 500w <> Asus P5B deluxe
GSkill 2x1GB DDR2-800 CL4-4-4-12
GeForce 9800gtx 512mb 256-bit
Seagate 250GB SATA150 Seagate 300GB SATA300 AND 74gb raptor OS Drive

Heat
boris_37 is offline   Reply With Quote
Old 05-18-06, 03:07 PM   #4
NsOmNiA91130
Member

 
NsOmNiA91130's Avatar 

Join Date: Nov 2004
Location: Lawrenceville, NJ
 
You forgot the plethora of AI and sound options available. If you want me to write up a tutorial, let me know. I used to map and optimize for Source.
NsOmNiA91130 is offline   Reply With Quote
Old 05-18-06, 03:08 PM   #5
Albaholic
Member

 
Albaholic's Avatar 

Join Date: Sep 2001
Location: Oahu, Hawaii
 
Nice guide. Some people like to tweak everything. I for one wouldnt mind seeing the AI stuff.

__________________
Heat
Albaholic is online now   Reply With Quote
Old 05-18-06, 03:13 PM   #6
mantaphor
Member



Join Date: Dec 2004
 
Quote:
Originally Posted by NsOmNiA91130
You forgot the plethora of AI and sound options available. If you want me to write up a tutorial, let me know. I used to map and optimize for Source.
Sound tweaks aren't legal in league play.

Thanks for the comments, guys.
mantaphor is offline   Reply With Quote
Old 05-18-06, 04:23 PM   #7
ziggo0
Member

 
ziggo0's Avatar 

Join Date: Apr 2004
Location: La Porte, Indiana
 
Footsteps need to be louder...bout it. Good guide.

__________________
e8400 E0 @ 4.4 ghz - 1.416vCore - 30C // 60C
Asus Maximus Formula x38 @ Rampage Formula - 701 BIOS
4x1gb Buffalo Firestix D9GMH @ 587 - 2.31vDimm - 5-5-5-12
HD4870 @ 825/1100 - 31C // 41C
Seagate 7200.11 250gb Raid0 - Seagate 7200.11 1tb
Corsair TX750
Tuniq Tower 120
My Heatware
ziggo0 is offline   Reply With Quote
Old 05-18-06, 04:30 PM   #8
mantaphor
Member



Join Date: Dec 2004
 
Making footsteps louder is against CAL rules, same rules for other sound commands.
mantaphor is offline   Reply With Quote
Old 05-18-06, 07:38 PM   #9
NsOmNiA91130
Member

 
NsOmNiA91130's Avatar 

Join Date: Nov 2004
Location: Lawrenceville, NJ
 
Quote:
Originally Posted by mantaphor
Sound tweaks aren't legal in league play.

Thanks for the comments, guys.
You said tweaking the Source engine. Sound is a big part of it. The engine can render beautiful 3d soundscapes in EAX.
NsOmNiA91130 is offline   Reply With Quote
Old 05-18-06, 09:19 PM   #10
Oni
Oni-ni-Kanabō
Ninja Hippo eater Moderator

 
Oni's Avatar 

Join Date: Apr 2001
Location: St. Catharines, Ontario Canada
 
Thread glue applied

__________________
Mama, put my guns in the ground. I can't shoot them anymore.

On Indefinite Hiatus

Asus P6T SE
Intel i7 920 @ Stock
6GB Corsair DDR3 9-9-9-24
XFX Radeon 5830 @ Stock
Corsair 750 Watt PSU

Oni is offline   Reply With Quote
Old 05-18-06, 09:20 PM   #11
mantaphor
Member



Join Date: Dec 2004
 
Yeah well I play CS:S competitively, so I haven't researched the sndscape features fully. Maybe someone can add to this thread with some more info.

Thanks for the Sticky, Oni. Love you.
mantaphor is offline   Reply With Quote
Old 05-18-06, 11:06 PM   #12
ziggo0
Member

 
ziggo0's Avatar 

Join Date: Apr 2004
Location: La Porte, Indiana
 
I play CS:S competitively as well, but I don't tweak anything except a few binds for my weapons & slot4 to mouse3. DX9 as well, I don't need that ****ty DX7 crap to gain an advantage

__________________
e8400 E0 @ 4.4 ghz - 1.416vCore - 30C // 60C
Asus Maximus Formula x38 @ Rampage Formula - 701 BIOS
4x1gb Buffalo Firestix D9GMH @ 587 - 2.31vDimm - 5-5-5-12
HD4870 @ 825/1100 - 31C // 41C
Seagate 7200.11 250gb Raid0 - Seagate 7200.11 1tb
Corsair TX750
Tuniq Tower 120
My Heatware
ziggo0 is offline   Reply With Quote
Old 05-19-06, 09:05 AM   #13
mantaphor
Member



Join Date: Dec 2004
 
DX7 really doesn't give you much of an advantage, it is just listed for those cards that can't run DX9 well enough -- or even DX8. DirerctX8 is optimal because it offers the same texture quality you can recieve in DX9, enables shadows (unlike DX7), and eliminates some of the pointless features in DX9. The only real advantages from switching to lower versions are increased frame rates with set-ups that can't compare to a high-end Opteron systems. Even then, they might not get the same FPS as a newer build. In the end it's just an attempt to reach around 75fps to enable a basic mat_vysnc .

The biggest advantage of DX8 and DX9 are shadows. They are so helpful in certain situations, that it almost renders DX7 obsolete.
mantaphor is offline   Reply With Quote
Old 05-19-06, 10:01 AM   #14
ziggo0
Member

 
ziggo0's Avatar 

Join Date: Apr 2004
Location: La Porte, Indiana
 
Quote:
Originally Posted by mantaphor
The biggest advantage of DX8 and DX9 are shadows. They are so helpful in certain situations, that it almost renders DX7 obsolete.
Definitly agreed. Like when someone is walking around a map and its all quiet, and you see a shadow waiting for you, PREFIRE!

__________________
e8400 E0 @ 4.4 ghz - 1.416vCore - 30C // 60C
Asus Maximus Formula x38 @ Rampage Formula - 701 BIOS
4x1gb Buffalo Firestix D9GMH @ 587 - 2.31vDimm - 5-5-5-12
HD4870 @ 825/1100 - 31C // 41C
Seagate 7200.11 250gb Raid0 - Seagate 7200.11 1tb
Corsair TX750
Tuniq Tower 120
My Heatware
ziggo0 is offline   Reply With Quote
Old 05-19-06, 07:01 PM   #15
mantaphor
Member



Join Date: Dec 2004
 
Yeah.

Can't tell you how many times someone's shadow is poking through a crack at the bottom of a door, so I kill them through a wall and they ban me for hacking.
mantaphor is offline   Reply With Quote
Old 08-16-06, 02:19 PM   #16
aintz
Member

 
aintz's Avatar 

Join Date: Aug 2006
Location: Ottawa, Canada
 
thank you hopefully chaning from 1gb to 2gb will help me get a little more fps
aintz is offline   Reply With Quote
Old 10-11-06, 04:29 AM   #17
Precision
3Dmark Team Member

 
Precision's Avatar 

Join Date: Aug 2006
Location: N 40.5931° W-77.5909 on teh Interweb
 
Quote:
Originally Posted by mantaphor
Making footsteps louder is against CAL rules, same rules for other sound commands.
Yes it would be cheating in CAL. I would never do it because i can hear everything anyways with my medusa 5.1's. But how could CAL possibly know that? They couldn't. Not that i say anyone playing in league SHOULD. Just how would you dispute that in the "My Matches" section? Could you imagine what the admins at CAL would do if you did this.


File dispute

reason cheating

Summary

Well the guy always knew where I was. (which he wouldnt be tracing the walls with something like that) I think he has his sound files for footsteps modified.

I know what would happen with the lazy AC admins at CAL.

DISPUTE CLOSED

Yeah it sucks but who knows how many CAL-I players or even some of the CAL-O players do it...

Not trying to start a conflict just saying what i thought about it in the past

BTW What division and conference are you in?
Precision is offline   Reply With Quote
Old 12-19-06, 07:25 PM   #18
tom10167
Member

 
tom10167's Avatar 

Join Date: Oct 2003
Location: Phoenix. YOUR HAIR IS GOOD TO EAT
 
How about labeling a section of the commands "illegal for x"

tom10167 is offline   Reply With Quote
Old 03-05-07, 01:51 AM   #19
itachi2k4
Member



Join Date: Jul 2005
Location: bronx,ny
 
Quote:
Originally Posted by Precision
Yes it would be cheating in CAL. I would never do it because i can hear everything anyways with my medusa 5.1's. But how could CAL possibly know that? They couldn't. Not that i say anyone playing in league SHOULD. Just how would you dispute that in the "My Matches" section? Could you imagine what the admins at CAL would do if you did this.
zblock wouldn't let u in the server with modified sound files or with sound commands that give u a advantage and cal admins aren't as lazy as u think -_-
itachi2k4 is offline   Reply With Quote
Old 04-07-07, 09:37 AM   #20
rpoc
Registered



Join Date: Feb 2007
 
zblock doesnt allow the edit to "fps_max" or "mat_picmap"

=/

Also, I havn't seen any stability or FPS performance from switching from DX9 to DX8.


I run a 7800 GTX Go on my laptop with 1 Gig Ram, and a 2 Gig P4. With lowest settings on in CS:S, I'm still scraping 30-40 frames =/


Any help would be much appreciated, this laptop was 2 grand last year, I just can't keep buying new computers, this should work fine.
rpoc is offline   Reply With Quote
Old 04-19-07, 04:52 PM   #21
MattsterMH
Member



Join Date: Jun 2006
Location: Beantown
 
I play this game occasionally with friends, I've got a 7900 gt, as well as 2 gigs of ram and dual-core 3.51 ghz OC'ed. Before I OC'ed it was 3.2 ghz, and I got like 70 fps. Basically if you have a system in the range of good to excellent, none of these are really recommended.

P.S. - Now I get 120 fps. (With the OC)

__________________
22'' AL2223W
P5N32-SLI Deluxe nF4
Pentium D 940 3.2 ghz
eVGA GeForce 8800GTS 320MB
Enermax EG565P 535W PSU
Arctic Cooling Freezer 7 Pro
CORSAIR 4GB 240-Pin SDRAM DDR2 800
160GB WD
250GB Seagate

LITE-ON Black 20X + CD-R/RW DRIVE DUAL LAYER
MattsterMH is offline   Reply With Quote
Old 07-26-07, 10:20 PM   #22
Twigglish
Member

 
Twigglish's Avatar 

Join Date: Jul 2007
 
How do you make footsteps louder?

__________________
STEELERS BABY
IX
X
GOT 6? XIII
XIV
WE DO XL
XLIII
I.M.O.G.: I'm sorry to inform you that your sig violates forum rules. Due to obscene, and frankly ugly, choices of colors you must change this. I suggest brown and orange perhaps.
lol JK... Congratulations on your season. Greetings from Cleveland, the home of "There's always next year".
cw823: I think you need to edit your sig, this could finally be a year for a Cleveland team. Go Cavs!

[PC Game Release Calendar] - [Heatware]
Twigglish is offline   Reply With Quote
Old 01-04-08, 07:22 AM   #23
Blazing fire
Member



Join Date: Sep 2007
 
Quote:
Originally Posted by MattsterMH View Post
I play this game occasionally with friends, I've got a 7900 gt, as well as 2 gigs of ram and dual-core 3.51 ghz OC'ed. Before I OC'ed it was 3.2 ghz, and I got like 70 fps. Basically if you have a system in the range of good to excellent, none of these are really recommended.

P.S. - Now I get 120 fps. (With the OC)
How does your monitor manage?

ANyway, is there such a thing as DX100 for direct 10?
Blazing fire is offline   Reply With Quote
Old 01-11-08, 07:41 PM   #24
mantaphor
Member



Join Date: Dec 2004
 
OP returns.

Quote:
Originally Posted by rpoc View Post
zblock doesnt allow the edit to "fps_max" or "mat_picmap"
I'm pretty sure that at this point ZBlock has changed, both commands work fine on ZBlock servers for me.

Quote:
Originally Posted by rpoc View Post
Also, I havn't seen any stability or FPS performance from switching from DX9 to DX8.
The 7800GTX is a native DX9 card. The real benefit of the dxlevel command is for cards that natively support DX8.1 and lower.

Quote:
Originally Posted by rpoc View Post
I run a 7800 GTX Go on my laptop with 1 Gig Ram, and a 2 Gig P4. With lowest settings on in CS:S, I'm still scraping 30-40 frames =/
The processor could be the culprit, CS:S is a very CPU-hungry game. Make sure that your processor optimization commands are enabled (r_sse, r_sse2, etc).

Quote:
Originally Posted by Blazing fire View Post
How does your monitor manage? (120fps)
Some monitors run at 120Hz or higher refresh rate. I think it's just CRTs for now, though.

Quote:
Originally Posted by Blazing fire View Post
ANyway, is there such a thing as DX100 for direct 10?
The source engine currently does not support DirectX 10. The highest settable level is 'dxlevel 95', which is DirectX 9.0c with HDR support.
mantaphor is offline   Reply With Quote
Old 03-11-08, 11:54 AM   #25
ian2000gsxr
Member



Join Date: Feb 2008
Location: Indy
 
Hey, thanks for this great guide. I have been having some issues with HL so I'll try this out.
ian2000gsxr is offline   Reply With Quote
Old 12-10-08, 01:31 AM   #26
narmada
New Member



Join Date: Dec 2008
 
Where can I get a PHP/JAVA/CSS script for viewing images on my website in the similar way as PicLens does? I want to present several images on my website.
A PHP/JAVA/CSS script would do.
A user should be able to browse through pictures in a similar way the PicLens add-on of Firefox works.
narmada is offline   Reply With Quote
Old 03-15-09, 05:46 PM   #27
jhanby
Sound & HTPC Content Editor


 
jhanby's Avatar 

Join Date: Aug 2007
Location: Peterborough, UK
 
Quite a thread resurrection, just wondering, does this stuff work on TF2 ?

John

__________________

Dell Optiplex SX260 running ubuntu
PS3 <Optical> Compass DAC/Amp -> Audio Technica AD700 / Audio Technica ATH-W5000
Currently listening to : "Come Alive" - Foo Fighters
jhanby is offline   Reply With Quote
Old 04-11-09, 12:53 PM   #28
waldo69
New Member



Join Date: Apr 2009
 
Your System Memory (In Megabytes) / 2 * 1024 = Your Heapsize

Examples:
512MB / 2 * 1024 = -heapsize 262144
1024MB / 2 * 1024 = -heapsize 524288
2048MB / 2 * 1024 = -heapsize 1048576

==========
need help..please..

I used 2048MB / 2 * 1024 = -heapsize 1048576 into my computer, how can I bring back my memory to its original size? If someone knows please post your comment. I tried a few things to bring it back but it didn't work - I uninstalled my CS:S and CS
Thanks.
Wlado69
waldo69 is offline   Reply With Quote
Old 06-02-09, 07:37 AM   #29
Malakai
Band

 
Malakai's Avatar 

Join Date: Dec 2001
Location: Fl
 
There are some new settings that help performance on multi cores, for me anyway.

r_threaded_* both to 1

__________________
Phenom II 955BE C2 3.8ghz(200x19)@1.50v, 2.2ghz CPU_NB@+0.05v | Sunbeam Core Contact 120 HSF
Gigabyte MA790GP-UD4H Mobo | 8gb(4x2) G.Skill DDR2-1066C5@1070mhz 5-5-5-15 2.1v Ganged
Sapphire HD4770 @830/4100 | WD 640 Black & WD 1TB Green HDDs | Antec New Truepower 550W PSU
Logitech z-2100e 200W 2.1 Speakers | Antec 300 4x120mm 1x140mm | Logitech MX518 Mouse
BenQ G2400WD 24" Wide | Viewsonic VP191b 19" | Windows 7 Ult 64-bit | Linksys WRT54GL w/Tomato
Scythe Slipstream 110cfm 120mm on Heatsink, 3x Silverstream 60cfm 120mm's in Case | HeatWare
Malakai is offline   Reply With Quote

Thread Tools

Forum Jump

All times are GMT -5. The time now is 11:28 PM.
Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.