News | Files | Message Boards | Discord | Twitter

"...quite possibly the best Half-Life mod of all time." -ModDB

 

    Site Links

  Current News
 
News Archive
  Team Members
  Submit a Map
  Links Section
  Discord Channel
  Message Forums
 

    Sven Co-op

  Game Manual
 
Features/Changes
 
Support the Mod
  Entity Guide
  The FAQ
 
Files Section
 
  Download SC!
 

    Media

  Map Screens
 
Weapon Screens
 
Enemy Screens
 

    Articles

  Map Making Info
  Server Guide
  SC Nostalgia

    Search

 
 
  
  

Powered by STEAM


Link to us


Setting up a HLDS for Sven Co-op (By MrMagic)

 

1.0 INTRO:

This is a guide to help people set up and run a dedicated SvenCoop server from scratch. Of course there is the listen server but this is not covered here.

This is also only for the Microsoft operating systems at the moment. Please note that this is not the ONLY way to do this. Nor are my recommendations final. These are my preferences and ways of doing it, but rest assured that I have got to these after 4 years of running a HL server in one guise or another.

Also I am assuming a reasonable level of windows understanding. If you can't do things like format drives, set security on drives, extract zip files you shouldn't be running a server, sorry.

 

1.1 DEFINITIONS:

Dedicated server - this is the HLDS.exe program. You can download it from a number of sites. It is also included in the Half-life install you can find it in the HL dir. 

Listen server - this is someone running steam. (You could argue that all HL games run as a server and client config. Even the single player ones, but they just have a max player limit of 1 and run on the same machine) 

  • SERVER.CFG This file is in the mod directory (i.e. E:\HLSERVER\Svencoop) it configures the server to your needs.

  • AUTOEXEC.CFG Again this file is in the mod directory, it passes the server things it needs to start running, (i.e. maxplayers / map etc) A lot of the things in this file you can specify on the shortcut but I like to keep everything neat and tidy and easy to manage!
     

  • MOTD.TXT This is a file in the mod directory that will display a message to all users when they join a server and when a new map starts.
     

  • MAPCYCLE.TXT This is a file that tells the server what maps to cycle through.

  • NTFS New Technology File System. This is a type of file system used by Windows 2000 or XP. It is FAR superior to FAT or FAT32. It supports file sizes greater than 2 GB, it has security (ultra important for server ops), and audit trailing. (This means you can get logs of who has accessed your files)

  • USERS.INI Adminmod file that holds all your users wonid, password and access level.

  • PLUGIN.INI Adminmod file that holds all your plugins for Adminmod.

  • MAPS.INI Adminmod file that holds all the maps you can vote for.

  • PLUGINS Think of these as small programs that you can load into Adminmod to INCREASE its functionality.

  • METAMOD.INI Metamod file that holds the list of mods for HL, one of which is ADMINMOD.

  • NPAT � Network and Port Translation. This is when your firewall accepts requests from a live internet IP address and then forwards that request to whatever internal IP or Port you specify.

  • Uncomment � Means delete the // at the start of a line, normally in cfg files.

 

1.2 REQUIREMENTS:

Before trying to run a server, make sure your server meets the requirements:
It depends on the size of the server you intend to run; The larger you intend the server to be, the more you will need. The recommended minimum is a 6 player server so let's work off that premise.

Memory: - 256mb
Processor: - PII 500 MHz
Hard Drives: - One HD for OS, One HD for Server and data files. Size does not matter, as long as you have enough space.
OS: - Windows 2000 / 2003 / Windows XP Professional

Connection: - Firstly, work out how many players you could have. Lets say you were running on 512 down / 256 up ADSL, and your players are normal dialup users, 56kb/s
256 /56 = 4.57 players.
Not everyone is downloading at 56kb so you can make it a round six.
Remember that a lot of players will have ADSL or cable, so they will be pulling more than the dialup users. This can be regulated by using the rate command however.

So why 256mb ram? The server can be run on 128mb, but Windows 2003 running on its own can have a memory footprint of 70mb, that leaves you with 50 MB for HLDS. (You can disable services etc, but this is not covered in this document).

If you run anything else on the server it may run badly. That means players might not play on your server!

Why have I not said use WIN98 / Millennium? These products have poor memory management, no security, and poor multitasking.

 

