CHILLMODEA/Pages/Command line options (GoldSrc)

From Valve Developer Community
Jump to navigation Jump to search
GoldSrc ( Engine | Dedicated Server )
Source Engine ( Engine | Dedicated Server )
edit

These command-line parameters will work with any GoldSource engine games (Half-Life Half-Life, Counter-Strike 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.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.
  • 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.pngNote: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.pngNote: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.pngNote: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).
Icon-Bug.pngBug:Doesn't hide window border, only control buttons.  [todo tested in ?]
-nodirectblit Disables direct Wikipedia icon 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 Half-Life (post-25th anniversary update) and Cry of Fear Cry of Fear)
When loading a game with this parameter, the intro video will not play.
Note.pngNote:In Cry of Fear Cry of Fear, This must be applied through the Steam Launch Options or the 🖿CoFLaunchApp.exe executable, as applying it directly on 🖿cof.exe may crash the game.
-port <port> Specifies which port to use for client connections for a listen server. Default is 27015.
Note.pngNote: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.pngNote: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.pngNote: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.pngNote: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.pngNote: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.pngNote: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.pngNote: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.pngNote: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.pngNote: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 Half-Life as part of it's 25th anniversary, however it instead uses the -novid command 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.