Command Line Options

From Valve Developer Community

Jump to: navigation, search
Русский 日本語

Contents

[hide]

Source Games

These command-line parameters will work with any Source engine games (Half-Life 2, Counter-strike: Source, etc.).

Note:Command parameters are described inside the < and > characters.

Syntax: hl2.exe <parameter1> <parameter2> <cvar1> <cvar2>

Usage

These options can be used with:

  • Hammer editor Run Map dialog.
  • Windows shortcuts pointing to hl2.exe directly.
  • Windows shortcuts pointing to steam.exe with the proper -applaunch <AppID> specified (see Steam section below).
  • Command-line batch script files launching these applications.

Examples

  • steam.exe -applaunch 280 -dev -console -sw +sv_lan 1 +map MyMap
  • hl2.exe -game cstrike -dev -console -fullscreen +sv_lan 1 +map de_dust

Command-line parameters

  • -autoconfig - Restores video and performance settings to default for the current hardware detected. Ignores settings inside any .cfg files until this parameter is removed.
  • -32bit - Forces the engine to start in 32-bit mode. Only useful on 64-bit Operating Systems.
  • -adapter -
  • -allowdebug -
  • -allowstalezip -
  • -basedir -
  • -bi -
  • -bugbait - To do: Is it for Bugbait E3 2003 demo?
  • -bugreporterdll -
  • -buildcubemaps -
  • -condebug - Logs all console output into the console.log text file.
  • -console - Starts the game with the developer console enabled.
  • -defaultgamedir -
  • -demo -
  • -dev - Enables developer mode. Also disables the automatic loading of menu background maps and stops the quit dialog from appearing on exit.
  • -dti -
  • -dumpvidmemstats -
  • -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 (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.
  • -edit -
  • -endgamevid -
  • -exit - Exits the engine. [confirm]
  • -filmgrain -
  • -flushlog -
  • -forcestartupmenu -
  • -forever -
  • -full_memory_dumps -
  • -fullscreen or -full - Forces the engine to start in fullscreen mode.
  • -g15 - Enables Logitech G15 support. G15 is only supported in SiN Episodes: Emergence. [confirm]
  • -game - Sets game or mod directory to load the game from. Default is "hl2".
  • -gamestatslogging -
  • -gamestatsloggingtofile -
  • -h <height> or -height <height>- Forces the engine to start with resolution set to <height>. Ex: -h 768
  • -heapcheck -
  • -heapsize <kilobytes> - Specifies the heapsize (in kilobyte) the game will use. This no longer exists on the Source 2009.
  • -hideconsole -
  • -high - Sets the game's priority to High
  • -hijack - Take control of an existing instance of the game, if any, instead of complaining about already running.
  • -hushasserts -
  • -hushsteam -
  • -insecure - Disable VAC.
  • -internalbuild - Unknown, used in Portal 2 IHV build.
  • -ip -
  • -leakcheck -
  • -low - Sets the game's priority to Low.
  • -makedevshots - Stops Entities from Fading [confirm]
  • -makereslists -
  • -mat_aaquality -
  • -mat_antialias -
  • -mat_vsync -
  • -maxplayers -
  • -minmemory -
  • -navanalyze -
  • -navforceanalyze -
  • -netspike -
  • -noassert -
  • -noborder - When used with the game set to windowed mode, will make the game act as if in fullscreen mode (no window border).
  • -nobreakpad -
  • -noclearsave -
  • -nocrashdialog - Suppresses some 'memory could not be read' unhandled errors.
  • -nodev -
  • -nodns -
  • -noforcemaccel - Use the Windows mouse acceleration settings. Only works if -useforcedmparms is set.
  • -noforcemspd - Use the Windows mouse speed settings. Only works if -useforcedmparms is set.
  • -nogamedll -
  • -nogamestats -
  • -nohltv -
  • -noip -
  • -NoLoadPluginsForClient -
  • -nomaster -
  • -nomessagebox -
  • -nominidumps -
  • -nomouse -
  • -nop4 - Forces the Engine to bypass Perforce Integration
  • -nopreload -
  • -nopreloadmodels -
  • -NoQueuedPacketThread -
  • -norebuildaudio -
  • -noshaderapi -
  • -nosound -
  • -NoVConfig -
  • -novid - When loading a game with this parameter, the intro Valve video will not play.
  • -particles -
  • -phonehome - Unknown, used in Portal 2 IHV build.
  • -pidfile -
  • -pme -
  • -port <variable> - Sets port for a listen server. Default is 27015.
  • -preload -
  • -primarysound -
  • -publicbuild -
  • -random_invariant -
  • -rebuildaudio -
  • -recapvid -
  • -ref -
  • -refresh <rate> or -refreshrate <rate> or -freq <rate>- Force a specific refresh rate. Ex: -refresh 60
  • -requirecubemaps -
  • -resizing -
  • -reslistdir -
  • -reuse -
  • -rpt -
  • -safe -
  • -shaderapi -
  • -sillygibs -
  • -small -
  • -sndcachedebug -
  • -spewsentences -
  • -startmap -
  • -startstage -
  • -steam - Enables Steam support (if the game is launched from Steam, this is enabled by default). Working directory must be Steam directory. Works only for singleplayer games.
  • -steamlocal - Same as -steam.
  • -steamport -
  • -sv_benchmark -
  • -swapcores -
  • -tempcontent -
  • -testscript <filename> - Loads a .vtest file.
  • -testsub -
  • -textmessagedebug -
  • -textmode - Runs the game without graphics
  • -threads -
  • -timedemoloop -
  • -toconsole - Starts the engine directly in the console, unless a map is specified with +map.
  • -tools - Enables engine tools.
  • -trackdeletions -
  • -tvmasteronly -
  • -usedevshotsfile -
  • -useforcedmparms - Allows the use of -noforcemspd and -noforcemaccel.
  • -uselogdir -
  • -usercon -
  • -usereslistfile -
  • -usetcp -
  • -vcrrecord -
  • -vguimessages -
  • -vproject -
  • -w <width> or -width <width> - Forces the engine to start with resolution set to <width>. Ex: -w 1024
  • -wavonly - Disables DirectSound and makes the engine attempt to play all sounds in PCM format.
  • -window or -sw or -startwindowed or -windowed - Forces the engine to start in windowed mode.
  • -x <x position> - In borderless windowed mode, determines where the window should be horizontally. Ex: -x 0
  • -y <y position> - In borderless windowed mode, determines where the window should be vertically. Ex: -y 0
  • +connect - Console Command
  • +load - Console Command
  • +mat_hdr_level - Console Command
  • +maxplayers - Console Command
  • +playdemo - Console Command
  • +port - Console Command
  • +timedemo - Console Command
  • +timedemoquit - Console Command

Console variables

  • +<console variable> <arg> - Sets the Cvar (or console variable) to the specified setting.

Some useful console variables

  • +map <map name> - Loads the map specified after the engine starts.
    Note:the .BSP extension is not needed.
  • +map_background <map name> - Forces a specified background map to be used. Useful for testing custom background maps. To avoid loading standard background maps for speed reasons, use the -dev command-line parameter.
  • +sv_lan <0/1> - When set to 1, launches the game in LAN mode. Useful to stop players from joining your game from the Internet.
  • +sv_cheats <0/1> -- When set to 1, starts the game with cheats enabled.
  • +physcannon_mega_enabled 1 - Makes Gravity gun a super gravity gun
  • +cl_showfps <0/1/2/3> -- When set to 2, shows the framerate and map name.

Goldsource Games

These command-line parameters will work with any Goldsource engine games (Half-Life, Counter-Strike, etc.).

Note:Command parameters are described inside the < and > characters.

Syntax: hl.exe <parameter1> <parameter2> <cvar1> <cvar2>

Usage

These options can be used with:

  • Hammer editor Run Map dialog.
  • Windows shortcuts pointing to hl.exe directly.
  • Windows shortcuts pointing to steam.exe with the proper -applaunch <AppID> specified (see Steam section below).
  • Command-line batch script files launching these applications.

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

  • -condebug - Stores console output to "modname\qconsole.log". Can be toggled with "condebug" console command.
  • -console - Enables console. Can be opened either from menu (button in top-left corner in old Half-Life builds or button in main menu in new builds), or by pressing tilde (~) in-game. Does not work in Steam version of Half-Life because the console is always enabled.
  • -d3d - Sets the rendered to Direct3D.
  • -dev - Enables developer mode.
  • -freq <variable> - Force a specific refresh rate. ReForce may be required.
  • -full - Forces the engine to start in fullscreen mode.
  • -game <variable> - Sets game or mod directory to load the game from. Default is "valve".
  • -gamegauge <demoname> - Runs the demo in demoname.dem in benchmaking mode and saves the results in fps.txt file. 1.0.0.9+ only. Can do the same thing in-game with cl_gg 1; gg in the console.
  • -gl - Sets the rendered to OpenGL.
  • -h <height> or -height <height>- Forces the engine to start with resolution set to <height>. Ex: -h 768
  • -heapsize <kilobytes> - Specifies the heapsize (in kilobyte) the game will use.
  • -joy_advanced -
  • -joy_advr, -joy_advu, -joy_advv, -joy_advx, -joy_advy, -joy_advz -
  • -numericping - Displays ping in server browsers in milliseconds instead of dots.
  • -nointro - Disables intro movies.
  • -noip - Disables TCP/IP support.
  • -noipx - Disables IPX support (not supported in Half-Life).
  • -nojoy - Disables joystick 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.
  • -nosierra -
  • -nowinmouse -
  • -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. Both clients and servers need matching values for best compatibility.
  • -particles <variable> - Variable number is the number of particles for which to set aside buffer space.
  • -port <variable> - Sets port for a listen server. Default is 27015.
  • -soft - Sets the rendered to Software.
  • -toconsole - Opens the console right when the game is launched.
  • -vid_mode <variable> or -vt <variable> - Sets the rendering mode. Available parameters are d3d, gl and software.
  • -w <width> or -width <width> - Forces the engine to start with resolution set to <width>. Ex: -w 1024
  • -wavonly - Disables DirectSound and makes the engine attempt to play all sounds in PCM format.
  • -window or -sw or -startwindowed or -windowed - Forces the engine to start in windowed mode.
  • -zone <variable> -
  • +<console variable> <arg> - Sets the Cvar (or console variable) to the specified setting.

Steam (Windows)

These command-line parameters work when launching the Steam application (steam.exe) under Windows.

Command-line parameters

  • -applaunch %id %c - This launches an Game or Application through Steam. Replace the %id with the Game/Application ID number that you want to open up, replace %c with the command line parameters for the game as listed in the Source Games section above.
  • -cafeapplaunch - Launch apps in a cyber cafe context (Forces apps to be verified / validated before launch).
  • -clearbeta - Opts out of beta participation (in case for some reason it can't be done via settings).
  • -complete_install_via_http - Run installation completion over HTTP by default.
  • -console - Enables the Steam debug console tab.
  • -ccsyntax - Spew details about the localized strings we load.
  • -debug_steamapi - Enables logging of Steam API functions.
  • -developer - Sets the 'developer' variable to 1. Can be used to open the VGUI editor by pressing F6 or VGUI zoo by pressing F7. Intended for skin development.
  • -fs_log - Log file system accesses.
  • -fs_target - Set target syntax.
  • -fs_logbins - Log the binaries we load during operation.
  • -forceservice - Run Steam Client Service even if Steam has admin rights.
  • -gameoverlayinject - Sets the method how GameOverlay is injected.
  • -install %p - Install a product from a specified path (e.g. "D:" for the DVD-ROM drive if D: is one).
  • -installer_test - changes installing a retail game to emit all files to install_validate/ folder instead of to the steam cache.
  • -language %l - Sets the Steam language to the one specified. (Examples: "english", "german").
  • -login %u %p - This logs into Steam with the specified Username and Password combination. Replace %u with the username, and %p with the password you want to login with (Steam must be off for this to work).
  • -lognetapi - logs all P2P networking info to log/netapi_log.txt.
  • -log_voice - writes voice chat data to the logs/voice_log.txt file.
  • -noasync - Don't use async file operations, run them synchronous instead.
  • -nocache - This starts steam with no cache (Steam must be off for this to work properly).
  • -no-dwrite - forces vgui to use GDI text even if DWrite support is available.
  • -script %s - This runs a Steam script. Replace %s with the script filename. All scripts must be in a subdirectory of the Steam folder called test scripts (Steam must be off for this to work).
  • -shutdown - This shuts down (exits) Steam.
  • -silent - This suppresses the dialog box that opens when you start steam. It is used when you have Steam set to auto-start when your computer turns on. (Steam must be off for this to work).
  • -single_core - Force Steam to run on your primary CPU only.
  • -tcp - forces connection to Steam backend to be via TCP.
  • -voice_quality - sets audio quality, range [1,3].
  • -voicerelay - Only allow 'relay' connections for voice (testing).

hldsupdatetool (Windows), Steam (Unix)

Syntax: hldsupdatetool -command <command> [parameters] [flags]

Commands

  • -command update - Install or update HLDS.
  • -command version - View installed versions.
  • -command list - View available games.

Parameters

  • -game <game> - The name of the game to install (see enumeration).
  • -dir <installdir> - HLDS Install directory (if dir not specified, will use value from last run of tool).

Flags

  • -verify_all - Verify all HLDS files are up to date.
  • -retry - Automatically retry every 30 seconds if the Steam Network is busy.
  • -remember_password - Remember password (if a username is supplied).

Optional parameters

These are only needed to access limited content.

  • -username <username> - Steam account username
  • -password <password> - Steam account password


Source Dedicated Server

Command-line arguments for the Source Dedicated Server executable (srcds.exe, srcds_run)

Command-line parameters

-allowdebug
(Same as -debug ?)
-autoupdate
The server is searching for updates on startup (Linux/Unix only).
-console
SrcDS will run in console mode (Windows only).
-debug
Debug Mode.
-dev
Show developer messages.
-game <game or path>
Specifies which game/mod to run. Accepts either a path to a gameinfo.txt, or one of these pre-set values.
-insecure
Will start the server without Valve Anti-Cheat.
-ip
Specifies the address to use for the bind(2) syscall, which controls on which IP addresses the program is reachable on. It must either be a local address (an addresses of the host it runs on) or 0.0.0.0 (the wildcard). This has nothing to do with externally-visible addresses in NAT setups.
-maxplayers <number>
Specifies how many player slots the server can contain.
-nobots
Disable bots.
-nohltv
Disables SourceTV and closes its port (usually 27020).
-norestart
Won't attempt to restart failed servers.
-port
The port the server advertises to clients.
-steam
Use this (along with -console) when you are running the version of SRCDS downloaded through Steam.
-tickrate <number>
Specifies Server-Tickrate (for more info see Source Multiplayer Networking). This doesn't exist on TF2, CSS, L4D, and L4D2.
-timeout <number>
Sleep for <number> seconds before restarting a failed server.

Console variables

  • +<console variable> <arg> - Sets the Cvar (or console variable) to the specified setting.

Some useful console variables

  • +hostname "Server Name" - Specifies the name of the server.
  • +ip - Specifies the IP when multiple network cards are installed (Old, but still works).
  • +map <map> - Specifies which map to start.
  • +maxplayers <number> - Specifies how many player slots the server can contain (Old, but still works).
  • +hostport <port> - Specifies the host port (Port specification before -port was added, but can still be used).
  • +clientport <port> - Specifies the client port (The port the server advertises to clients, the same as -port and clientport in console)
  • +sv_lan <0/1> - If set to 1, server is only available in Local Area Network (LAN).

Linux command options in Left 4 Dead (2)

The linux version of Left 4 Dead and Left 4 Dead 2 dedicated server added extra server commands.

As part of the forking functionality mentioned below, the server parameters support substitution. For instance, if you specify +exec autoexec##.cfg, then the first server will execute autoexec01.cfg, the second autoexec02.cfg, and so on.

  • -netconport <number> - Creates a remotely accessible server console on the specified port. This can be connected to with telnet or similar applications, and allows controlling of the server as if the commands were being typed in at the console
  • -netconpassword "password" - It set, users must type PASS "password" to use the remote console described above
  • -fork <number> - Starts up the specified number of servers at once. They will each use the first available port number at 27015 or above.

Half-Life Dedicated Server

These command-line parameters are used with hlds.exe for Goldsource (Half-Life) games.

Command-line parameters

  • -autoupdate - The server is searching for updates on startup (no longer works?).
  • -console - HLDS will run in console mode (Windows only).
  • -dll <dll> - Specifies which game DLL to use first (i.e. Metamod) without modifying liblist.gam.
  • -game <game> - Specifies which game/mod to run.
  • -insecure - Disables Valve Anti-Cheat technology.
  • -sport <port> - Specifies the VAC2 port the server should use.
  • -num_edicts <variable> - sets the entity limit for map/game entities (not temporary entities, which is still locked to 500). 900 is default, so don't go under that. 4096 is a good limit, beyond that seems to cause hunk_alloc errors. Both clients and servers need matching values for best compatibility.

Console variables

  • +<console variable> <arg> - Sets the Cvar (or console variable) to the specified setting.

Some useful console variables

  • +hostname "Server Name" - Specifies the name of the server.
  • +ip - Specifies the IP when multiple network cards are installed. Required for VAC2 operation.
  • +map <map> - Specifies which map to start with.
  • +maxplayers <number> - Specifies how many player slots the server can contain.
  • +port <port> - Specifies which port to open for client connections. Default is 27015.
  • +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.

Example startup command for HLDS on Linux

./hlds_run -game cstrike -autoupdate -pingboost 2 +maxplayers 20 +mapchangecfgfile "mapchange.cfg" +map de_dust2 -port 27015 -sport 27035 +ip 62.93.204.15

"C:\HLDS\hlds.exe” -console -game cstrike +ip 69.68.67.66 +sv_lan 1 +maxplayers 22 +map de_dust2 -nomaster (More Examples[1])

Troubleshooting the Server Console

Specifying a map is necessary, otherwise the server is not ready to accept connections from players to your server. You may wish to specify the "ip" and "port" parameters if you are experiencing problems.

Note:This only applies to dedicated servers.

See also

Developer Console

Personal tools
Namespaces
Variants
Actions