Contagion

Contagion

69 ratings
Dedicated Servers || Contagion
By Frengler
Comfortable setting up a Source engine server but want to know more about the Contagion specific cvars and settings? This guide will attempt to collect the data in one place but also gives a basic understanding of how to set up a server.
   
Award
Favorite
Favorited
Unfavorite
Introduction, disclaimer and all that jazz
So you want to host a Contagion server do ya? Well, if you've ever played around with Source engine servers before this is a place to find specifics for Contagion. It also contains a somewhat newbie friendly introduction to the whole "hosting a dedicated server" concept if you've never tried it before.

WHO AM I?

My name is Thomas and I'm a Danish bloke who lives in The Hague, Netherlands. Been an avid gamer since I was very young and have the pleasure of working with computers for a living as well. For the past many years I've hosted servers for many games, most of them Source engine based, which gives me some experience in this field.

HOWEVER I am not, and will never claim, to be an expert. There are still many things that are unknown/unclear to me. For example I only know the basics of networking, how ip adresses and ports work but I know enough to make a server run smoothly. In essence I'm just a fan who has acquired the knowledge I have through trial and error plus an extraordinary amount of Google searching.

What's the purpose of telling you all this? It means that if I can figure this out chances are so can you if you are a bit tech savvy.

DISCLAIMER:

  • As stated above I am not an expert and I don't know everything.
  • It is entirely possible that I am a wrong about some things. Please feel free to correct me or come with advice on how to something different/better.
  • Many server are hosted on Linux. I have never had the pleasure of delving into the mysteries of this lovely OS so you'll find no advice or tricks for Linux at all.
  • This is the first time I've ever written a guide so please excuse me if it's not perfect.
  • You may NOT copy, reproduce or re-post this guide in its entirety or in part without first getting express permission from me
Purpose of this guide, who is it meant for and what you WON'T find here
PURPOSE:

You might ask what's my reason for making this guide? As I mentioned in the introduction I've hosted servers for many different games throughout the past many years. While Source engine games all share the same base princible there are variations between them in terms of config/cvars.

My biggest gripe is that the game specific info is often not tracked or stored in any central place but is often spread about between forums, websites, planets, sticky notes or nested in other people's brains. Since I always end up accumulating the equivalent of small travel dictionary worth of notes for each game I though I'd share it with others for a change.

The first part of this guide will serve as a general guide for setting up a functioning Contagion server split in to 3 steps. The latter parts is extra info and will delve into cvars and settings specific for Contagion. So both newcomers and experienced server people should find something interesting here. And feedback is always welcome of course as long as it's constructive. Hopefully we can make a decent reference for Contagion server hosters.

WHO IS THIS GUIDE MEANT FOR

This guide is meant to arm you with an intermediate level of knowledge regarding Source servers and obviously Contagion specifically. It makes no use of pictures and presumes that you're capable and willing to do some legwork yourself. Some concepts are covered in their basics and will most often refer you to where you can learn more should you wish.

Before you begin you should already know about:
  • Ports and especially port forwarding.
  • The difference between and purpose of external and internal ip addresses.
  • The idea of downloading/updating a Source engine server using SteamCMD.
  • Have a pretty idea of how to set up a computer to act as a server.

WHAT WILL YOU NOT FIND HERE:

This has already been covered a bit or at least implied by what I wrote above. Just to be clear though you won't find:
  • An intricately detailed step-by-step instruction on how to download and set up a server.
  • Instructions on how to set up portforwarding in general or for your router specifically.
  • Any instructions/tricks for dealing with server setup on Linux.
  • How to deal with rented servers.
  • Exhaustive technical details of the Source engine.
  • Intricately detailed list of all relevant Source- and Contagion-cvars.
