Openttd Port



This is a recreation of the Transport Tycoon. Game is HTML5 compliant and can be played in every major browser like chrome or firefox. In single-player mode you can play in Transport Tycoon against computer (AI: AdmiralAI, AIAI, NoCAB, SimpleAI, Trans AI). Openttd.vpk can be found in cmake/ Running. OpenTTD will attempt to load everything from ux0:/data/openttd/ The easiest way to populate this is to install the PC version and copy the files across. In the future when network support is re-enabled the content downloader should be functional and this step will be skippable.

January 29, 2021

I found myself wanting to scratch my OpenTTD itch again but I need to setup another server as I had long ago nuked the server for part one. Turns out that part one is (unsurprisngly) a bit out of date after five years and this time I wanted to dabble in some custom graphics or GRFs for my server.

Openttd
  • OpenTTD port for the 3DS. A port of OpenTTD v0.7.0 to the Nintendo 3DS. Download the latest version of openttd.zip from the releases page. Extract its contents to /3ds/ on your SD card. I've only tried compiling this on Linux so I'm not sure if it will work on a non-Unix-like OS. Install the 3ds-sdl library using (dkp-)pacman.
  • This is a recreation of the Transport Tycoon. Game is HTML5 compliant and can be played in every major browser like chrome or firefox. In single-player mode you can play in Transport Tycoon against computer (AI: AdmiralAI, AIAI, NoCAB, SimpleAI, Trans AI).
  • What makes Linuxfx Special. The Linuxfx team has spent a lot of effort in tweaking a Linux distribution to look and feel like Window 10. It comes with a personnal assistant called Helloa which allows you to control smart devices that are compatible with Google Assistant.

For the first problem there is a an easy fix thanks to an OpenTTD docker image. As for the custom GRFs - well you’ll just have to keep reading.

For this guide I’m assuming:

  • That you’re running OpenTTD locally on a Windows desktop.
  • You have a Google Cloud account setup and you know your way around it a bit.
  • The OpenTTD server will run on Ubuntu.

Customising the Custom Graphics

I found the easiest way to get the graphics files setup was to do it in game via the New GRF settings

Once you are happy with your custom GRFs (making sure that they are compatible with each other!) it’s time fire up the command prompt and run OpenTTD as a local server using the following command:

This will make OpenTTD generate the config file and GRF files that our server can use. After a brief wait you can stop the OpenTTD server after it has finished generating the map and has started the game.

Next navigate to C:Users<username>DocumentsOpenTTD where you should see a openttd.cfg file and a content_download folder. These are the files we will be uploading to a storage bucket. It is a good idea to double check that the new GRFs are correctly included in the config file, you should see something like the following at the end of the openttd.cfg file:

Version

Google Cloud Setup

We will be running OpenTTD on the free F1-micro instance but first we have a few things to setup.

Storage

Firstly create a new Storage bucket for your OpenTTD files then upload the openttd.cfg file and content_download folder from the C:Users<username>DocumentsOpenTTD folder to a openttd folder in the bucket. Remember to edit the openttd.cfg file to your desired settings before uploading as this is the configuration your server will be using.

Port

After the upload has finished the folder in your bucket should look like the following.

Firewall

We need to add a firewall rule to the VPC network the server will be running in to allow the OpenTTD traffic through. Create a firewall rule that allows TCP and UDP on your desired OpenTTD port – by default this is port 3979.

Putting It All Together

Now it’s time to create a new VM instance but there are a few settings that need to be configured. Firstly, make sure to use a Ubuntu image and then assign a public IP to your instance to ensure that it is reachable over the public internet.

Then copy the following bash script after changing the OPENTTD_BUCKET_NAME in the script to the same name as the bucket you created earlier in this guide.

And paste it into the start-up script section for the VM.

Now create the instance and sit back and wait for the magic to happen 🧙‍♂️

Add the server IP via the in-game browser and you should be able to join!

Troubleshooting

If you can’t connect to your OpenTTD server here are a few basic steps you can try. Firstly, make sure you can ping the server via its public IP. Secondly, verify that the docker container is actually running on the server.

You can do this by running docker ps -a and you should see an bateau/openttd image in the results. If it’s not there it’s likely the startup script failed to run and you can try running the script manually. One easy way to do this is to upload the initialization script to the openttd bucket and run the following commands:

After the script has run check the docker container is running – if OpenTTD still isn’t running after this the problem is left as an exercise for reader.

Next Steps

Some next steps to consider for your server:

Openttd server port

Openttd Portable

  • Add a domain for your server.
  • Add cron job to upload save games to storage bucket so you can relive your greatest maps!