Steam

Setting up a dedicated server for Left 4 Dead 2 (L4D2) is almost exactly the same as Left 4 Dead (L4D) which I covered a while ago.

I knew that L4D2 would take up more space and so I started out with a 15Gb virtual hard drive this time. After installing a minimal virtual machine, open-vm-tools and L4D2 I had 4.6Gb of free space. Hopefully that will remain enough!

First update Ubuntu Server:

sudo apt-get update
sudo apt-get upgrade

If you do not have wget installed then install it as follows:

sudo apt-get install wget

Create a new folder for downloading and installing L4D2:

mkdir hlds

Download the hldsupdatetool from Valve:

wget http://www.steampowered.com/download/hldsupdatetool.bin

Make hldsupdatetool.bin executable:

chmod +x hldsupdatetool.bin

Run the hldsupdatetool:

./hlsupdatetool.bin

Type yes to the agreement and then press enter to continue.

Now make Steam executable:

chmod +x steam

Run Steam to download the Left 4 Dead files:

./steam -command update -game left4dead2 -dir /home/username/hlds

Note: you will most likely be prompted to run the last command again as the first time it runs it will update steam and not install Left 4 Dead.

Left 4 Dead files will now install to /home/username/hlds/left4dead2/ – this may take some time, so you may want to make a cup of tea. Once Left 4 Dead 2 has installed we need to to create a server configuration file called server.cfg and a script to run the server.

Create files called server.cfg and autoexec.cfg in the following location /home/username/hlds/left4dead2/left4dead2/cfg:

-console: This will display a console that you can type commands into.

-game left4dead2: This specifies that the server will run L4D2.

-maxplayers 8: This will specify the maximum number of players the server will allow, setting it to 8 should allow you to use versus mode, otherwise set it to 4 for survivors only gameplay.

-autoupdate: This will make the server check and update to the latest version when you launch it but this needs a manual fix to work properly.

+hostip: where xx.xx.xx.xx is your internet address.

+ip: where xx.xx.xx.xx is your Ubuntu server static IP address. .

-port 27015: This will specify the port for the server to run on – 27015 is the default port.

+sv_lan 0: This will force the server to run on the internet instead of just on a LAN.

+map c1m1_hotel: This will specify the map that the server will start with (and must be configured). You will find all the available map names on your server here: /home/username/hlds/left4dead2/left4dead2/maps

Make your startl4d2server script executable:

chmod +x startl4d2server.sh

At this point you can run the server as follows:

./startl4d2server.sh

To connect to the server from your (LAN) PC you will need to enable the “Developer Console” in the game options as follows:

At the main menu select Options then Keyboard/Mouse followed by the Allow Developers Console option.

You can then use the ~ key to bring up the console and then type:

connect xx.xx.xx.xx

Note: xx.xx.xx.xx is the LAN IP address of the server.

To allow internet users to connect you will need to open port 27015 directly to the server LAN address. Friends connecting from the internet will then be able to connect to the WAN ip address of your server using the password that you provided them.

Note: if your router supports it you may be able to dispense with +ip and +hostip in your startl4d2server.sh script.

Valve will release new down-loadable content (DLC) called “The Sacrifice” for Left 4 Dead and Left 4 Dead 2 on October 5th. This DLC will be free for PC gamers!

“The Sacrifice” is a prequel to “The Passing” and includes the original Left 4 Dead survivors as they fight their way south. The Sacrifice campaign will be playable in Campaign, Versus, and Survival modes. There will also be a new finale where players have to decide who will sacrifice themselves so that the other survivors may live.

Left 4 Dead 2 players will get to play The Sacrifice with L4D2 Special Infected and weapons, as well as being able to play in Scavange mode. L4D2 players will also get the “No Mercy” campaign from L4D1 which, again, will be played with the L4d1 survivors.

The Sacrifice also boasts five new achievements.

Personally, I am really looking forward to playing “No Mercy” on L4D2!

Aside from setting a password with the sv_password cvar in your server.cfg there is another way to make your server private, and that is to associate it with a “steam group”.

The advantage of this method is that you can invite players to your steam group and only those players will be able to play on the server – they will also see steam group servers when the game loads (so your server should be easy to join).

So the first step is to create a steam group. Once this is created the group admin (the person who created the group) will need to click on Admin Options and then Edit group profile to get the steam group ID.

Once you have the steam group ID you can edit you server.cfg as follows, (where ###### is your steam group ID):