1.3 NETWORKING:

If you're running a game server it's likely that your machine will attract a lot more attention. People will now know your IP address, whereas before they would have to have scanned for it.

Most people running servers these days are on ADSL or use a work Internet connection, if your servers at work you might need to speak to the network admin to get them to open up the server ports for your server. (For Ports see below) 

If you�re running on home ADSL your ADSL modem / router will protect your server by using PNAT or will have its own firewall. Configure it and use the firewall part, or use port forwarding and only open up the ports defined below.

Two choices here, most people go for;

UDP 1200
UDP 27000 � 27015
TCP 27030 � 27039

I prefer;

UDP 1200
UDP 27010
UDP 27015
TCP 27030

Open up your security policy editor on your server (Start, Programs, Admin Tools, Local Security Policy) and set auditing on your file system and set it to audit for logon events and failed logons. (Local Policies, Audit Policy, Audit Logon Events & Audit Account Management) If this all sounds too much for you then unplug your DSL connection and send it back! To be honest, if you have a DSL or cable connection, you should be doing the above whether or not you are running a server.

 

2.0 DOWNLOADING THE FILES:

This will cover the files you need to get your server up and running. It's best to save all these in a single folder. That could take a lot of the pain out of a reinstallation in the future if you have the files handy. 

First the server program. Latest version is 1120, you can get the full server program from a number of sources, my favorite is:
http://www.fileplanet.com/files/130000/130426.shtml

Then you will need to get the Sven Coop executables. This can be found:
http://www.svencoop.com/mirrors.php

Then you will need to download some extra maps for your server, I suggest downloading everything on the maps page:
http://www.svencoop.com/files

Next is Adminmod, you can get this from:
http://prdownloads.sourceforge.net/halflifeadmin/halflife-admin-2.50.59.zip?download

Last thing you need is the modified metamod.dll this has been known to help SC3 dedicated servers from crashing.
ftp://ftp.waes.ac.uk/halflife/metamod/

Once you have got all the files proceed to the next section.

 

2.1 PREP DRIVE:

First if possible, format the drive that will hold the dedicated server. Make sure you use NTFS NOT FAT32. Once this has been completed, you will need to organize the server security. 
Open explorer, click on the drive letter and press the right mouse button. 
Go down to properties and left mouse click.
Then click on the 'security' tab.
Click on everyone in the white box and click 'remove'
Now click 'add', then add your login name; system; administrators and click ok twice. This will take you back to explorer.

 

2.2 INSTALL HLDS:

Go to the directory you downloaded your server files to.

Find the server program and run it.

Click "next" at the welcome screen. "I agree" at the EULA. "Next" at the read-me page.

Now we are at the install destination screen. Click "Browse", leave the folder name as HLSERVER but change the drive letter to your newly formatted drive i.e. E:\ Then click "OK". Now click "next", then �next� again and the files will copy to your HD.

Select the region of your server, then press �Next�. Click on "Next" again then "Finish"

 

2.3 UPDATE HLDS:

If you then run HLDS it will inform you that the server is out of date. To update it run HLDS update tool, to do this you will need a steam account. Lets create one (If you have a steam account skip this step)

CREATING A STEAM ACCOUNT
You will need to run the update tool with the �create parameter, and then specify an email address as your username and a pass phrase and answer. E.g.
 
E:\HLSERVER\HLDSUPDATETOOL -CREATE PFAGG@STOMP-SYSTEMS.CO.UK MYPASSWORD "MY CAR" "CIVIC TYPE R"

You should then see:

Checking bootstrapper version ...
Getting version 4 of Steam HLDS Update Tool
Downloading. . . . . . . . . .

THAT�S IT! Account Created

UPDATING HLDS.EXE
Now run HLDS Update Tool with the �update parameter and your steam ID. EG;
E:\HLSERVER\HLDSUPDATETOOL -UPDATE VALVE PFAGG@STOMP-SYSTEMS.CO.UK MYPASSWORD

You should then see:

Checking bootstrapper version ...
Updating Installation
Logging in as 'djmrmagic@hotmail.com'
Updating 'Win32 Server Engine' from version 0 to version 5
Downloading: .\platform\Admin\admin_schinese.txt
Downloading: .\platform\Admin\AdminServer.dll
Downloading: .\platform\Admin\server_french.txt
Downloading: .\platform\Admin\server_german.txt
Downloading: .\platform\Admin\server_italian.txt
Downloading: .\platform\Admin\server_schinese.txt
Downloading: .\platform\Admin\server_spanish.txt
Downloading: .\platform\Admin\server_tchinese.txt
Downloading: .\platform\resource\TrackerScheme.res
Downloading: .\platform\resource\vgui_french.txt
Downloading: .\platform\resource\vgui_german.txt
Downloading: .\platform\resource\vgui_italian.txt
Downloading: .\platform\resource\vgui_korean.txt
Downloading: .\platform\resource\vgui_schinese.txt
Downloading: .\platform\resource\vgui_spanish.txt
Downloading: .\platform\resource\vgui_tchinese.txt
Downloading: .\FileSystem_Stdio.dll
Downloading: .\FileSystem_Steam.dll
Downloading: .\hlds.exe
Downloading: .\HLTV-Readme.txt
Downloading: .\hltv.exe
Downloading: .\Steam.dll
Downloading: .\swds.dll
Downloading: .\vgui2.dll

Updating 'HL base content' from version 0 to version 3
Downloading: .\valve\dlls\hl.dll
Downloading: .\valve\dlls\hl_amd64.so
Downloading: .\valve\dlls\hl_i386.so
Downloading: .\valve\liblist.gam

HLDS installation up to date

Cool, it�s all done.

 

2.4 EXTRA FILES:

You might need to copy over a couple of extra files. These are PAK0.PAK and SPRAYPAINT.WAD. Whenever I install, the HLDS installation does NOT install these files, but some maps need them. You must put them in the valve folder. IE. E:\HLSERVER\VALVE You will need to copy these from your HL game directory.

 

2.5 GETTING IT RUNNING:

Firstly, create a shortcut on the desktop to the HLDS.exe file in your HLSERVER folder. Now navigate to the valve directory under HLSERVER, create a text file called autoexec.cfg (Make sure you have got "view file extensions for known types" set to on. It is also a good idea to set "display full file path" to on. Otherwise you may create a file called autoexec.cfg.txt and it will not work)
Open this file in notepad, you will need to enter some parameters for the server to run. You can use // to add comments to the file that the server will ignore. Save the file one you are finished.
Here is an example;

//MrMagics autoexec cfg Ver 1.1
//Max number of players on server
maxplayers 6
//Server Port No
port 27015
//Starting Map
map crossfire

The install program should already have created a Server.cfg with some basic commands. The only thing you will have to change is the hostname line. Make sure you uncomment the line first, and then enter the name of your choice, then save the file. Now you should have a very basic HL deathmatch server. To start it, click on the shortcut on the desktop. If all is well you should see the GUI on the screen, something like the picture below.

 

Click �Start Server� and the server will start. You can then navigate the various functions using the tabs at the top of the server window.

Most people though like to use the console. To do this you need to modify the shortcut that starts your server, put �console at the end of it. So it should look like,

"E:\HLSERVER\HLDS.EXE �console�

Start the server again and you should be back to the familiar console box.

 

Look in the black console window, you should also be able to see, "Steam Auth Server" - this means your server has announced itself to the Steam Servers. These are the servers that the clients query when they search for servers. If you are getting "Auth Server" then your server is NOT talking to the Steam servers and no-one will be able to connect. You should also see the server IP address shown; this will properly be the LAN address of your server, IE 192.168.0.1 THIS IS PERFECTLY NORMAL. If you are not seeing Steam Auth Server you will need to configure your router / modem to allow the Steam ports through.

First stage is over.

Click to enlarge

 

3.0 INSTALLING AND RUNNING SVENCOOP:

Go to your downloads dir, find your SvenCoop executable and run.

Click on the dialog.

Click next at the readme page, and yes at the next text page (After reading it first!). Now the install programm should find your server directory. If it does not, then manually navigate to it. You only need to go to the server root, i.e. E:\HLSERVER, then click "Next".
You will get a message saying that Setup was unable to detect if you are a WON or Steam server. Steam Server is already selected so just click �Continue�.

You are now at the Single Player Maps Install Page, I don�t like them and always select �Install Without Support� but its up to you, then click �Next�

Click �Next� at the Install High Def content, now the files will start to copy over.

