# Running a server (basic installation)

This section will guide you through the basic installation of Sven Co-op's dedicated server.

## Contents

1. Which package is right for me?
2. Installation: Steam tool
3. Installation: Standalone application
4. Starting a server: Graphical
5. Starting a server: Console
6. Configuration
7. Connectivity
8. Installing custom maps
9. Advanced topics

Back to the top...

## Which package is right for me?

Our dedicated server package comes in two forms both with different benefits. One is distributed to you through your Steam client (the same application you use to launch games in Steam) as a tool, and the other is distributed through Steam's console client (SteamCMD ) as a standalone application.

Here are the basic differences and benefits of them both:

Steam tool | Standalone application
--- | ---
Distribution
Install through Steam. Appears as a tool in your Steam account's library. Ideal for temporary/observed servers. | Install through SteamCMD . Downloads as a standalone application. Ideal for permanent/unattended servers.
Benefits
Installation is fast and easy. Start a server quickly through Steam. Easy graphical interface to set options, see statistics, players, and manage bans. Server will automatically update like with any other Steam package. | No Steam account required. No Steam client installation required. Can play on your server at the same time. Can be launched in graphical and console modes. Can be launched as a regular application or system service. Can run multiple servers with a single set of application files.
Drawbacks
Requires a Steam account. Requires the Steam client to be running. Can't play the game at the same time. Can't be launched in console mode. Can't be launched as a system service. Can't run multiple servers. | Installation requires knowledge of a command line / terminal environment. Starting a server requires a custom shortcut or command. More complicated console/command interface to manage the server. Updates must be downloaded manually or through a defined schedule.

Once you have chosen a package follow the instructions for the Steam tool or standalone application.

Back to the top...

## Installation: Steam tool

Our dedicated server package in Steam will allow you to effortlessly install a server attached to your Steam account. It's quick, easy, and should be up and running as fast as you can download it. This is an ideal approach for temporary / part-time servers. You will require a valid installation of Sven Co-op to continue.

Instructions are as follows:

1. Launch Steam and log in.
2. In the main Steam screen hover over Library and click Tools.
3. Scroll down the list of available tools until you see Sven Co-op Dedicated Server.
4. Double-click the package to install it.
5. Follow the on-screen installation.

That is it. You should now have the dedicated server tool ready to launch. Double-click the tool in the library and select Play Sven Co-op Dedicated Server to launch a server with a graphical interface.

Back to the top...

## Installation: Standalone application

Our dedicated server package is also available as a standalone package available via the SteamCMD tool. Though it requires further knowledge to install and use you will benefit from a server that doesn't depend on your Steam client, can be run as a console application, and even be run as an unattended system service. Permanent / full-time servers should opt for this approach. You will also NOT require an existing Sven Co-op installation to continue.

- Do not use this method of installation if you are unfamiliar with some basic server administration concepts such as using a command prompt or terminal environment, and reading/writing configuration files.

Instructions are as follows:

1. Open a command prompt or terminal environment on your system.
2. Download and install SteamCMD .
3. Download our dedicated server package with the following command:
   `steamcmd +login anonymous +force_install_dir "C:\SvenDS" +app_update 276060 validate +exit`
   Replace the path C:\SvenDS with a location to your preference.
4. Wait for the package to download and validate.

Once it has finished you can use the SvenDS.exe executable to launch a server. Launching without any arguments will start it with a graphical interface, or if you specify the -console argument it will start with a console interface.

The same command is used to update the server application too, however be sure you have no server instances running or the update will fail.

Back to the top...

## Starting a server: Graphical

To start a server with a graphical interface simply launch the Sven Co-op Dedicated Server tool in your Steam tools library (for Steam tool installations) or launch the SvenDS.exe executable (for standalone application installations). You will be presented with a small form asking for some options.

