# Play with model trains in OpenTTD

:Author: Seth Kenlon
:Email: [email protected]
:License: CC BY-SA

My father has always been fond of model trains, and I remember watching him building a track around the Christmas tree when I was young.
When [Lego](https://opensource.com/article/20/6/open-source-virtual-lego) train sets were released, he and I transitioned to them for their convenience and inherent extensibility.
We built and operated Lego trains and monorail tracks over the course of many years, and I've often imagined a possible future in which I have a garage or a basement dedicated to miniature landscapes and elecrical whistling trains.
Then again, the probability of me diving that severely into yet another hobby is pretty low, and so I was very happy to discover that *virtual* model railways can provide me with much of the same satisfaction.
The engine for my virtualized hobby is [OpenTTD](http://openttd.org), an open source simulation game based on an old '90s game called **Transport Tycoon Deluxe**.

## Installing OpenTTD

You can download OpenTTD for Linux, macOS, and Windows from [openttd.org/downloads](https://www.openttd.org/downloads/openttd-releases/latest.html).

On Linux, download the Generic installer and extract the package with `tar`:

```bash
$ tar xvf openttd-x.yy.z-linux*.tar.xz
```

Alternately, OpenTTD is available on [Steam](https://store.steampowered.com/app/1536610/OpenTTD/) (Steam isn't open source, but it's a common cross-platform gaming platform).

## Launch OpenTTD

Change into the directory and launch the game using the local `openttd` command:

```bash
$ cd openttd*
$ ./openttd &
```

Upon first launch, OpenTTD alerts you that you must download a graphic set.
This is automatically installed in the Steam edition, but it's a single-click in the stand-alone app.
And anyway, because OpenTTD is open source, it's well modded, so you'll end up downloading a lot more than just the default graphics.

After the graphics have been downloaded, you're presented with the quaintly diminutive interface.
I find a 640x480 interface a little small, and while the old graphics do hearken back to simpler computing days, a slight upgrade for modern screens is helpful.
For that reason, your first stop is the **Check online content** button.

## Loading mods

The **Content downloading** screen provides you with a window to approved OpenTTD mods, which can provide improved graphics, new music, map names appropriate to your location or interests (I use the New Zealand set so all of my generated cities sound familiar, although since 2020 I've started using the Fallout 3 set), train models, and more.
There are *a lot* of mods, so use the search bar in the top right to narrow your choices.

Here are the mods I consider essential:

* **abase** High res graphics. At nearly 300 MB, this is the largest download you're likely to need (the game itself is barely 50 MB).
* **OpenSFX** A sound set so you can hear the traffic in cities, the horns of the boating industry, and the very satisfying whistles of trains.
* **Town names** The default names of cities are fun, but I find it easier to remember names that feel local.
* **Trains** OpenTTD has a default set of train models that work perfectly well, but if you're a trainspotter already then you might enjoy downloading some additional train sets. I use the NZR set, but there are lots of trains available, including trains from the UK, the USA, Austria, Belgium, Czech Republic, and on and on down the alphabet.
* **Beginner tutorial** A scenario to help you learn the game and its interface.

### Game engine defaults

Once your new assets are downloaded, you must set them as your defaults.
There are two places for this: one for game engine defaults, and one for in-game scripts and assets.

![OpenTTD game menu](openttd-menu.jpg)

Click the **Game Options** button.
In the **Game Options** screen, adjust these settings:

* Set the **screen resolution** to your preferred interface size
* Set **base graphics set** to **abase**
* Set **base sounds set** to **OpenSFX**

Close the **Game Options** screen.
Your changes are saved automatically.

### In-game options

From the main menu screen, click the **NewGRF Settings** button.

![OpenTTD mods](openttd-newgrf.jpg)

Inactive mods are listed at the bottom of the **NewGRF Settings** window.
To activate one, select it and click the **Add** button, in the bottom left.
Once you've chosen the mods to activate, click the **Apply** button.

## Tutorial

If you downloaded the **Beginner tutorial** scenario, you can start learning OpenTTD by playing through it.
To start the tutorial, click the **Play scenario** button near the top of the main menu screen.
Select the tutorial and begin.

The tutorial gives you a full tour of the game's interface, and it takes some time to get through it.

## Quick start

By way of a quicker introduction, here's what you need to know: vehicles come from depots, and everything needs a schedule.
By remembering those two rules, you can get started building trains (and roads and seaports and airports) right away.

### Build stations

To build a simple rail line between two cities, click the railway track icon in the top icon bar.

![Railways](openttd-iconbar-railway.jpg)

Railways start and end with stations, so I usually place a station at each end of my intended line.
Click the train station icon (mouse over it to see its label).
For a train station to serve a region, its area of effect must overlap with as much of the region as possible.
To see a station's coverage, enable **Coverage area highlight** by clicking the **On** button at the bottom of the station dialogue box.

![Station coverage](openttd-window-station.jpg)

The dark grid overlay represents coverage, while the white grid overlay shows the physical footprint of the station.
As you hover over an area, the supplies that a station's coverage enables are listed in the station popup window.
Start simple and create a single-track, 4-car platform.
Do this twice between two cities on the map.

![Station coverage](openttd-create-station.jpg)

### Lay the rails

Next, connect the stations with rails.
The isometric view of OpenTTD takes some getting used to, but after clicking on the rail icons and clicking and dragging on the map, you start to get a feel for it.
The X-rail icon provides an "autorail" mode, which aligns the track based on where in a square you click.

Be careful as you lay your rails.
OpenTTD is rather unforgiving, so once you click in a square, rails are constructed.
To remove rails once they've been laid, you must use the dynamite icon to remove them.
Just like in real life, there's no undo button.

### Train depot

Trains come from a depot.
So to add a train to your railway, you must add a depot somewhere along the line.
Click the depot icon and place a depot near an existing rail.
Connect the depot to an existing track to ensure your trains can get from the depot to the appropriate (in this simple example, the only) line.

![Creating a depot](openttd-create-depot.jpg)

### Model trains

At long last, you get to add a virtual model train to your virtual railway.
To create a train, click on your depot.

Click the **New Vehicle** button at the bottom of the depot window for a listing of available train engines and cars.
The list you get depends partly on what models you've added from the downloadable content.
Generally, there are three types of engines: steam, diesel, and electric.
Early in the game, which starts in the year 1950, you have only steam.
As the years progress, you get innovative new models you can use as upgrades.

![Creating a train](openttd-create-train.jpg)

For now, create a simple train that includes an engine, a passenger car, and a mail car.
If you want to add other kinds of cars, click on your stations to confirm the kinds of supplies they're able to accept (as determined by its area of coverage).

### Create a train schedule

Now that you have a railway and a train, you must create a train schedule.
Schedules are attached to vehicles, so any time you add a new vehicle of any kind, you must add a schedule for it to be useful.

To add a schedule to your train, click the number to the left of the train in its depot listing.
This opens a viewport for the train, with buttons along the right side of the window.
Click the arrow icon to see that train's schedule.

![Scheduling](openttd-create-schedule.png)

To create a schedule, click thi **Go To** button at the bottom of the schedule window, and then click on the station you want to set as the first destination.
Then click the next station.
You can adjust loading and unloading requirements by selecting a stop in the schedule and browsing the options in the **Full load** and **Unload** drop-down menus, and you can adjust routes (should you develop new routes) in the **Non-stop** drop-down menu.
The options are plentiful, and as cities grow and your map becomes more developed, you may have to adjust your strategy.

But for now, click the red **Stopped** button at the bottom of your train viewport to put your train into service!

![Station to station](openttd-train.jpg)

## Try OpenTTD

OpenTTD is a simulator, but it's also a game, so you do have constraints, including a budget, and parameters you might want to optimize.
For instance, you can click on a city or farm or factory to discover what kind of imports and exports are acceptable to it.
You can borrow money by clicking the budget button in the bottom right corner of the OpenTTD window.
And it's not just a virtual train set.
You can build roads, airports, seaports, and more.
Just remember that all vehicles need depots and schedules, and you're half way to a successful virtual enterprise.

OpenTTD has an active and enthusiastic community, so there are lots of resources and tutorials available online.
Download the game and give it a try!