Click �Close� at the finished dialog box.

Right mouse click the shortcut on your desktop and go down to properties, on the "Target" line go to the end of the line and put -game SvenCoop So you should have:

"E:\HLSERVER\HLDS.EXE _CONSOLE -GAME SVENCOOP�

Now navigate to your HLSERVER\SVENCOOP folder and open up server.cfg.

Uncomment the hostname line and put in your own hostname.
Uncomment the rcon password line and put in a password
Uncomment the region line and use 255 for the world.
 

Open up autoexec.cfg, delete whatever is in there, and put our server startup commands in it, e.g.;

//MrMagics autoexec cfg Ver 1.1
//Max number of players on server
maxplayers 6
//Server Port No
port 27015
//Starting Map
map crisis2

Save the file.

Double click the new icon, the console should launch, this time the starting map is crisis2. Check to make sure that you are getting the "Steam Auth Server" message and then just wait for people to join! You now have a Sven Co-op server.

 

3.1 ADDING MAPS TO YOUR SVENCOOP SERVER:
Hopefully you've taken my advice and have already downloaded the extra maps. Now using WinZip, (If your using Win XP it will open them on its own) extract the map files to your HLSERVER folder. If the map maker has zipped the maps properly with full paths it will extract the files into the SvenCoop subfolder automatically.
A map archive could contain a number of files, below is a table of the file extensions:

 

ExtensionExampleDescriptionLocation
.bspmapname.bspThe map file itself/svencoop/maps/
.cfgmapname.cfgThe map settings file/svencoop/maps/
.txtmapname.txtThe authors notes/svencoop/maps/
_motd.txtmapname_motd.txtCustom motd for the map/svencoop/maps/
.resmapname.resMap resource file/svencoop/maps/
.wadanyname.wadCustom texture file/svencoop/
.wavanyname.wavCustom sound file/svencoop/sound/
.mdlmodelname.mdlCustom model file/svencoop/models/
.tgaskyname.tgaCustom sky/svencoop/gfx/env/