- Game: This will always be Sven Co-op, unless you're running a mod on our engine.
- Server Name: This is the name of your server as shown in the game server list and on the score board in game.
- Map: Choose a map to run immediately with your server. Osprey is a good choice if you want to get players in quickly, or Stadium4 for a gathering place for a group of friends.
- Network: Internet means your server will be available to anyone with a valid Steam subscription, and players authenticate with their Steam ID number. LAN means your server will be available only to your local network, and players authenticate with their IP address.
- Max. players: The maximum number of players that can be on your server at a time (2-32). Most maps become overcrowded with more than 12 players.
- UDP port: The network port number for your server to listen on. If unsure leave as default (27015).
- RCON password: The password used to remotely access the command console for your server. You should not tell anyone this password as it allows them to control your game server. It must be at least 3 characters consisting of only alpha-numeric characters. If you don't want to use this feature, just do a keyboard mash to input any random string.
- Secure (Valve Anti-Cheat): Players will be scanned for game cheat applications as they join your server. Players caught and blacklisted by Valve's Anti-Cheat system will not be allowed to play on your server. You should leave this enabled in most situations.

Once you're ready click Start Server, it will take a moment to begin. All of these options will be remembered for the next time you start a server.

You will then (hopefully) be presented with a larger form depicting a tabbed management interface for your game server.

