Command line options (GoldSrc)

 
Command line options (frequently command line arguments or command line parameters; launch options on Steam) are additional arguments specified before the program starts, these functionally change the behavior of the program in some way, such as launching the game and start the game with the specified map directly, or play a demo for example.
Command line arguments are traditionally prefixed with a hyphen (-), but some  Windows applications (especially system ones) will use a forward slash (
 Windows applications (especially system ones) will use a forward slash (/) instead.  Quake uses plus (
 Quake uses plus (+) as a prefix for console commands or cvars that will get executed by the game as soon as it starts, and all Valve engines inherit this syntax.
Engine
These command-line parameters will work with any GoldSource engine games ( Half-Life,
 Half-Life,  Counter-Strike, etc.).
 Counter-Strike, etc.).
Syntax: hl.exe <parameter1> <parameter2> <cvar1> <cvar2>
Usage
These options can be used with:
- Hammer editor Run Map dialog.
- Windows shortcuts pointing to hl.exedirectly.
- Windows shortcuts pointing to steam.exewith the proper-applaunch <AppID>specified (see Steam section below).
- Command-line batch script files launching these applications.
- Game launch options from Steam's Library.
- Linux shell scripts pointing to the application with launch options. executable -command
Examples
- steam.exe -applaunch 70 -dev -console -sw +sv_lan 1 +map MyMap
- hl.exe -game cstrike -dev -console -fullscreen +sv_lan 1 +map de_dust
Command-Line Parameters
| Argument | Description | 
|---|---|
| -32bpp | Force 32-bit color mode (bit depth), enabled by default on Steam version of Half-Life and other GoldSrc games. | 
| +<console variable> <arg> | Sets the Cvar (or console variable) to the specified setting. | 
| -game <game> | Specifies which game/mod to run. Default is "valve". | 
| -dll <name.dll> | Specifies which server DLL to use. Ex: -dll dlls\zbotcz.dll.Also works with linux, ex: -dll dlls/zbotcz.so. | 
| -condebug | Stores console output to "Half-Life\qconsole.log".  Note:Can be toggled with condebug console command. | 
| -dev | Enables developer mode. | 
| -glext | When paired with "-dev" setting, outputs all OpenGL extensions supported by your graphics card.  Note:Can do the same with gl_dump console command. | 
| -gl | Force the game to start with OpenGL renderer. | 
| -soft | Force the game to start with Software renderer. | 
| -full or -fullscreen | Forces the engine to start in fullscreen mode. | 
| -window or -sw or -startwindowed or -windowed | Forces the engine to start in windowed mode. | 
| -w <width> or -width <width> | Forces the engine to start with resolution set to <width>. Ex:-w 1024. | 
| -h <height> or -height <height> | Forces the engine to start with resolution set to <height>. Ex:-h 768. | 
| -stretchaspect | The game by default adds black bars based on your game screen resolution. Use -stretchaspect on your command line if you want the old behavior back (just always fill the screen). Setting "-nofbo" also implies "-stretchaspect". | 
| -freq <variable> | Force a specific refresh rate when running in fullscreen AND your monitor supports the frequency in question. | 
| -mousethread | If set we poll the mouse position in another thread running at 100hz by default, to get better movement accuracy. Set the "m_mousethread_sleep" cvar to the number of seconds to sleep between mouse polls to change this rate. | 
| -joy_advanced | Use advanced joystick options (allows for multiple axes). | 
| -joy_advr, -joy_advu, -joy_advv, -joy_advx, -joy_advy, -joy_advz | Forces specific axis to use advanced joystick options. [confirm] | 
| -nosound | Disables sound support.  Note:Can do the same with nosound <0 or 1> console command. | 
| -nocdaudio | Disables MP3 support, and CD Audio in previous/retail (WON) version. Also disallows cd console command to load mp3 tracks. | 
| -wavonly | Disables DirectSound and makes the engine attempt to play all sounds in PCM format. | 
| -noip | Disables network support. Not the same as Steam Offline mode. | 
| -noipx | Disables IPX support. | 
| -nojoy | Disables joystick support. | 
| -nomouse | Disables in-game mouse support. | 
| -noforcemparms | Forces the engine to use operating system mouse parameters. | 
| -noforcemaccel | Forces the engine to use operating system mouse acceleration. | 
| -noforcemspd | Forces the engine to use operating system mouse speed. | 
| -nofbo | Disables using the new method for rendering (allowing the game to render other aspect ratio/resolutions with black bar instead of stretching it). This will also disable the built-in MSAA. | 
| -nomsaa | Disables MSAA (Anti-Aliasing). | 
| -noborder | When used with the game set to windowed mode, will make the game act as if in fullscreen mode (no window border).  Bug:Doesn't hide window border, only control buttons.  [todo tested in ?] | 
| -nodirectblit | Disables direct  blitting. | 
| -nobots | Disables bots.  Confirm:Does this work with DLL plug-ins (ex: metamod) that add bot support to games that lack it natively? | 
| -novid | (only in  Half-Life (post-25th anniversary update) and  Cry of Fear) When loading a game with this parameter, the intro video will not play.  Note:In  Cry of Fear, This must be applied through the Steam Launch Options or the  CoFLaunchApp.exeexecutable, as applying it directly on cof.exemay crash the game. | 
| -port <port> | Specifies which port to use for client connections for a listen server. Default is 27015.  Note:Can do the same with port console command. | 
| -sillygibs | Forces more gibs like skull and others to be spawned all time on NPC's death. | 
| -demoedit | Enables hidden Demo editor.  Note:Use viewdemo console command to get access. | 
| -num_edicts <variable> | Sets the edict limit. Default 1200 (20th anniversary), 900 (pre-anniversary), max 2048. Both clients and servers need matching values for best compatibility; as such, this should be set in liblist.gam instead. | 
| -heapsize <kilobytes> | Specifies the amount of heap(or free store - cache, an area of memory used for dynamic memory allocation) the engine will use. Minimum value is 14336(14 MB). Maximum value is 131072(128 MB). By default this is set to 40960 (40 MB) and automatically adjusted to suit your system.  Note:Low value causes "Unable to allocate X.X MB" exit error. | 
| -zone <bytes> | Specifies the amount of Bytes of memory for use with the console system.  Note:Low or very high value causes Z_Malloc exit error. | 
| -exec <file> | Executes specific config file immediately after the engine is loaded. | 
| -steam | Show Steam server browser button (and "Friends" in older versions) on bottom-right corner of main menu. Running without this command does not disable the ability to connect to Steam servers. Enabled by default when launching from Steam library.  Note:In older versions of Half-Life (pre-SteamPipe), on first launch it may ask for CD Key (Steam copies which are launched without this command line can simply bypass this by typing "A", but this may not work with "Half-Life 1 Anthology" retail copy which requires legit key).  Note:This command also works with WON version of the game since patch 1.1.0.9 or 1.1.1.0, but Steam-related feature will not work properly without installing Steam Beta (the game will show error due to missing gfx/shell/steam_logo.bmp, and the game will crash or fail to load a map with "SteamGetEncryptedUserIDTicket" error). Note:With Half-Life 25th Anniversary Update, the Steam server browser option was removed from the menu. | 
Useful Console Variables
| Console Variable | Description | 
|---|---|
| +_setgamedir <game> | Specifies which game/mod to run. | 
| +_setrenderer <variable> | Sets the rendering mode. Available parameters are opengl and software.  Note:Parameter D3D is deprecated. | 
| +_setvideomode | [Todo] | 
| +_set_vid_level <0 or 1> | Toggles "Low video quality". | 
| +_setaddons_folder <0 or 1> | Toggles "Allow custom addon content". | 
| +_sethdmodels <0 or 1> | Toggles "Enable HD models if available". | 
| +clientport <port> | Specifies which port to use to communicate with a server. Default is 27005. | 
| +gg <demoname> or +cl_gg 1 +playdemo <demoname> | Runs the demo in Game Gauge mode. This is a benchmark utility that runs through a demo as fast as possible and stores the framerate in the file fps.txt in the GameMod directory. | 
| +log on or +log off | Toggles logging before the engine loads config files. | 
Deprecated Command-Line Parameters
| Argument | Description | 
|---|---|
| -16bpp | Not allowed for use; would've forced 16-bit color mode (bit depth). Enabled by default in WON/Retail version of Half-Life and other GoldSrc games. | 
| -console | Enabled by default in Steam versions; it can be accessible by either pressing tilde (~) in-game or it will appear automatically.  Note:In old Half-Life builds (also known as WON/Retail version), a button to open Console is added, but the tilde (~) key will be non-functional on the main menu, only works in-game. | 
| -d3d | Removed since 2013 SteamPipe update. This will set the renderer to Direct3D 6. | 
| -gamegauge <demoname> | Use console commands instead. Runs the demo in Game Gauge mode. This is a benchmark utility that runs through a demo as fast as possible and stores the framerate in the file fps.txt in the GameMod directory. | 
| -gldrv <driver name> | Was for selecting the GL Driver to use from two choices: "Default" and "3dfxgl.dll" (for 3dfx Voodoo cards). | 
| -noaff | Would've disabled setting of thread affinity. | 
| -noextracds | Retail/WON version only. Prevent the game from switching to 640x480 resolution when loading the menu. | 
| -notopmost | Doesn't mark the game's windows as topmost (Always on Top) in fullscreen mode. | 
| -nosierra | Retail/WON version only. Intro video support was already removed when the games were transferred to Steam, but was eventually restored in  Half-Life as part of it's 25th anniversary, however it instead uses the -novidcommand in order to disable startup intro.Despite it's mention Sierra, it does skip both Sierra and Valve intro. | 
| -nowinmouse | Renamed to -nomouse in newer versions. | 
| -numericping | Enabled by default; displays ping in server browsers in milliseconds instead of dots. | 
| -particles <variable> | Would've set the number of particles for which is set aside buffer space. | 
| -toconsole | Would've shown the console when the game launched. | 
| -vid_mode <variable> / -vt <variable> | Use -gl or -soft instead; would've set the rendering mode to either one of two choices: gl or software. | 
Dedicated Server
These command-line parameters are used with hlds.exe for Goldsource (Half-Life) games.
Syntax: hlds.exe <parameter1> <parameter2> <cvar1> <cvar2>
Examples
- hlds.exe -console -game cstrike +sv_lan 0 +maxplayers 22 +map de_dust2
- ./hlds_run -game cstrike -autoupdate -pingboost 2 -port 27016 +maxplayers 20 +map de_dust2
Command-Line Parameters
| Argument | Description | 
|---|---|
| -condebug | Stores console output to "Half-Life\qconsole.log".  Note:Can be toggled with condebug console command. | 
| -dev | Enables developer mode. | 
| -autoupdate | Autoupdate the game. Requires -steam_dir and -steamcmd_script to be set (Linux/Unix only) | 
| -console | HLDS will run in console mode (Windows only). | 
| -game <game> | Specifies which game/mod to run. Default is "valve". | 
| -dll <name.dll> | Specifies which DLL to use. Ex: -dll addons\metamod\dlls\metamod.dll. | 
| -nomaster | Disable communication with Master server. Use this parameter if you do not want your server to be listed in Server Browser.  Note:Also disables server queries. | 
| -insecure | Starts the server without Valve Anti-Cheat. | 
| -port <port> | Specifies which port to use for client connections. Default is 27015.  Note:Can do the same with port console variable. | 
| -sport <port> | Specifies the VAC port the server should use. Default is 26900.  Note:You only need to change -sport if VAC connections fail through the primary port. | 
| -noip | Disables network support. Not the same as Steam offline mode. | 
| -noipx | Disables IPX support. | 
| -tos | Enables the LOWDELAY TOS header in the udp/ip packets the server generates. (Linux only) | 
| -nobreakpad | Let plugin authors still get old style minidumps if they need it (win32 only) | 
| -num_edicts <variable> | Sets the entity limit for map/game entities (not temporary entities, which is still locked to 500). 900 is default. 4096 is a good limit, beyond that seems to cause hunk_alloc errors[confirm]. Both clients and servers need matching values for best compatibility[confirm]. | 
| -heapsize <kilobytes> | Specifies the amount of heap(or free store--cache, an area of memory used for dynamic memory allocation) the engine will use. Minimum value is 14336 (14 MB). Maximum value is 131072 (128 MB). By default this is set to 40960 (40 MB) and automatically adjusted to suit your system.  Note:Low value causes "Unable to allocate X.X MB" exit error. | 
| -zone <bytes> | Specifies the amount of Bytes of memory for use with the console system.  Note:Low value causes Z_Malloc exit error. | 
| -maxplayers <number> | Sets the maximum number of players that will be able to join your server.  Note:Can do the same with maxplayers console variable. | 
| -sys_ticrate | Overrides sys_ticrate cvar. | 
| -exec <file> | Execute specific config file immediately after the engine is loaded. | 
| +<console variable> <arg> | Sets the Cvar (or console variable) to the specified setting. | 
Useful Console Variables
- +hostname "Server Name" - Specifies the name of the server.
- +ip <address> - Specifies the IP when multiple network cards are installed. Required for VAC2 operation. Note:Usually you do not need to specify this. Note:Usually you do not need to specify this.
- +map <map> - Specifies which map to start with.
- +sv_lan <0/1> - If set to 1, server is only available in Local Area Network (LAN).
- +mapchangecfgfile <file> - Like Server.cfg, ran after every round change, before Plugins are started.
- -pingboost <1/2/3> - Selects between optimized HLDS network code stack. Set this on 2 usually reduces latency toward 1ms without loss of activity input packets.
