Bear in mind that the locations listed may not always be listed correctly in a zip file, so check before extracting the files. Once all files are in their correct places, start your SvenCoop server to test it out. Type changelevel mapname (where 'mapname is the bsp name) in the server console, the server should change to the newly installed map. (HINT: Try this on a lot of the maps first off to make sure they all work. Nothing worse than loosing players because a map keeps crashing!!)

 

3.2 SERVERDOC:

Every now and again HLDS will crash. It's a fact of life; it might be a corrupt map, missing wad file or a player. If it fails and you are not there to restart it, then players will go elsewhere. However there is a useful program called serverdoc that will restart a crashed server. Bear in mind however, it will NOT restart a server if the crash has displayed a message and is waiting for a key press for acknowledgement.

Download it from here:
http://serverdoc.com/

Then make a new directory under the HLSERVER directory called SERVERDOC and extract the files to there.Now you will need to change the desktop shortcut to launch serverdoc first. So if you have installed HLDS as E:\HLSERVER then your OLD shortcut will be:
"E:\HLSERVER\HLDS.EXE �CONSOLE -GAME SVENCOOP"

Now insert the path to server doc in front of this i.e.,
"E:\HLSERVER\SERVERDOC\SERVERDOC.EXE E:\HLSERVER\HLDS.EXE �CONSOLE -GAME SVENCOOP"

Once you have changed this, click on the icon and serverdoc will load, then it will load HLDS. You can tweak serverdoc if you wish, click on menu, then config. Here you can specify options; It is recommended you turn on logging and set priority to high.

 

3.3 TWEAKING THE SERVER / CVARS:

So far you have a basic SvenCoop server running with the default cvars. You can tweak these if you wish. If you look at the appendix at the end of the guide you will see a number of other commands than can be put in the Server.cfg file. These will alter how your server runs. Some basic ones are "sv_contact" - in this you can put a web site or email address for clients to contact you about the server. Another one is "motd_display_time" - this is the time that the message of the day will be onscreen for. Although the appendix gives a good explanation of the cvars and the values, only you will know what to your server needs. After putting in a value, play on the server, then tweak the value and play until you come to a value that's good for your server.
There are a few SvenCoop specific cvars you can specify in Server.cfg These are also defined in the appendix and the end of the document.

 

4.0 ADMINMOD - INSTALLING!:

Now here is the tricky part, you should not hit any problems if you follow the instructions with Adminmod as they are great! The process is gone through step by step here however:
Extract the files in halflife-admin-2.50.59.zip to your HLSERVER folder.

- Navigate to E:\HLSERVER\ADMINMOD
- Double click "install_admin.vbs"
- Click "OK�

- Check the server path, and then click "Yes"
- When prompted for the directory name, DO NOT PUT IN THE FULL PATH, put in SvenCoop
- Click "OK" to start configuration

- Click �Yes� to make a Admin Mod Manual Shortcut
- Click "OK" to finish.


Adminmod should now be installed with the base plugins.
Fire up your Hlserver, in the console window type "admin_command admin_version"
You should get a version number and a list of plugins!
IF THIS DOES NOT WORK, THEN YOU HAVE NOT FOLLOWED THE INSTRUCTIONS PROPERLY.
START AGAIN!! (There are some error messages in the appendix)

 

4.1 Server Hanging:

For some reason, some servers have been hanging after a few hours play. A new Metamod.dll was created that seems to reduce the server hanging by quite a margin.

Rename metamod.dll in HLServer\Svencoop\Addons\metamod\dlls

Then copy over the one downloaded and rename that to metamod.dll

 

4.2 ADMINMOD - ADDING USERS!:

Ok, assuming its working, you can configure it later
First we need to specify admins; the document says you can use player names. I STRONGLY ADVISE AGAINST THIS
If you use this way, hackers can gain admin access. Use your steam id.
In the HLServer\SvenCoop\addons\adminmod\config dir, open up users.ini with notepad.
Type in like this:

steamid:password:accesslevel   (Steam ids look like this STEAM_0:1:1234564)

Example:
STEAM_0:1:1234564:letmein:65355

Access levels are a tricky thing. It depends on your admin. You might want to give them unlimited access, or just the ability to change maps. (See the tips section). Here are a few good access levels;

 
483This will allow the admin to Kick / Ban / changemap / change gravity / start votes
8675Same as above, and also teleport / stack / turn fun and disco on and off
32768This will allow a player to take a reserved server spot and NOTHING else!
41443Same as above, but also allows the admin to take a reserved spot on server.

On your clients I would advise them to connect to server first. Then execute an admin_password letmein, this way is a lot safer.

The other option is to set up a small cfg file for you clients:
First to aid security, in your Server.cfg file find the line password_field "pw-home" then change pw-home to something else, e.g. mousespeed. This will deter hackers that are looking for the default field.

Make a text file, you can call it admin.cfg or something along those lines.
Then put in it: setinfo pw-home letmein (Don't forget to use your own variable for the pw-home bit, eg mouspeed)
Save the file and put it in your HL folder on your client machine
To use it, go to console and type exec admin.cfg

You should get the line "Password accepted for user 1234" that means it's worked.
Now try and execute a command. (Look in the excellent Adminmod doc for the commands)

For example go to console and type admin_gravity 100. If this has worked the console will display "SV_GRAVITY = 100" this means that the commands are working. Look in the adminmod docs for all the commands and try a few to make sure. E.g.; admin_vote_map ; admin_map; admin_csay and so on.

 

4.3 ADMINMOD - TWEAKING!:

Before you start adding plugins, there can be a lot of configuring of the base plugins that may be done.
The file adminmod.cfg file in your �hlserver\svencoop\addons\adminmod\config�  is the default Adminmod cvars. They can be altered and you are advised to do so. Again using the same way as before. Tweak and play. Some won't require playing for example, that is the message that comes up in the middle of the screen while playing, (admin_repeat_message). You should know the basic commands from heart. You will however want to tweak the frequency of it (admin_repeat_freq). There are a wide variety of cvars; you just have to look carefully. Be aware in the documentation there are other cvars mentioned, but not by default.

 

4.4 DOWNLOADING ADDITIONAL PLUGINS FOR ADMINMOD:

So far we have got a SvenCoop dedicated server that auto restarts, and is running base Adminmod with some defined admins. Adminmod offers a wide variety of plugins and you shall see how to add them here.
All plugins come in a zip file. All have at least one file, that is "plugin_name.sma" The code is contained in a text document. For this to work it needs to be compiled first. The plugins are not compiled for the following reasons:

1)These plugins are for linux and win32 platforms. The author might not have access to some platforms so he couldn't compile it for that particular platform. It also means there would have to be two included compiled files instead of one uncompiled file.

2) As a server op it is good practise to know what is going onto your server. With the base code you can view it and make sure the code is exactly what you want on your server

