HLDS on EC2


Update Jul 2014 – use the shiny new SteamCMD tool. Also, I started using DigitalOcean instead of EC2 (marginally cheaper, incredibly easier to setup)

Create a Instance – spot works

Install wget, tar, ncompress – depends on your distro, fedora 17 by default didn’t come with this (which, btw, is WTF?!) Also, screen to run disconnected from the server, and vim for text editing

wget http://media.steampowered.com/client/steamcmd_linux.tar.gz && tar -xvzf steamcmd_linux.tar.gz && ./steamcmd.sh

download the actual HLDS server

mkdir tf2 && ./steamcmd.sh +force_install_dir tf2 +login anonymous +app_update  232250 +quit

setup the config files

cd tf2/orangebox/

touch cfg/server.cfg && vim cfg/server.cfg – specify what you want, I pulled mine from forums.srcds.com/viewpost/67692#pid67692

./srcds_run -game tf -autoupdate -maxplayers 32 -console +map mvm_coaltown

Notes:

Pull map names from TF2 wiki, eg wiki.teamfortress.com/wiki/Mann_vs._Machine_%28game_mode%29 has the map filenames listed under “Maps”.

If you’ve got iptables running *in addition to* the aws security groups, disable iptables, or allow exceptions for the HLDS ports (UDP 27000-27015).

A t1.micro instance *isn’t* suitable for a tf2 server. The way Amazon has it set up is that Micro instances will have their CPU stolen by other instances if necessary. While this rarely happens to any great effect, when it does, there’s a large ping spike.

List of console commands, unknown how many map to the server: developer.valvesoftware.com/wiki/List_of_TF2_console_commands_and_variables

Official Valve post on setting up HLDS: support.steampowered.com/kb_article.php?ref=6758-TCMF-2234 (Wasn’t too helpful, also Windows specific.)

On the client, you have to set rcon_password to the server password, *then* issue rcon commands. Doing “rcon password” in the client won’t work.

Some other stuff relating to HLDS here: wiki.teamfortress.com/wiki/Linux_dedicated_server

Potential mods: www.mani-admin-plugin.com/cms/index.php/about and wiki.alliedmods.net/SourceMod

18th Aug update:

For some reason, auto-update failed, had to manually update.

3:07 Updating 'Team Fortress 2 Content' from version 350 to version 352

A symptom was a bunch of messages showing up in the log:

MasterRequestRestart
Your server will be restarted on map change.
Your server will be restarted on map change.

Also, a bunch of config changes coming too.

Aug 19th: Since I’m jumping between EC2 regions spinning up servers as and when I want to play on them, a ‘one’-line command to get the TF2 server up & running is now here

Also, 3 files are edited in the orangebox/tf folder: cfg/server.cfg, mapcycle.txt and motd.txt

A pretty extensive sample server.cfg was posted here: forums.steampowered.com/forums/showpost.php?p=32341843&postcount=1

If the servers were going to be around for a while, register them with Valve as per support.steampowered.com/kb_article.php?ref=2825-AFGJ-3513 for Quickplay support

More plugins: forums.alliedmods.net/showthread.php?t=84801, www.sourcemod.net/newstats.php?mod_id=558&addon_id=0, forums.alliedmods.net/showthread.php?p=592536 and forums.alliedmods.net/showthread.php?p=532620

RCON Guides: forums.srcds.com/viewtopic/13192 and www.uk-tf.co.uk/index.php/rcon-guides#Kicking%20&%20Banning%20players

, , ,

  1. #1 by Alan on September 5, 2012 - 2:39 pm

    I’m trying to set up a TF2 server on EC2 as well, and I’m curious what your monthly bill is to run this. I love the possibility of building and running it all myself, but if it’s going to cost more than renting a pre-built server, I may as well do that.

  2. Avatar photo

    #2 by Kyle Lexmond on September 10, 2012 - 9:56 pm

    Alan :

    I’m trying to set up a TF2 server on EC2 as well, and I’m curious what your monthly bill is to run this. I love the possibility of building and running it all myself, but if it’s going to cost more than renting a pre-built server, I may as well do that.

    Ok, I’ll keep it simple: Don’t.
    The price of the instance isn’t bad. But the bandwidth used will drive up the price you pay dramatically. I left it running for 36 hours as an MvM instance, and it used just over 3GB of bandwidth. Amazon’s free tier is only 1GB. I caught it before it went really over – only $0.22, but I can’t imagine what the bill would be like if I left it running for a month.

(will not be published)