- The Main tab tells you a bit about your server (which game, how many players are on, how long it's been running) along with changing some basic settings:
  - Server Name, Network, and RCON Password As in the launch options form.
  - Map: Immediately change to a new map from a list.
  - Player Password: Allows you to set (or unset) a password required for players to join your server (making your server private).
  - Map Cycle: A graphical tool to build a map cycle to run on your server.
- The Configure tab allows you to change a broader set of options. Not all of these will be saved after you start a new server.
- The Statistics tab shows you a graph about how well your server is performing such as CPU load, frame rate (tick rate), and network data.
- The Players tab shows you a list of players currently connected, some information about them, and the ability to kick/ban players.
- The Bans tab shows you a list of currently banned players and IP addresses, editing the bans list, and importing/exporting the list to a file for backup.
- The Console tab shows you a simple textual representation what is happening on your server, along with the ability to submit commands to your server. You will need to look at this output if you need to find out why something has gone wrong. Avoid entering any commands you aren't sure of what they will do, particularly those given to you by other people you don't fully trust.

There is really little more I can tell you about running a server in graphical mode. You can close it down any time you like, then any players connected will be returned to the main menu with a message that the server is shutting down.

Back to the top...

## Starting a server: Console

This option is only available to the standalone application. You will need to open a command prompt or terminal environment on your system then change the working directory to your Sven Co-op dedicated server installtion (usually C:\SvenDS).

Next you need to build a command to launch your server. The following list of arguments and parameters will determine how your server starts. Be sure to split them up with a space. Pay attention to those beginning with a hyphen (arguments) and those beginning with a plus (parameter), as they will not work with the wrong symbol. Sections highlighted before the colon are the parts you type, and underlined sections are parts you change.

- SvenDS: The name of the application, does not need to have ".exe" on the end.
- -console: Required, or your server will start in graphical mode.
- -game modname: Only needed if you are running a mod on our engine, otherwise ignore this.
- +ip ipaddress: Only needed if your computer has more than one IP address assigned to it, and you need to specify which address to listen on.
- -port 27015: Chooses the network port to listen on, usually 27015 unless you're running more than one server on the same IP address.
- +maxplayers 12: The maximum number of players that can be on your server at one time (2-32). It will be 12 if you do not specify this.
- +map _server_start: Specify which map to launch the server on. If you do not specify this your server will remain stuck in an un-connectible state!
- +log on: Start a log file for the server console (recommended).

Here is a simple example to start an 8-player server on map stadium4 listening on port 27015 with logging enabled:

    SvenDS -console -port 27015 +maxplayers 8 +map stadium4 +log on

Back to the top...

## Configuration

Once you have got your first server running you will likely want to change the configuration of it in a way that it's saved permanently, and across map changes.

We will focus on just the basic configuration options here found in the default server.cfg file. Edit this file with a plain text editor (like Notepad or nano). You can modify this file while your server is running, then any saved changes will take effect on the next map.

Setting | Default value | Description
--- | --- | ---
hostname | Sven Co-op v5.0 server | The name of your server as players see it. This line comes first to minimize the chance of your server appearing as the default name Sven Co-op. Try to limit yourself to 40 characters on this.
log | on | Switch on logging of events on your server. There is little reason to turn this off unless you don't require logs. I recommend you specify this in your command parameters instead to lower the number of log files created.
rcon_password | Empty | Password used for accessing the server console remotely. Use a password strength meter to help you build a good password. Only your trusted server administrators should know this as it allows unlimited access to your game server. If you leave this blank, remote console access will not be available (don't worry -- it won't allow everyone to use RCON without a password).
sv_password | Empty | Password used for players to join your server. Leave blank if your server is public.
sys_ticrate | 128 | The maximum number of frames/second your server will process. We have discovered that setting this using base 16 increments (64, 128, 256, etc) provides a smoother base 10 tick rate (50, 100, 200, etc) than setting the number at base 10 directly. Setting this above roughly 250 is ridiculously stupid, and your players will just complain about lag when your server fills up. Frame rates too high will also have a negative effect on physics and NPC movement, and extreme frame rates (over 500) will cause many brush entities to cause crush damage when nothing is blocking them.
deathmatch | 1 | This is essential for the intended game play of Sven Co-op. Do not change this, and do not use the coop setting.
decalfrequency | 30 | The time (seconds) a player must wait before making their spray again. 0 will remove this delay, but is not recommended.
hpk_maxsize | 2 | The size limit (megabytes) of the file that stores uploaded sprays. The oldest sprays are removed to make way for new sprays.
pausable | 0 | Determines whether the game on your server can be paused by anyone. This is never recommended on public servers.
sv_allowdownload | 1 | Allow players to download custom content from your server.
sv_allowupload | 1 | Allow players to send custom sprays to your server.
sv_region | 255 | The region your server is in. This is used in Steam's server browser, so players can look for servers near by. -1: Do not list server in the server browser. 0: USA east coast (includes central zone) 1: USA west coast (includes mountain zone) 2: South/Latin America. 3: Europe. 4: Asia. 5: Australia/Oceania. 6: Middle East. 7: Africa. 255: International/Other. This does not restrict players from connecting to your server. Please be honest about your server location rather than just use International, which should only be used for countries/continents not already included such as: Other USA zones (mountain/central/Alaska/Hawaii) Canada. Mexico. Central America (continent) Caribbean. Greenland. Other non-continental territories. Antarctica (lol) Anywhere else not mentioned here. Please also bare in mind that if you choose a region other than International your server will appear on both International and the region you have selected. This is why you should pick the correct zone if your server lives in one of them.
sv_voicecodec | voice_speex | The voice codec to use. Currently only voice_miles and voice_speex are available. There is no reason to revert to voice_miles as the quality is terrible, and throughput consumption is more than double used by voice_speex.
sv_voicequality | 5 | The voice quality for voice_speex. Bad quality, 2.4 kBytes/sec of throughput used (7.5% of what voice_miles uses) Adequate quality, 6 kBytes/sec of throughput used (18.75% of what voice_miles uses) Good quality, 8 kBytes/sec of throughput used (25% of what voice_miles uses) Very good quality, 11.2 kBytes/sec of throughput used (35% of what voice_miles uses) Brilliant quality, 15.2 kBytes/sec of throughput used (47.5% of what voice_miles uses) Even servers on home broadband connections can sustain the highest quality offered by voice_speex, there is very little reason to change this.
sv_voiceenable | 1 | Allow players to use voice communication.
mp_notimelimit | 0 | Disable a map's mp_timelimit setting allowing it to run indefinitely. The map can still end on empty servers due to mp_timelimit_empty.
mp_telefrag | 1 | Players will kill someone if they are teleported inside them. Disabling this will result in players piling up inside each other unable to move.
mp_timelimit | 60 | Map changes after this amount of time (minutes) if the map hasn't been completed already.
mp_timelimit_empty | 10 | Automatically end the map and move on to the next if the server has been empty for this many minutes (stops maps setting infinite time limits on empty servers). Set to 0 to disable this feature.
mp_weaponstay | 1 | Weapons can be picked up multiple times, with the exception of miniguns. Disabling this will result in a couple of players taking all the weapons leaving others with nothing.
exec | banned.cfg | Loads the list of banned Steam IDs.
exec | listip.cfg | Loads the list of banned IP addresses.

If you wish to see a vastly more complete set of configuration options, please see the extended server configuration guide.

Back to the top...

## Connectivity

Once you have got your server up and running and you want players to connect to it over the Internet it is likely that your server will be behind a firewall, a router with a firewall, or a router using network address translation (NAT). This is likely to mean you will require some additional configuration of one or more of these in order to make your server world visible.

The most likely scenario particularly for game servers at residential properties is a router using network address translation. This is where one public IP address is assigned to a NAT router at home, of which is then shared between one or more computers/devices using a private address network. The easiest way to determine if this is the case for you is to do the following:

1. Open a command prompt or terminal environment on your system.
2. Submit command: ipconfig (on Windows) or ifconfig (on Linux).
3. Take note of the numbers to the right of the IPv4 Address row.

Ignore any network device that shows one of these address ranges, because they are not connected to the Internet anyway:

- 0.0-255.0-255.1-254.
- 127.0-255.0-255.1-254.
- 169.254.0-255.1-254.

Check if your IPv4 address is within the following ranges:

- 10.0-255.0-255.1-254.
- 172.16-31.0-255.1-254.
- 192.168.0-255.1-254.

If this is the case you are definitely behind a router using NAT. You will need to configure port forwarding on your router in order to make your game server world visible. Because there are literally thousands of different home router models worldwide we are not going to guide you on how to do this. Instead visit www.portforward.com to find a set of instructions specific to your router. You will also need administrative permission on your router in order to make this adjustment, so if it isn't yours ask for permission first.

Our server application only uses the following transport ports. You can amend these using the corresponding command line parameter.

Port | Protocol | Parameter | Description
--- | --- | --- | ---
27015 | UDP | -port | Game & content transfers traffic
27015 | TCP | -port | Remote console (RCON) traffic
26900 | UDP | -sport | Valve anti-cheat (VAC) service traffic (auto-increments from default if taken to the next available port)

Back to the top...

## Installing custom maps

Your players will inevitably get bored with the official set of maps provided. You will almost certainly want to install some of the many additional maps around to improve the experience of your game server.

Installing custom maps is a simple process providing map artists follow the map distribution guidelines. You will have downloaded a map as a file containing the map contents typically as a ZIP, RAR, or 7Z archive. Maps are rarely distribute maps as a standalone BSP file or as a bunch of unpacked files.

You can use a free utility such as 7-Zip to open most of the archive formats around today. This runs on both Windows and Linux and is provided for free of charge.

When you open the archive you should see a set of folders that could be gfx, maps, models, scripts, sound, and sprites. It's also likely you'll see a bunch of WAD files here too. If this is what you see you will need to extract all of these to your server's svencoop_addons folder.

- Do not extract any unofficial resources directly into the svencoop folder. To help keep your game files clean, use the svencoop_addons folder. The game engine is perfectly capable of loading maps and their contents from this location.
- If there is a scripts folder included take a look inside before extraction. There should only ever be a maps folder inside this. Anything else should be treated as suspicious and not extracted, or deleted after extraction.
- If there is only a svencoop folder inside the archive, you need to enter this folder before extraction. This shows the map artist has not followed our current guidelines on map distribution.
- If there is only a BSP file (and maybe a couple of TXT/CFG files along side it) this means the map doesn't have much custom content. These files should be extracted to the maps folder within the svencoop_addons folder.

This diagram shows how custom map content should be laid out in your game.

Back to the top...

## Advanced topics

This page only covers the basic installation and configuration of a single server. Our advanced topics guide covers a range of more in-depth tasks such as configuration profiling (running multiple servers on a single installation), running a server as a system service, and setting up a fast in-game content server.

Back to the top...