OpenTTD Server – or How to build enormous railroads virtually

My kids love the transportation simulation OpenTTD, a fantastic game made by the geniuses behind Spotify, among others. It’s an open version of the old Transport Tycoon Deluxe, which was a sequel to Railroad Tycoon. Amazing game, and great fun.
It’s a multiplayer game that can be played over the internet, and to make sure that the game is available at all times I installed a virtual server called ttdserv on my KVM server (named runner) in the rack downstairs. With 384MB of RAM (the KVM host is running a total of five servers at the moment, this being the largest) and 12GB of disk, it’s running flawlessly.
All I had to do was install a Debian server via network install, choosing only the openssh server among the prepared packages, and after a completed install do

apt-get install openttd screen

That installs a whole lot of things, such as a full window management system, but it’s quite reasonable to have running on the virtual machine anyway. The screen package is to make sure the server can be kept running when logged of (it’s not normally run as an init.d script or daemon, but I’ll try and correct that later).

All that remained then was logging on via ssh, activate screen, and run the OpenTTD with a specific switch. Problem was to get the game configured the way the kids wanted without editing the openttd.cfg file (I haven’t had time to learn the options yet). So… I logged on and ran a remote OpenTTD session (i.e. via “ssh -Y ttdserv.lan”), created a game that had the options set as the kids wanted (gigantic map, lots of industries and cities) and saved it once it had started up.

Then it was just a matter of starting the OpenTTD game in daemon mode (see below), and at the command prompt load the game I just created.

openttd -D
(console output)
dir (to get a list of available games)
load 2 (to load game indexed as 2 in the list from dir)

And… bam! The kids could connect to the server and play.
Oh! And to make sure outsiders could connect I also opened port 3978 and 3979 for TCP & UDP at my firewall.

Advertisements

About magvar

Technical guy, worked with computers since I was twelve, complete nerd, but managed to get married and am now the happy father of three kids.
This entry was posted in Uncategorized and tagged , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s