Occasionally the author includes 3 files, that speeds up the process: code, Linux and win32 compiled versions.

Some plugins also come with text files that specify extra parameters.
Get the plugins from here; http://www.adminmod.org/plugins
Download all desired plugins.

 

4.5 INSTALLING THE NEW PLUGINS:

It�s best to start with an easy plugin, for example: - timerem2. This plugin will tell you the timeleft on a map, if a client types timeleft in a say window.

There is only 1 file in this zip, plugin_timerem2.sma. You will need to extract it to the Adminmod compile dir. 
This is E:\HLSERVER\ADMINMOD\SCRIPTING\MYSCRIPTS by default.

Once the file is copied you will notice another file is created called "compile_all.bat" run this file. This will then use the compiler (in, E:\HLSERVER\ADMINMOD\SCRIPTING\COMPILER) to compile the sma file into a amx file. Once done go to the mybinaries folder (E:\HLSERVER\ADMIN\SCRIPTING\MYBINARIES) and it should have created a plugin_timerem2.amx file.Copy this file to your E:\HLSERVER\SVENCOOP\ADDONS\ADMINMOD\SCRIPTS folder.

All that is left to be done is to tell Adminmod to load the new plugin. Remember the definitions above? Next, open up the plugin.ini file in the SvenCoop\addons\adminmod\config dir. Once opened you should get the idea of what this file is used for. A new line needs to be placed in the bottom saying; addons/adminmod/scripts/plugin_timerem2.amx

Once done close the file, and save the changes.
Fire up the server, connect as a client and press the say key and type timeleft. If all is working you should hear a voice telling you the time left on the map!

 

4.5a ONE MORE SLIGHTLY HARDER ONE!:

One more example. This is a good one. Listallmaps - this will allow your clients to list all the maps you specify in a text file. The plugin is called "Plugin_listmaps.zip" it contains 2 files plugin_listmaps.sma and tmaps_sample.txt". Open up the plugin_listmaps.sma and have a look!

The tmaps_sample.txt is a sample file as a example. This plugin uses a file called tmaps.txt you list all the maps you want to in here and when the user types 'listallmaps' in the console this plugin will return the list of maps in the tmaps.txt file. So first you copy your sma file into the scripts directory (E:\HLSERVER\ADMINMOD\SCRIPTING\MYSCRIPTS) then click on compile_all.bat
Retrieve your compiled amx file from the binaries directory (E:\HLSERVER\ADMINMOD\SCRIPTING\MYBINARIES), and copy it to your adminmod\scripts folder like before.

Open up your plugin.ini file and add a line for the new plugin, close and save.
Now fire up a command prompt and run this command, (If you want to know what all the switches mean run the dir command with /?, IE: DIR /? )

�DIR E:\HLSERVER\SVENCOOP\MAPS\*.BSP /ON /B > E:\HLSERVER\SVENCOOP\TMAPS.TXT�

This will list all the map files and put them in a file called tmaps in your svencoop folder.
Now go to the new tmaps.txt and open it, click on �Edit�, then in the �Find what� box type .bsp
Click on replace all, now all the file extensions should be gone. Save and close the file.

Let's tell adminmod to use the same file as listallmaps then we only have to update one file when new maps are added. Take a look in your adminmod\config dir, open up adminmod.cfg and locate the line that says maps_file �� change it to say maps_file �tmaps.txt�

Start the server, join as a client and type in the console 'listallmaps'. You should now get a list of all the maps you've specified in your file.
Try and vote for one by typing admin_vote_map in the console. Providing you have set up the correct access levels a map vote should now be in progress.
You have now compiled and added two extra plugins! This should now give you an idea on what to do with the files and how to compile them. This is not meant to be a definitive Adminmod tutorial; the help files that come with Adminmod are excellent. If you can't follow then you shouldn't be running a server, but hopefully they will give you a great starting point.

 

 

 � 2004 Sven Co-op. All Rights Reserved. Site design by [ Sniper ]