STEP 1: Getting started (software, ports and ip's)
This procedure is basically the same for all Source engine based games. So for those who already know all this you can skip to the cvar and server.cfg section.

2: THE SERVER FILES

This requires you to install the server software via SteamCMD. There is a decent guide for that right here.

This same program is used for updating the server.

NOTE: The app id for the Contagion server is: 238430

3: PORT FORWARDING

For a great site on port forwarding go here.[portforward.com].

You need to know (or decide) what port(s) that your server is gonna be using and forward it (both TCP and UDP). Steam as standard tends to use ports in the region of 27000 to 27020 for gameports. There's a bit of info about it here though it might be slightly outdated by now.

The following list of ports need to be open for a server to run successfully:

  • 28852 TCP/IP and UDP (Allows your Server to Connect to the Master Server Browser)
  • 20560 UDP/IP (Steam Port)

Since the game is running with the Steam backend, if you are running more than 1 server you will need to make sure that you have some additional ports open. As far as I am aware if you host a second server it will first try to use the default Steam port and default master server port but since those are in use it will move one port ahead (example from 28852 to 28853). Keep that in mind if you intend on hosting multiple servers.

For the actual game port you could technically pick any port you want but realistically there are a lot of standard ports in use already that you shouldn't try messing with.

As an example I've forwarded ports 27000 - 27050. That way I have a 50 port range I can use for all my servers (yes, I have that many...).

If you are only planning on hosting one server just open one port.

3: INTERNAL AND EXTERNAL IP ADDRESS

Your external address is like the address of your house. The internal address is the IP of the computer you're hosting the server on. Why do we need both? Because when clients connect to your server they need to know which house to go to (your external IP) and then what computer to connect to (internal ip). This goes hand in hand with the port forwarding. Port forwarding is essentially telling your router that when traffic comes in via this port send it to this particular computer in my network.

You can find your external ip as easy as this:
  • Go to your webbrowser
  • Open Google and type in "what is my ip"
  • It should come back and say: "Your public IP address is "

For the internal ip you can do this two ways:

The user-interface and clickable-friendly way:
  • Go to your "Network and Sharing Center" (searching via the Start-menu or through the Control Panel)
  • On the left side click on "Change adapter settings"
  • Right-click on your network card and click "Status"
  • Click on "Details" and the ip will be shown under "IPv4 Address"

The slightly-faster command prompt typed way:
  • Go to Start and type "cmd"
  • Open it and type "ipconfig"
  • Find your network adapter and the ip will be shown under "IPv4 Address"

Keep these two safe. You'll need them later (server.cfg and launch parameters).
NOTE: You may run in to trouble if your computers IP address has a habit of changing often. I have a hard time giving much advice about that because I never had the problem myself (I don't even use static IP addresses). You might want to look in to DynamicDNS in that case.
STEP 2: The config file (server.cfg)
The cfg file is what contains the settings (in the form of cvars) for your server. This is one of the biggest differences between Source engine games and can be one of the most annoying things to figure out. What cvars work and which do not? What values? Which ones are specific to this game etc etc...

The server.cfg file doesn't exist on a new clean install so you have to create it. The easiest way is to start Notepad, paste the text in (or write it from scratch should you wish) and then save it. After that you have to rename the file extension from (typically) .txt to .cfg. It should be saved under your /contagion/cfg folder. No need to create that folder - it should already exist and have many files in it.

NOTE: server.cfg is automatically executed by all server instances you start. If you want you can make a server.cfg with the common cvars that all your servers should share and than make individual cfg-files for each server called something else. Then you can use the launch parameter exec to execute a specific cfg file when a server launches.

Below is a fairly standard server.cfg that works just fine without major modification. Beware that it's intended for the standard tickrate of 33!

A couple of things to keep in mind:
  • Make sure to run through this cfg and change the values I marked in italic
  • A few of the cvars are currently commented out (with a double forward slash // ). If you want to make use of them then you have to uncomment them (remove the slashes) and give them a value. Otherwise they'll default to their standard value.
  • maxrate is set to 50 kb/s for each client. This could potentially be lower but I haven't researched how much data Contagion sends on average.

//--> This is the name for your server. Can also be defined as launch parameter
hostname Your Server Name Here!

// ********* RCON SETTINGS *************
rcon_password YourRandomPasswordHere // It's important you set this otherwise others can remotely take control of your server!!!
sv_rcon_banpenalty 15 //Number of minutes to ban users who fail rcon authentication
sv_rcon_log 1 //Enable/disable rcon logging.
sv_rcon_maxfailures 3 //Max number of times a user can fail rcon authentication before being banned
sv_rcon_minfailures 5 //Number of times a user can fail rcon authentication in sv_rcon_minfailuretime before being banned
sv_rcon_minfailuretime 10 //Number of seconds to track failed rcon authentications
// ************************************

//Server password. Uncomment to use and set a password.
//sv_password

// Region - This sets the lobby in which your server will be part of. You will want to set this to the closest location to your server
//--> eastcoast - sv_region 0
//--> westcoast - sv_region 1
//--> south america - sv_region 2
//--> europe - sv_region 3
//--> asia - sv_region 4
//--> australia - sv_region 5
//--> middle east - sv_region 6
//--> africa - sv_region 7
//--> world - sv_region 255
sv_region 255

// Log Settings
sv_logfile 1 // Enables logging to file
sv_logbans 1 // Log bans or not?
sv_logecho 1 // Echo log messages to server window
sv_log_onefile 0 // Maintain one logfile or split in several?

// ************* Rate and network settings *************
sv_minrate 30000 // Min kilobit that client is allowed to set (and thus receive)
sv_maxrate 30000 // Max kilobit sent to individual connected clients
sv_lan 0 // Whether server is LAN only or internet.
sv_mincmdrate 30
sv_maxcmdrate 33
hostip XXX.XXX.XXX.XXX // Your external IP

// ************* Server settings **************

sv_voiceenable 1 // Enable Steam built-in voice chat on server.
sv_alltalk 0 // Whether both teams can communicate with each other via chat.
// sv_contact // Admin Contact email address to display on serverinfo.
sv_cheats 0 // Allow use of cheats. Not recommended ON!

// *************** ROUND AND CONTAGION CVARS ************

// mp_roundlimit X
// mp_timelimit XX
// Difficulty 0 // 0 (easy), 1 (normal), 2 (hard), 3 (extreme)
// cg_infection_disabled 0 // Is becoming infected disabled on this server?
// cg_zombie_ai_only 0 // No player zombies allowed? If you then die, you spectate only.

// ************************************

// Execute ban files
exec banned_user.cfg
exec banned_ip.cfg
writeid
writeip
STEP 3: Launching and running the server (parameters etc)
Launching the server is typically done using .bat files. You can create one just like you created the server.cfg: by using Notepad and changing the file extension. The file doesn't have to be in the Contagion folder but if you put it somewhere else you must supply the full path to the contagionds.exe file in your bat file (explained further down). What you call your bat file is largely irrelevant as long as it ends in .bat.

A typical file would look like this:

contagionds.exe -steam -game ".\contagion" -console -dedicated -maxplayers X -ip <yourinternaliphere> -port <yourporthere> +map <mapnamehere> +sv_lan 0

Most of these parameters should be fairly self-explainatory. Most of the cvars that you normally use in server.cfg can also be defined here. They start with a plus (+) instead of a dash (-). For a full list see the developer wiki at Valve. NOTE: Be sure to change the italic to correct ones!

EXPLAINING PARAMETERS:

Maxplayers is obvious and it's standard set to 8. For Hunted and Panic modes you can have up to 16.

Although map is a cvar it must be set during launch otherwise the server is not ready to accept connections. A good way to get a list of maps is to launch the server - or your client with the console enabled - and then use the command maps *

NOTE: There is no parameter or CVAR for switching game modes/types. This is all based on the type of map. Maps beginning with CE are Escape, CX are Extraction, CH are Hunted, CPC are Panic Classic and CPO are Panic Objective.

IP should be your internal ip (ip of the computer you are hosting the server on).
Port is obviously the port (or one of the ports) that you've opened with port forwarding.

The console parameter will let your server run in a cmd/command line style text interface. This is what most people do. I used to use the GUI interface in the past (the good ol' CSS days) but I haven't tried since then. Not even sure if it works anymore actually.

The game parameter tells the executable what game it should be hosting. It accepts either a path to a https://developer.valvesoftware.com/wiki/Gameinfo.txt (can be found under the contagion subfolder) or a preset value (see this list).

Notice that it uses a path beginning with a dot and a forward slash (./). This is called a relative path and indicates that it will start searching from the folder that the contagionds.exe file is located in. The default bat file that comes with the game uses two dots (../) which means it goes one folder up first and then looks at the subsequent path.

IMPORTANT: If you move your bat files outside of the Contagion root folder you need to supply the full path of the contagionds.exe. As standard it will look for the exe file in the folder where the bat file is run from.

sv_lan will define whether your game is only available on your own local network or via the internet. It should be set to 0 unless you are only planning on running a local server. Normally this parameter defaults to 0 but I have been told that you can run into trouble seeing the server online if you don't specify it.

NOTE ON TICKRATE: If you want to run with a higher tickrate you have to define -tickrate as a launch parameter. Keep in mind that you should change a couple of settings in your server.cfg though. Have a look at the cvars and settings-section for more info on tickrate!

USEFUL:
exec is a handy parameter that can let you execute a specific cfg file when a server launches in addition to the servercfg file. See the section about hosting multiple servers for more info!

NOTE ABOUT VAC:

VAC (Valve Anti-Cheat) is a technology that will automatically detect and ban many users that are using programs used for playing unfairly on server (examples being speed hacking, aimbot use and in some extreme cases, usage of sv_cheats related commands such as noclip). VAC is enabled by default on all servers and requires the administrator to expressly disable it by adding insecure as a parameter to your server.

FIREWALLS:

It's very important that if you use a firewall you need to give contagionds.exe access. For some firewalls (like the built in one in Windows) once you launch the server for the first time it will come with a pop-up to ask you whether the file must be given access or not.

For other programs you might have to manually go to your Firewall program's settings and give contagionds.exe access. Keep in mind that it must have permission to both send and receive data!

OPTIONAL: SERVER RELAUNCH SCRIPT

This is something extra and optional you can use. It will basically restart your server if it crashes and closes down.

@echo off
cls
echo Protecting the server from crashes...
echo If you want to close contagionds and this script, close the srcds window and type Y depending on your language followed by Enter.
title contagionds Watchdog
:contagionds
echo (%time%) contagionds started.
start /wait <insert the contents of your bat file here>
echo (%time%) WARNING: contagionds closed or crashed, restarting.
goto contagionds

The difference between this and the normal bat file is that it must be saved in the same location as contagionds.exe. You can always make a shortcut of this file and place it on your desktop to make it easier to find and launch though.
NICE TO KNOW: Cvars and settings
CVAR is a console variable. There are litterally hundreds of them but fortunately only a handful are really needed for creating a functioning server while others are for manipulating handy things like game settings (teams, rounds etc).

To my knowledge these things can be used in three different places:
  • In the server.cfg file (more on that later)
  • Directly in the console
  • As command line parameters during server startup (might not be all of them)

The best way to get a complete, up-to-date list of cvars from Contagion is by going into the game. Open the console (if unsure how to open console a quick Google search should help) and type <b>cvarlist</b>. If you want it dumped in a file you can type <b>cvarlist log cvarlist.txt<b/> which creates a called cvarlist.txt in your Contagion folder. Be aware though that the txt file is not formatted so all the text is on one long line! It's in CSV-format though so if you know how to import this in Excel (or any other CSV-compatible program) you can create a nicely formatted list. PRO-TIP: If you want sections of cvars you can also type cvarlist sv_ for example to get only a list of cvarlist starting with sv_.

NOTE: The list will contain cvars that are not used by Contagion. There are bound to be many cvars that are used for other Source-engine games such as DOD, CSS, L4D1 and 2 etc. It's often not clear which cvars can be used for or which are specific to Contagion; hence this guide!

For a quick and dirty online version go to this page. Be aware that cvars have been removed and added since so it's likely way out of date by now.

Below is a run through of some common/handy/important cvars. If you want cvars that are specific to Contagion have a look at the corresponding section.

RATE/SNAPSHOT/FPS/TICKRATE CVARS:

Many of these don't work which corresponds with the newer versions of Source engine games. Ever since L4D1 many of these have been locked/removed.

Tickrate is an advanced but important concept. You don't need to be an expert in it but having knowledge of it can help immensely troubleshooting or improving your server performance/stability.

It's something that's by standard locked but Contagion supports 33 (standard) and 66. I won't give you the full tour of what tick rate is - there is the official page on the developer wiki which explains how the networking model works if you're interested. It mentions that everything except for L4D1 and L4D2 are locked at 66 tickrate. The other two are locked at 30/33. Be aware that although tickrate can increase "performance" of your server it also makes it use more resources.

NOTE: Tickrate can only be set as a launch parameter. Head over to that section to learn more.

FPS is a concept most people know of and it's not just relevant for graphics. In the days of yore fps boosting was common thing to manipulate to squeeze more performance out of your server but it's now a thing of the past. This is, in my opinion, a good thing because it makes it less confusing to host a proper server with less advanced settings to understand and fiddle with:

Originally posted by Valve:
Another effect of these changes is that all Orange Box (TF2, CS:S, etc) dedicated servers will run with a locked framerate, similar to L4D/L4D2. The fps_max convar will not have any effect on servers.
Source[roflegion.com]

These days you'll usually see FPS and Tickrate matching each other. When you launch contagionds.exe in console mode you'll see it hovering around 30 fps which corresponds with the standard tickrate of 33.

OKAY, I GET IT BUT WHAT SHOULD I ACTUALLY DO ABOUT ALL THIS?

Good question which these days fortunately boil down to just 3 relevant cvars:
sv_maxcmdrate
sv_mincmdrate
sv_maxrate
sv_minrate

If you really want to lowdown on what these do I'll refer you to the previous link further up regarding the tickrate/network model or some of the other links in the links-section. What it comes down to is controlling the amount of packets sent/requested by the client and server as well as the amount of bytes being sent around.

Fortunately with the changes Valve has made over the years your server should work reasonably well with the standard settings without you changing anything. If you use the server.cfg settings from the guide you should be good to go.

The basic idea is that maxcmdrate should be set to the tickrate so either the standard 33 or 66. The default value for maxcmdrate is set to 66.
For mincmdrate it's usually set slightly lower than maxcmdrate. I recommend 30 for 33 tickrate and 60 for 66 tickrate.

Maxrate is important. This defines the MAX of amount kb/s (meassured in bytes) your server will sent to each client. More so than hardware, your upload speed is what limits your amount of servers and/or amount of people who can play on it. Setting it to unlimited is usually considered bad practice but is not the end of the world otherwise.

Minrate is equally important, perhaps even more so. This defines the minimum rate that clients are allowed to set (using the rate cvar). Basically this controls how many kb/s they can receive. By default clients have this set to 10000 (10 kb) so even with maxrate set to for example 80 kb/s they won't get any benefit the extra data your server can send. So I recommend setting minrate higher (unsure exactly how much data Contagion throws back and forth) but not higher than maxrate of course.

There is an old article for CSS here[planethalflife.gamespy.com] which mentions bandwidth if you're interested in further technical details but it probably doesn't hold up well as a direct comparison to Contagion.

STANDARD/BASELINE CVARS:

sv_pure:
For details on sv_pure (and by extension sv_consistency) I'll refer you to Valve's wiki page. In beta sv_consistency 1 would on occasion boot people for failing checks on various files. This has since been fixed though and you don't need to define sv_consistency anymore (it's actually deprecated anyway).

mp_timelimit:
Only seems to affect the game type Hunted for time between rounds.

mp_roundlimit:
Amount of rounds you can play before server changes map. Only seems to affect Extraction and Hunted. For Escape you change map as soon as you win. Loosing and starting over doesn't count in Extraction or Escape. Only "wins" seem to count towards the roundlimit.

Mapcycling is defined by the mapcycle.txt-file which is used by default. You can change what file to use via the cvar mapcyclefile. Can also be used as a launch parameter - handy if you want multiple servers to use different maplists. See the appropriate section for more details on how to use this.
NICE TO KNOW: Contagion specific cvars
There a bunch of cvars that all start with cont but they are not interesting for servers since they all seem to be for the client.

Difficulty is defined with the cvar difficulty. Values are:
0 (easy)
1 (normal)
2 (hard)
3 (extreme)

Server side Contagion specific cvars all start with cg. There are too many to list here but most of them involve modifying the different stats for friendly fire, zombie health/damage etc on the various difficulties.

Two important ones though:
cg_infection_disabled: Defines whether survivors can become infected from zombie damage (and thus turn in to a zombie before they are actually killed). Default is 0.
cg_zombie_ai_only: Defines whether player zombies are allowed or not. Effectively if this is on players will not turn into zombies upon death but will spectate the rest of the game. Default is 0.

Cvars for the different game modes are denoted by a prefix and an underscore:
ce_ for Escape
cx_ for Extraction
ch_ for Hunted
cpc_ for Panic Classic
cpo_ for Panic Objective

For the curious cvars referred to as "The President" seems to be the equivalent of the Director[left4dead.wikia.com] from L4D2.
EXTRA: Hosting multiple servers
If you want to host multiple servers there are a few things questions you should ask yourself:

  • Do I have enough upload speed to pull this off without making it all lag?
  • Can my computer handle it performance wise (CPU, RAM etc)?

If the answers to the both questions is YES then you need to do the following:

PORTS:

You need to open/forward a port for each server you want. Good practice is to use use ports two numbers apart. So if your first server uses 27015 the next one should use 27017 and so on.

CONFIG FILES:

The server will as standard always use server.cfg. While you can let multiple servers use the same server.cfg you can also set them up to use their own cfg files. How? By using the cvar servercfgfile in your launch file. So you could have server1.cfg and add +servercfgfile server1.cfg to your launch parameters.

The advantage of using multiple cfg files is that you can have servers with multiple different settings. Do note that if you decide to use one cfg file you should define the hostname as a launch parameter rather than in your config file. Unless you want all your servers to be called the same of course.

PRO-TIP: server.cfg is automatically executed by all server instances you start. If you want you can make a server.cfg with the common cvars that all your servers should share and than make individual cfg-files for each server called something else. Then you can use the launch parameter exec to execute a specific cfg file when a server launches.

LAUNCH FILE

No matter what you also need multiple bat files for launching each server. The only thing you must change here is the port. Everything else can be left alone.
Troubleshooting
My server won't show up in the server browser!

There can be multiple reasons for this but there are some common things to check:
  • Port forwarding

The absolut most common reason I have encountered is port forwarding issues. The reason why I linked to the port forwarding website is that this is tricky and could take up an entire guide by itself. Also routers are different in how they handle port forwarding (and some crappy routers don't support it properly).

Make sure that the port you want to use is forwarded to the correct IP address. Also make sure you've forwarded both TCP and UPD ports. Depending on router you might be able to chose what machine to forward ports to based on computer name and/or IP. It can be easy to forward the port to the wrong computer.

  • Wrong internal and/or external ip

Make sure you are using the correct internal IP address in your bat file. It must point to the IP address of the machine you are using BUT also keep in mind that if you have more than one network interface your machine could have multiple IP addresses! Use the one that you have forwarded your port to.
This can be tricky to troubleshoot because there are no obvious errors. You could be connected to a wireless and a wired network with the port forwarded to the wired network but you are using the wireless ip in your bat file. Everything will start up as expected and the server will connect to the Steam master server but it won't be visible.

For external ip make sure you define the correct external ip address in your cfg file using the hostip cvar. This also gives no obvious error message. If you're one of the unlucky few whose external ip changes regularly you'll have to change your cfg files often (not a lot of fun) or look in to Dynamic DNS. I can't help you much there because I never had the need to do it myself.

  • Wrong port

Make sure that in your bat file you have the correct port (the one you forwarded) defined. It's not easy to get this wrong but it doesn't hurt to check. The port can still be bound (used) by the server even if it isn't forwarded. There is a line near the top of the console where it says that it binds the IP and port. If the port is already in use (or can't be found) there should be an error message.

  • Lan server settings

Make sure that sv_lan is set to 0. You can either do this in the cfg file or in the bat file as a launch parameter.

NOTE: Contagion server does NOT support XP so using that or any Windows Server variant running on that core won't work for you.
External links
Here are most of the links I have bookmarked that I use or have used in the past. Perhaps they will help you solve a problem or provide interesting reading:

Server software, settings and installation:

Source dedicated server page on Valve's developer wiki
SteamCMD page about how to download and update the srcds software
Command line parameters
Article on pure(consistency)

Port forwarding:

Site for checking if a specific port is truly open[www.yougetsignal.com]
This is THE site to go for everything related to port forwarding[portforward.com]

Troubleshooting:

No one can join the server? The server doesn't show up on the master list?[forums.srcds.com]
Couldn`t allocate dedicated UDP port Error message when starting server[forums.srcds.com]

Knowledge:

The SRCDS forum is a great place for all things srcds related[www.srcds.com]
Valve's developer wiki is also a great place for looking up srcds related things

Networking/tickrate/rates:
NOTE: Many of the things in these articles are outdated! I link them only for the people who are curious about the more advanced nitty gritty network/engine stuff. Especially concepts like modifying tickrates, pingboosting/FPS won't work with newer SRCDS games (and are therefore mostly irrelevant but might make for interesting reading).

Valve's page on how the network model works
Lag, choke loss and ping explanation[www.etcwiki.org]
Old (mostly outdated) article on high to optimize a server
Explanation of tickrate[whisper.ausgamers.com]
Old article on how to get high tickrate and high rates[forums.srcds.com]
Changelog
This is a changelog where I (and you) can keep track of what I've changed in the guide. I already changed a lot since the guide began and I can't remember it all unfortunately.

15-04-2014:

Made a first pass on the guide based on what I've read and some tests I've done myself. Most of the beta only observations have been removed such as recommending VAC off and sv_consistency set to 0. Also updated the map list under launch parameters.

A lot of new cvars have been added. The Contagion specific ones were too many to list here but there are a couple that are handy that I will list once I work my way through them. Difficulty settings have been added which is nice and the new cvar for that is quite simply difficulty. Doesn't get much easier than that!

A lot of cvars have been removed as well specifically all the gamemode specific ones. Since most of the interesting ones changed Extraction settings I guess I understand their removal with the introduction of difficulty settings.

A few others have been axed as well such as sv_maxvisibleplayers. Sadly my much mapcyclefile still hasn't been implemented which makes it impossible to properly host multiple servers with different gamemodes. I am still not 100% sure how timelimit and roundlimit works nor how exactly map rotations are being controlled. I'm determined to find out soon though.

I added notes about the possibility of executing additional cfg files using the exec launch parameter. Also worth noting is the continued absence of any kind of voting or MOTD cvars/settings. Updated the server.cfg to remove redundant cvars and added a few new ones.

Still lots of things to test and change. Watch this space :)

12-04-2014:

The game is out of beta/early access! There's been a lot of changes so watch this space. I'll slowly have to worm my way through new and/or changed cvars, settings etc. Also have to test and remove any and all beta related things referred to in this guide.

24-03-2014:

To my great surprise it appears that maplist.txt really isn't used anymore. It now uses mapcycle.txt after all. Both my mapcycle and maplist files were identical which explains why I didn't spot it before. This is an improvement although sadly the mapcyclefile cvar still hasn't been implemented. This means there's still no way to run multiple servers with different maps/gamemodes because the gametype is defined by the map.

Had the opportunity to observe mp_roundlimit in action. As far as I can tell it only counts "wins" as a round. So if you play Extraction and you die/fail a round that doesn't actually count as a round as far as the roundlimit goes. This is based on the fact that I had roundlimit set to 4 and had various groups play Barlowe Square for 1½ hours without ever changing maps. For Hunted it works as before but then there's isn't a fail/win dynamic since there will always be a winner at the end of each round which counts as a round.

This still begs the question: what did the devs mean when they stated that the roundlimit cvar had been fixed?

16-13-2014:

A bunch of new cvars for Hunted have been added. They all deal with the scores you get for various kills etc. Extraction got its own "PlayerJoinTime" equivalent. Still unsure what exactly it does. mp_roundlimit is confirmed to work fine with Hunted (as it used to do), Extraction is still uncertain and I haven't tested Escape yet.

My theory that maplist.txt was broken is untrue. Only the maps in that file (and in that order) are used on the servers.

Imported the Contagion specific cvars in to the server.cfg and rewrote the whole thing / cleaned it up so that it looks nicer. A clean server.cfg means a happy server!

15-13-2014:

A long time between updates but haven't really played much Contagion and not much has changed either. There have certainly been many updates and even two new maps have been added but as far as server administration goes not much interesting. Outside of the new maps (which only have Hunted versions so far) it's mostly been bug- and stability fixes. Multiplayer does seem to be even more robust as far as I can tell though so good job devs!

One thing was mentioned recently in an update though and that is that mp_roundlimit has "finally been fixed and is working". Strange since I found out back in January what that cvar actually does, though it only seemed to affect Hunted and Extraction back then. Perhaps they mean that it now works for Escape as well but I haven't tested that yet.

Not sure either whether new cvars were added or existing ones changed but I did seem to notice that the launch parameter servercfgfile suddenly wasn't recognized anymore. That would be most unfortunate since it's the primary way of having separate configs for each server. Perhaps it's a bug.

Also changing the maps in the maplist-file no longer seems to affect the available maps or their rotation which is darn unfortunate unless a new alternative exists. Tried modifying the mapcycle-file in hopes that one works but no luck either. Will have to test this further.

25-01-2014:

Finally figured out what mp_roundtime and mp_timelimit is used for. Also figured out what the "playerjointime"-cvars are for. Updated the cvars and contagion specific cvars sections.

05-01-2014:

Did an overhaul on the ports section and yet I am not 100% sure if my info is accurate. Problem is that 3 different online articles tells me 3 different things so what ports are actually needed and which are not is not entirely clear.

Also updated the cvar section a bit to explain about using cvarlist to get subsections of cvars.

Modified the parameters section again. Changed the -game parameter section to be much more simple and less prone to inexperienced admins.

30-12-2013:

New patch was released but it doesn't seem to directly influence server administration. Have to check later if any cvars were removed or added.

Modified the section about parameters to be more clear about what paths you have to change if you rename your Contagion root folder or move the bat files somewhere else.

29-12-2013:

Added my discovery of the cont cvars although they appear to mostly be client side.

Finally got around to adding a troubleshooting section. So far it only concerns not being able to see/join the server online since that is the most typical issue people run in to.

Also added a section with all the links I have to various articles that have helped me understand running a dedicated server better.

ExtractGPSUpdateTimer
ExtractionGPSUpdateDistance

These two cvars have been removed from the game so I've removed them from the cvar list. A patch was released a few weeks earlier but apart from the removal of these two cvars nothing of note was changed that directly influence server hosting.

BEFORE:

The guide has been read more than 1000 times which is quite something. Didn't expect that! I hope it has helped people host working servers. The comments section is mostly full of issues that people have (as I expected). I try my best to answer them and find a solution but I won't always be able to sadly. Surprisingly the problems people have run in to are either things that I can't reproduce myself (like the -insecure issue) or things I have never ever run to before myself. It always bothers me when people have problems I can't fix or find a decent answer to.

The advantage of having finally written a guide to a Source game server is that I got to re-educate myself. A lot of the things I knew were actually outdated or in some cases completely wrong! The section about settings and cvars has been heavily modified to reflect this. Hopefully not too many people were shaking their heads at my ignorance or were frustrated by the bad explanations I gave.
Changelog 2
17/03/2017:

Recently booted up Contagion again and so I decided to have a look at the guide and what has changed for dedicated servers. The answer turned out to be: not so much. Most changes since I last updated this have been fixes and optimizations to rendering, AI, meshes and navs.

I did change a few errors here and there in the guide. Mostly changed stuff related to rates. Played around with some server settings and looked through the newest cvar list but didn't notice anything major so this guide is still very much viable.

10/09/2014:

It's been quite a while since I last had a look at the guide but there's been little reason to update it. Except for two new maps nothing noteworthy has happened in terms of server hosting. Also I haven't really played the game for months but fortunately the guide is in a state that I am very happy with. The major inconsistencies have been ironed out and it serves as a decent intro to getting started without trying to give all the possible answers. It should be able to survive without being frequently revisited as long as the basics don't change.

Due to Steam sales the game has sold quite well and it's also reflected in number of views. From hovering at a steady number the guide has been viewed 200 times more in the space of just a few weeks. The rating also went up from 3 to 4 stars for which I am very grateful!

A while back I had to deal with plagiarism as someone, who has made guides for other Source games, made one for Contagion. Being curious as to its content I read it and suddenly discovered that many pages were a word for word copy of my own guide. When confronted I was given a vague answer that implied he was simply copying mine as a reference point for rewording it in his own style. Unfortunately that still counts as plagiarism.

Before I got a chance to respond his guide was suddenly trimmed and he offered to link to my guide as an alternative. Since his original response was somewhat hostile and implied that his guide intended to be better than mine I reckon this turnaround attitude was a result of moderators having had their hands on the matter.

I never took the matter any further (I also never heard from any moderators so I am not sure what actually happened) but as a peace offering I did link to his guide from mine. His is a more matter of factly version with plenty of screenshots and deeper explanations for some things that I simply link to. I don't claim neither his nor mine is the best - in fact I suggest you read both to cover all the ground.

28/06/2014:

There have been some minor updates to the game but nothing earthshaking. I gave the guide a gentle restructuring and re-did the cvar and launch sections in particular. Hope it makes things a little clearer.

24/05/2014:

The game has been updated quite frequently after release with lots of changes. I still have to get around to them all and check things out. The guide has been updated to reflect many of the major things.

Tickrate 66 has been in for a while but I had problems where got kicked off my servers as soon as they joined so I didn't update the guide. My own servers still have the problem but for many others it works fine so it must be a configuration issue on my side. Guide has been updated with info about switching tickrates.

Two new game modes have been release: Zombie Panic Classic and Zombie Panic Objective. 3 of the Hunted maps have Panic Classic versions and the Escape map Roanoke PD has a Panic Objective version. The prefix is cpc and cpo respective for both the maps and relevant cvars.

Other than that I mostly fixed grammar mistakes, corrected some info and adjusted other things. I probably need to do a complete overhaul since I often mention the same things on multiple pages and only "fix" them in one when something changes.

18/04/2014:

Several hotfixes have been released quite rapidly after full release which is nice to see. Means the devs are listening to feedback and working hard to fix/optimize the game :)

A very interesting change was made in the latest update which was adding the tickrate parameter. Traditionally source servers have had locked tickrates for a while now so seeing this being added was surprising. Running at higher tickrate (66 being the max) would supposedly make the game better but at the cost of increased resource usage. However Contagion doesn't seem like the most CPU hungry game around which is good for people wanting to experiment with higher tickrates.

I was going to rewrite the sections of the guide talking about tickrate but after testing it out on three servers I found that I (and everyone else) got "kicked by console" as soon as we joined. This issue would only go away once I reset the tickrate back to standard. A bit unfortunate really; no amount of messing around with settings seemed to have an impact :(

16/04/2014:

Ran out of characters for the changelog so had to start a new one.

First of all: I am dumb. I have been ranting about mapcyclefile for ages, even posted a question on the Steam community about it, only to find out later that it was actually implemented after the game came out of beta. Anyway, guide has been updated to reflect this!

Also the motdfile-cvar has been implemented. However there is no default motd file at the moment and I haven't tested whether it actually works or not. Note to self: test it!

Other than that just minor changes and corrections here and there. The amount of views the guide has had has increased after the game went live. No comments on it which I assume is a good thing.
66 Comments
Bruce Nov 24, 2018 @ 10:39am 
Você não é o Bolsonaro, mas é um mito
You're not the Bolsonaro, but it's a myth.
Вы не Bolsonaro, но это миф.
T.TV/SdPMMello Dec 27, 2016 @ 3:24pm 
Host_NewGame on map ch_auroraestates
Executing dedicated server config file
The nav mesh needs a full nav_analyze
Failed to load Steam Service
ServiceStart: failed to start
ServiceStart: failed to start
Writing cfg/banned_user.cfg.
Writing cfg/banned_ip.cfg.
memstd.h (83) : Assertion Failed: pdw[1] != FREE_BLOCK_MARKER
Assert( Assertion Failed: pdw[1] != FREE_BLOCK_MARKER ):e:\buildslave\steam_rel_client_win32\build\src\tier0\memstd.h:83

memstd.h (83) : Assertion Failed: pdw[1] != FREE_BLOCK_MARKER
memstd.h (83) : Assertion Failed: pdw[1] != FREE_BLOCK_MARKER
memstd.h (83) : Assertion Failed: pdw[1] != FREE_BLOCK_MARKER
memstd.h (83) : Assertion Failed: pdw[1] != FREE_BLOCK_MARKER
Connection to Steam servers successful.
VAC secure mode is activated.
T.TV/SdPMMello Dec 27, 2016 @ 3:23pm 
28.8 fps 0/12 on map ch_auroraestates
#Console initialized.
#Steam is not active, running in -insecure mode for server.dll.
#Signature not valid for module 'server.dll'.
#Loading unsigned module server.dll. Access to secure servers is disabled.
#Game.dll loaded for "Contagion"
Server is hibernating
ConVarRef test_progression_loop doesn't point to an existing ConVar
ConVarRef difficulty doesn't point to an existing ConVar
ConVarRef cg_zombie_ai_only doesn't point to an existing ConVar
ConVarRef cg_infection_disabled doesn't point to an existing ConVar
Game supporting (2) split screen players
maxplayers set to 12
NET_GetBindAddresses found 172.31.1.101: 'AWS PV Network Device #0'
Network: IP 172.31.1.101, mode MP, dedicated Yes, ports 27050 SV / 0 CL
---- Host_NewGame ----
#######################################
Map ch_auroraestates missing stringtable dictionary, don't ship this way!!!
#######################################
T.TV/SdPMMello Dec 27, 2016 @ 3:23pm 
My server is not showing in the server list, what i'm doing worng? (its a Amazon AWS service... i opened all ports in windows firewall)

Mercury Feb 9, 2016 @ 9:14am 
why is MY server just running as lan server ?! ITS WORKING AS LAN WHY?! i tried many times to reinstalls the datas. used many scripty and parameter but it doenst matter ! It not work. i can play on it but nobody else. please help me.
鼠不尽的快乐 Dec 27, 2015 @ 12:16am 
nice! but i don't know english:germanhelmet:
Frengler  [author] Nov 24, 2015 @ 7:20am 
Sadly, none of those messages clearly indicate an error. Many of them are common warnings that you get even on perfectly working servers. And since I no longer actively play or host Contagion I can't really go too much in depth with this. I would suggest there's an error with the installation itself except if you can play a map and people only crash/disconnect when it switches to a new map it may indicate other issues.
Doc Toxic Nov 10, 2015 @ 6:07pm 

material models/survivors/yumi/yumi_hair has a normal map and an envmapmask. Mu
st use $normalmapalphaenvmapmask.

KeyValues Error: RecursiveLoadFromBuffer: got } in key in file materials/weapon
s/v_remington870/remington_attachments_reddot_glow.vmt
UnlitGeneric,
KeyValues Error: RecursiveLoadFromBuffer: got } in key in file materials/weapon
s/v_remington870/remington_attachments_reddot_glow.vmt
UnlitGeneric,
The nav mesh needs a full nav_analyze
The nav mesh needs a full nav_analyze
Failed to load Steam Service
ServiceStart: failed to start
BOpenService failed
ServiceStart: failed to start
Unknown command "Overrides"
Unknown command "sv_visiblemaxplayers"
Unknown command "Maximum"
Unknown command "mp_maxrounds"
Doc Toxic Nov 10, 2015 @ 6:06pm 
---- Host_NewGame ----
#######################################
Map ce_barlowesquare missing stringtable dictionary, don't ship this way!!!
#######################################
KeyValues Error: RecursiveLoadFromBuffer: got EOF instead of keyname in file ma
terials/models/props_train_station/outer_light01_bulbmetal.vmt
VertexLitGeneric,
KeyValues Error: RecursiveLoadFromBuffer: got EOF instead of keyname in file ma
terials/models/props_train_station/outer_light01_bulbmetal.vmt
VertexLitGeneric,
KeyValues Error: RecursiveLoadFromBuffer: got } in key in file materials/models
/props_suburbs/bookshelf03_wood.vmt
VertexLitGeneric,
KeyValues Error: RecursiveLoadFromBuffer: got } in key in file materials/models
/props_suburbs/bookshelf03_wood.vmt
VertexLitGeneric,
Host_NewGame on map ce_barlowesquare
L 11/10/2015 - 20:00:00: -------- Mapchange to ce_barlowesquare --------
L 11/10/2015 - 20:00:00: [SDKTOOLS] Invalid detour address passed - Disabling de
tour to prevent crashes


Doc Toxic Nov 10, 2015 @ 6:04pm 
#Steam is not active, running in -insecure mode for server.dll.
#Signature not valid for module 'server.dll'.
#Loading unsigned module server.dll. Access to secure servers is disabled.
#Game.dll loaded for "Contagion"
Server is hibernating
ConVarRef test_progression_loop doesn't point to an existing ConVar
ConVarRef difficulty doesn't point to an existing ConVar
ConVarRef cg_zombie_ai_only doesn't point to an existing ConVar
ConVarRef cg_infection_disabled doesn't point to an existing ConVar
Game supporting (2) split screen players
maxplayers set to 12
NET_GetBindAddresses found 10.10.10.10: 'Microsoft Virtual Machine Bus Network A
dapter'