A Left 4 Dead 2 server on a VPS: tickrate, plugins and custom campaigns
Left 4 Dead 2 came out in 2009, and by today's standards its server weighs almost nothing. One process takes a few hundred megabytes of memory and a single CPU core. So the question here isn't whether a plan is big enough, but how fast its core is and how many servers fit on one machine. Plenty of people keep co-op, versus and a test server for new campaigns on the same VPS.
Which plan you need
- One server for your group of four. The simplest plan with 1 GB of memory and a fast core at 3 GHz or more. Regular co-op needs nothing more.
- A 60- or 100-tick server, 8-player versus. 2 GB of memory and a higher-clocked core. A higher tickrate loads the processor proportionally, and in versus eight players and hordes of infected are all active at once.
- Several servers on one machine. Count one fast core and about 512 MB of memory per server, plus headroom for the system. Have a look at the high-frequency VPS selection.
The Source engine simulates the game in one thread, so eight slow cores are worse than two fast ones. When the core can't keep up, players notice the hit registration going wrong: point-blank shotgun blasts miss, special infected attacks land late, and everything starts to stutter during a horde.
Tickrate: what it is and whether to raise it
Tickrate is how many times per second the server updates the world and sends data to players. Left 4 Dead 2 defaults to 30 ticks. That is enough for relaxed co-op, but in versus and on hard difficulties 60 or 100 ticks are noticeably more precise: shots register better and special infected move more smoothly.
Simply adding -tickrate 100 to the launch line isn't enough. You need the Tickrate Enabler server plugin and matching network variables in server.cfg: sv_minrate and sv_maxrate, sv_minupdaterate and sv_maxupdaterate, sv_mincmdrate and sv_maxcmdrate, plus fps_max 0. If you raise only the tickrate and leave the old limits, players still get 30 updates per second, just with more load on the server.
Installation and connecting
The server is installed through SteamCMD as app 222860 with an anonymous login and runs on Linux and Windows. Linux is more convenient on a VPS, for example an Ubuntu VPS or Debian. Keep in mind that the server program is 32-bit, so a 64-bit system needs the 32-bit libraries, otherwise srcds_run simply won't start.
The main port is 27015. The game runs over UDP, and remote management through RCON over TCP. Open 27015/UDP and leave TCP open to your own IP only. If the machine runs several servers, each needs its own port through the -port parameter.
The most common complaint after installation is that the server is running but friends can't get in. Usually the lobby system is in the way. To connect directly with connect address:port in the console, set sv_allow_lobby_connect_only 0 in server.cfg. And to make your Steam group's lobbies always land on your server, put the group ID into sv_steamgroup and turn on sv_steamgroup_exclusive 1.
Plugins and custom campaigns
Almost all server add-ons run on MetaMod:Source and SourceMod together. On top of them you install admin menus, stats, campaign votes and ready-made configs for competitive versus. Admins are listed in addons/sourcemod/configs/admins_simple.ini by Steam ID. Eight slots is the limit without modifications. The L4DToolZ extension together with the sv_maxplayers parameter allows more players, but the game's balance isn't designed for that many people.
Custom campaigns go onto the server as .vpk files in the left4dead2/addons folder, and every player needs the same version of the campaign. The game doesn't hand such files out from the server, so give your friends the campaign's Steam Workshop link in advance: subscribing installs it automatically. If a player has updated the campaign and the server hasn't, they won't be able to connect, so update the files on the server as soon as a new version comes out.
Where to put the server and whether you need protection
It's a shooter, and ping decides a lot. For players in Europe, a server in Germany or the Netherlands keeps most of the continent within 20–40 ms. North American groups should stay on their own continent: the trip across the Atlantic adds around 80–100 ms, which is still tolerable in co-op but clearly felt in versus. If some of your players are in Russia or the CIS, Finland gives them a short route. You can compare locations on the VPS in Europe and VPS in the USA pages. Source engine servers have long been a frequent target of floods aimed at server list queries, so for an open public server choose a plan with DDoS protection. Counter-Strike uses a similar srcds and SourceMod setup; compare with the VPS for CS2 page.