Finetuning HLDS
The Half-Life Dedicated Server software has a set of options that enables you to setup and finetune your server installation. The following tutorial describes most available and commonly used features. Behind the mentioned parameters are the options available for that parameter in brackets. Sidenote: these brackets are not to be used in the command-line, they are merely present for clarity.
This guide is geared towards HLDS 1.1.1.0, 1.1.1.1 and 1.1.1.1e (Windows). For native Linux versions and an overview of all common HLDS versions, see the version table.
Usage for Windows-based systems: Create a shortcut to HLDS.exe by right clicking on the item and selecting Create Shortcut. Then, right click on the shortcut and select Properties. Parameters should go behind the line, which ends with a quote ("), in the Target box (put them behind the ending quote).
Usage for Linux-based systems: Create an empty file with a plain text editor like vim or gedit. Place it in the root of the HLDS directory (or somewhere else, note that you'll need to correctly adjust the path). Open it and type: ./hlds_run. Behind this line you can put the parameters of your choice. Obviously you can also use any existing startup scripts you may have.
Basic Options
Parameters below are required to run a server, unless you're using a version that supports setting up by GUI (Windows only with HLDS 1.1.1.1 and up). Please note that this disables the console and support for batch startup.
On Windows, to start using the parameters below, you will at least need to set the -console parameter in order for other parameters to work. HLDS for Linux does not require this parameter as it supports console mode only.
Parameter Description
-game [moddir] Sets what modification HLDS needs to load. Example: -game cstrike
-maxplayers [x] Sets the maximum number of players that will be able to join your server. Some add-ons such as
AMX Mod (X) or AdminMod will lower this number if the reserved slots feature is enabled.
Example: -maxplayers 16
+map [map] Sets what map to load when the server has been launched successfully. Specified map has to
exist in the /maps folder of the MOD folder set with -game. A common mistake is to forget
this parameter; the server appears as offline if it has not been specified, so make sure to set it.
Example: +map de_dust2
+sv_lan [0 or 1] Determines whether server is in LAN or Internet mode. Set this to 1 in order to activate the WON2
Patch for Servers, which is required to run the server for internet use. Please note: when running
the server on a LAN HLDS is supposed to be unpatched (e.g. do not use any WON2 Patch for
Servers). Patching HLDS and setting this parameter to 1 will not activate LAN mode.
Example: +sv_lan 1
-console This parameter enables console mode and support for batch startup (e.g. for use with a
service-manager like FireDaemon), and disables the GUI. Parameter works only on
Windows, HLDS 1.1.1.1 or higher, and is required to be set in order for all other parameters
mentioned in this guide to work.
-secure Enables WAC anticheat protection. Please note: this parameter can be overridden by secure "0" in
liblist.gam in the directory of the MOD you're running. This line should be either removed or set to
"1". You must have the WON2 Patch for Players installed in your HLDS installation in order to use
WAC.
Please note: WAC is no longer operational. We recommend turning it off, as turning it on will
cause your server to start slowly as HLDS will attempt to contact the WAC servers, which have
been shut down.
The options above are sufficient to run a fully functional HLDS installation. However, in some cases you may want to fine-tune your server to perfection. In that case, continue to the Advanced Options section below.
Advanced Options
Important: some of the options below might cause HLDS to work improperly. Descriptions should be carefully read.
Parameter Description
-exec [file.cfg/.rc] Lets you run Half-Life scripts immediately after the server has been succesfully launched. Can be
useful for setting a custom server.cfg, to prevent downloading of it by unauthorized users in case
you're using HLDS 1.1.1.0, 1.1.1.1 or a native Linux version. Please note: this parameter will not
be read if HLDS encounters an error while initializing MOD files and should therefore not be used
to correct launching issues. Example: -exec customserver.cfg
-heapsize [size in KB] The Heapsize-option enables you to set the amount of 'heap' (cache) for HLDS. By default this is
set to 32 MB and will be automatically adjusted by HLDS to suit your system. However, in some
cases HLDS does not correctly adjust this option. Setting this option manually may significantly
improve HLDS performance. When deciding how big the heap should be, take into account not
just how much memory you have, but how much is used by the operating system and other
programs. Example: -heapsize 32000
-nomaster This parameter lets HLDS skip the master server entries from won/valvecomm.lst. Use this
parameter if you do not want your server to be listed on WON2. Useful when you want to host a
private server.
-noipx Disables IPX-support. IPX is not used when setting up an internet server and can therefore be
turned off safely. However, for LAN servers, IPX may be needed for a very small minority of PCs
running an older operating system (such as Windows 98/ME) to be able to join the server.
+[any cvar] Enables you to set cvars immediately after the server has been succesfully launched. Can be useful
for a cvar that you may want to change periodically. Notes: parameter will not be read if HLDS
encounters an error while initializing MOD files and should therefore not be used to correct
launching issues. Also, make sure the cvar you want to set does not already exist in server.cfg or
autoexec.cfg of the MOD you want to run. This overrides the parameter.
Example: +sv_gravity 800
Supplement: HLDS Version Table
Windows Linux Description
1.0.1.0 3.0.1.0 Half-Life version 1.0.1.0 using protocol 40, for hosting CS Beta servers up to beta 5.x.
This version is included in Half-Life 1.0.1.0. The Linux version 3.0.1.0 is a full
stand-alone package. These versions are not covered in this tutorial, but have been
added to complete the list.
1.1.1.0 3.1.1.0 Half-Life version 1.1.1.0 and higher using protocol 46, Windows version included in
4.1.1.0 Half-Life 1.1.1.0 and Counter-Strike Retail 1.0.0.5. Also available as stand-alone
package, as version 4.1.1.0 (Windows) and 3.1.1.0 (Linux).
1.1.1.1 3.1.1.1 Compatible with Half-Life version 1.1.1.0 and higher, and uses protocol 46. Version
4.1.1.1 1.1.1.1 is an update for the stand-alone package 4.1.1.0 (and not for 1.1.1.0 as that's
the version included with Half-Life; updating 1.1.1.0 with 1.1.1.1 will corrupt your
Half-Life installation!), while 4.1.1.1 is the full stand-alone package. Linux version
3.1.1.1 comes in an update package as well as a full stand-alone package. New in this
version: setting up HLDS by GUI (Windows only)
1.1.1.1e 3.1.1.1e Compatible with Half-Life version 1.1.1.0 and higher, and uses protocol 46. Version
1.1.1.1e is an update for 1.1.1.1 and 4.1.1.1 and is only available as an update
package. Linux version 3.1.1.1e is an update for 3.1.1.1. Fixed in this version:
downloading of server config and resource files (.cfg/.rc) preventing users from
downloading your server.cfg and discovering your RCON password. Note: Valve forgot
to change the built-in version number from 1.1.1.1d to 1.1.1.1e. Therefore, this HLDS
will be recognized as 1.1.1.1d by Half-Life and other tools.
2.2.0a (1.1.1.1e+) n/a Compatible with Half-Life version 1.1.1.0 and higher, and uses protocol 46. Also
supports protocol 46e (WON2 protocol), however, this protocol has been deprecated.
Version 2.3.0 has improvements and bug fixes in addition to 1.1.1.1e and has
multilingual support. Available as full stand-alone package (MODs and valve
base-directory not included; these need to be copied from Half-Life 1.1.1.0 or
Counter-Strike Retail 1.0.0.5). Not available for Linux. Download here.