在 OpenTTD 中玩模型火车
OpenTTD 火车

> 
> 想玩实体模型火车，却没有足够大的空间？试试 OpenTTD 中的虚拟火车吧。
> 
> 
> 


![](/data/attachment/album/202110/27/100255emc3x33icci0cacc.jpg "Old train")


我父亲一直很喜欢火车模型，我记得我小时候，曾看着他在圣诞树周围建了一整条轨道。当 [乐高](https://opensource.com/article/20/6/open-source-virtual-lego) 火车套装发布时，因其便利性和固有可扩展性，我们转而投向了乐高火车的怀抱。多年来，我们热衷于建造和改装乐高火车及单轨轨道。我经常想象，未来我会有一个车库或地下室，专门用于微型景观和电动汽笛火车。强调一下，我沉迷于另一个爱好的可能性非常低，所以当发现 *虚拟* 模型铁路可以为我提供相同的满足感时，我很开心。我的虚拟爱好引擎是 [OpenTTD](http://openttd.org)，这是一款基于名为 **Transport Tycoon Deluxe** 的 90 年代老游戏的开源模拟游戏。


### 安装 OpenTTD


你可以在 [openttd.org/downloads](https://www.openttd.org/downloads/openttd-releases/latest.html) 下载适用于 Linux、macOS 和 Windows 的 OpenTTD。


如果你正使用 Debian Linux 或其衍生产品，甚至是[在使用 Chromebook](https://opensource.com/article/21/2/chromebook-linux)，你可以下载 `.deb` 包。使用 `apt` 命令安装它：



```
$ sudo apt install ./openttd*deb

```

如果你在使用其他 Linux 发行版，请下载通用安装程序，并使用 [tar 命令](https://opensource.com/article/17/7/how-unzip-targz-file)解压缩包：



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

```

OpenTTD 已经在 Linux、macOS 和 Windows 的 [Steam](https://store.steampowered.com/app/1536610/OpenTTD/) 中上架（Steam 是一个非开源的，但是很常见的跨平台游戏客户端）。


### 启动 OpenTTD


如果你安装了 OpenTTD，可以从应用程序菜单启动它。


如果你是下载了通用包，可以切换到游戏目录，使用本地的 `openttd` 命令启动游戏：



```
$ cd openttd*
$ ./openttd &amp;

```

首次启动 OpenTTD 时，游戏会提示必须下载图像集，在 Steam 版中会自动安装，但在独立应用程序中需要单击一下鼠标。无论如何，因为 OpenTTD 是开源的，经过了很好的改进，所以在默认图像之外，你最终还会下载的还有很多其他图像。


下载图像集后，你会看到一个古色古香的小型界面。我觉得 640x480 的界面有点小，虽然旧图像界面确实更有年代感（那时计算能力还比较弱），但一些适配现代屏幕的轻度升级还是很好用的。因此，你的第一步操作就是点击“<ruby> 检查在线内容 <rt>  Check online content </rt></ruby>”按钮。


### 加载模组


“<ruby> 内容下载 <rt>  Content downloading </rt></ruby>”界面是一个查看已通过审查的 OpenTTD <ruby> 模组 <rt>  mod </rt></ruby>的窗口，可以提供个性化的改进图像界面、全新音乐、火车模型和地图名称。我使用了新西兰全套配置，所以对我来说，生成的所有城市都很熟悉，尽管 2020 年我转而开始使用“辐射 3”套装了。模组 *非常多*，可以使用右上角的搜索栏来缩小选择范围。


下面是一些个人认为必备的模组：


* **abase** - 高分辨率图像。将近 300 MB，这可能是你玩此游戏需要的最大一次下载（游戏本身只有 50 MB）。
* **OpenSFX** - 一个声音合集。让你能听到城市中的交通声、船运的喇叭声以及很棒的火车汽笛声。
* **Town names** - 城镇名称。默认的城市名称很有趣，但我认为记一些本地化的名称更容易。
* **Trains** - 火车模组。OpenTTD 有一组运行良好的默认火车模型，但如果你已经是一名火车观察员，那你可能会喜欢下载一些额外的火车模型。我使用的是 NZR 火车合集，但还有很多火车也是可用的，包括来自英国、美国、奥地利、比利时、捷克共和国的车，以及按字母表顺序排列的许多其他火车。
* **Beginner tutorial** - 新手教程。是一个帮你学习游戏及界面的引导场景。


### 游戏引擎默认值


下载新素材后，你需要将它们设置为默认值。有两个设置的地方：游戏引擎默认值、游戏内脚本与素材。


![OpenTTD main menu](/data/attachment/album/202110/27/100341hk4b55r5kfdzfzbj.jpg "OpenTTD menu")


*OpenTTD 菜单（Seth Kenlon, [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/)）*


单击“<ruby> 游戏选项 <rt>  Game Options </rt></ruby>”按钮。 在游戏选项屏幕中，调整以下设置：


* 将<ruby> 屏幕分辨率 <rt>  screen resolution </rt></ruby>设置为你喜欢的界面尺寸。
* 将<ruby> 基础图像集 <rt>  base graphics set </rt></ruby>设置为 **abase**。
* 将<ruby> 基础声音设置 <rt>  base sounds set </rt></ruby>设置为 **OpenSFX**。


关闭游戏选项屏幕。你的改动会自动保存。


### 游戏选项


在主菜单界面，单击“<ruby> NewGRF 设置 <rt>  NewGRF Settings </rt></ruby>”按钮。


![NewGRF settings window](/data/attachment/album/202110/27/100342pk0gntaosokdtczd.jpg "The NewGRF settings menu")


*NewGRF 设置菜单（Seth Kenlon, [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/)）*


未活动的模组显示在 NewGRF 设置窗口的下半部分。要激活一个未活动的模组，请选择它并单击左下角的“<ruby> 添加 <rt>  Add </rt></ruby>”按钮。选择要激活的模组后，再单击“<ruby> 应用 <rt>  Apply </rt></ruby>”按钮。


### 教程


如果你下载了“<ruby> 初学者教程 <rt>  Beginner tutorial </rt></ruby>”场景，可以通过它来学习 OpenTTD。开始教程请单击主菜单屏幕顶部附近的“<ruby> 播放场景 <rt>  Play scenario </rt></ruby>” 按钮，然后选择该教程并开始。


初学者教程有着游戏界面的完整浏览流程，全部完成需要花费一些时间。


### 快速开始


现在我们快速介绍一下，此处你要了解以下内容：车辆出自仓库，一切活动都需要时间表。记住这两条规则，你可以立即开始建造火车（以及道路、海港和机场）。


#### 建造车站


要在两个城市之间建立一条简单的铁路线，请单击顶部图标栏中的铁路轨道图标。


![New icon bar - railway option](/data/attachment/album/202110/27/100342ebb8el38xngbba4d.jpg "The new icon bar - railway option")


*新建图标栏——铁路选项（Seth Kenlon, [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/)）*


铁路以车站开始和结束，所以我通常在预定线路的两端各放置一个车站。单击火车站图标（将鼠标悬停在其上方可查看其标签）。一个火车站要服务于一个地区，其作用范围必须与该地区尽量多地重叠。要查看车站的覆盖范围，请通过单击车站对话框底部的“<ruby> 开启 <rt>  On </rt></ruby>”按钮以启用<ruby> 覆盖区域高亮 <rt>  Coverage area highlight </rt></ruby>功能。


![Station coverage window](/data/attachment/album/202110/27/100342juxo12xukct1ho1k.jpg "Station coverage information window")


*车站覆盖信息窗口（Seth Kenlon, [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/)）*


黑色网格表示覆盖范围，而白色网格显示车站的物理占据范围。当你将鼠标悬停在一个区域上时，车站的覆盖范围所需耗材会在弹出窗口中列出。从简单的开始，创建一个单轨 4 辆车的站台。在地图上的两个城市之间重复执行此操作两次。


![create station menu](/data/attachment/album/202110/27/100343g08qpqozjztjj3sz.jpg "The create station menu")


*创建车站菜单（Seth Kenlon, [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/)）*


### 铺设铁轨


接下来，用铁轨连接车站。 OpenTTD 的等距视图需要一些时间来适应，但是在单击铁路图标并在地图上单击拖动之后，你就开始大概有所了解了。X-rail 图标提供了“自动轨道”模式，该模式会根据用户单击的方块位置对齐轨道。


铺设导轨时要细心。OpenTTD 是不可撤回的，所以一旦点击一个正方形，轨道就会被构造出来。你必须使用炸药图标来移除导轨。和现实生活中一样，没有撤消按钮。


### 火车车库


火车来自<ruby> 车库 <rt>  depot </rt></ruby>。因此，要在铁路上添加火车，必须在沿线的某处添加一个车库。单击车库图标并在现有铁路附近放置。将车库连接到现有轨道，以确保你的火车可以从车库到达适当线路的（在此简单示例中，线路是唯一的）。


![create depot menu](/data/attachment/album/202110/27/100343tko4e84ie94oj4ot.jpg "Create depot menu")


*建造车库菜单（Seth Kenlon, [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/)）*


### 模型火车


终于，你可以将虚拟模型火车添加到虚拟铁路中了。要创建火车，请单击车库。


单击站点窗口底部的“<ruby> 新建车辆 <rt>  New Vehicle </rt></ruby>”按钮，会列出可用的火车引擎和汽车。列表会部分取决于你从可下载内容中添加的模型。一般来说，发动机分为三种：蒸汽发动机、柴油发动机和电动发动机。游戏内时间从 1950 年开始，所以早期你只有蒸汽可选。随着时间推进，你会获得可用于升级的创新型新模型。


![create train menu](/data/attachment/album/202110/27/100343z5iit6yeye5r75v6.jpg "The create train menu")


*创建火车菜单（Seth Kenlon, [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/)）*


现在创建一个简单的火车，其中包括一节引擎、一节客车和一节邮车。如果想添加其他类型的车厢，请单击站点以确认它们的可提供车型（由其覆盖区域决定）


### 创建火车时刻表


现在有了铁路和火车，还需要创建一个火车时刻表。时间表与车辆关联，因此无论何时添加新车，都要记得添加时间表，以让新车投入使用。


要为火车添加时刻表，请单击其车库列表中列车左侧的编号。这样可以打开火车视口，窗口右侧会有按钮。单击箭头图标即可查看该列车的时刻表。


![create schedule menu](/data/attachment/album/202110/27/100344dnd729bub6cxb652.png "The create schedule menu")


*创建时刻表菜单（Seth Kenlon, [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/)）*


要创建时间表，请单击时间表窗口底部的“<ruby> 前往 <rt>  Go To </rt></ruby>”按钮，然后单击要设置成第一个目的地的车站。然后点击下一站。你可以在时间表中选择一个停靠点，浏览“<ruby> 满载 <rt>  Full load </rt></ruby>”和“<ruby> 卸载 <rt>  Unload </rt></ruby>”下拉菜单中的选项，以此调整装卸要求，并且可以在“<ruby> 无停靠 <rt>  Non-stop </rt></ruby>”下拉菜单中调整路线（如果开发了新路线）。选项有很多，随着城市发展和地图完善，你可能需要随时调整策略。


但是现在，单击火车视口底部的红色“<ruby> 已停止 <rt>  Stopped </rt></ruby>”按钮，让火车投入使用吧！


![train moving from station to station](/data/attachment/album/202110/27/100344p5xt8ulqqdtrdxdz.jpg "Train in service")


*在役中的火车（Seth Kenlon, [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/)）*


### 试试 OpenTTD 吧


OpenTTD 是一个模拟器，同时也是一个游戏，所以确实会有一些限制，比如你可能想要优化的预算和参数。例如，你可以单击一个城市、农场或工厂，了解其可接受的进出口类型。你可以通过单击 OpenTTD 窗口右下角的预算按钮来借钱。它不仅仅是一个虚拟的火车集合游戏。你还可以建造道路、机场、海港等。记得所有车辆都需要车库和时间表，你就在实现虚拟企业的路上成功了一半。


OpenTTD 有着活跃而热情的社区，以及[详细的维基](https://wiki.openttd.org/en/)，并且有大量的资源和教程在线可用。下载游戏并试试吧！




---


via: <https://opensource.com/article/21/9/model-trains-openttd>


作者：[Seth Kenlon](https://opensource.com/users/seth) 选题：[lujun9972](https://github.com/lujun9972) 译者：[unigeorge](https://github.com/unigeorge) 校对：[wxy](https://github.com/wxy)


本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译，[Linux中国](https://linux.cn/) 荣誉推出


OK
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. I've often imagined a possible future in which I have a garage or a basement dedicated to miniature landscapes and electric whistling trains. Then again, the probability of me diving that severely into yet another hobby is pretty low, 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).

If you're running Debian Linux or one of its derivatives, or even [running it on a Chromebook](https://opensource.com/article/21/2/chromebook-linux), you can download the `.deb`

package. Install it with `apt`

:

`$ sudo apt install ./openttd*deb`


If you're using any other Linux distribution, download the generic installer and extract the package with [the tar command](https://opensource.com/article/17/7/how-unzip-targz-file):

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


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

## Launch OpenTTD

If you installed OpenTTD, you can launch it from your application menu.

If you're downloaded the generic package, change into the directory and launch the game using the local `openttd`

command:

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


The first time you launch OpenTTD, it 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, giving improved graphics, new music, train models, and 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. 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 many 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 you download your new assets, you must set them as your defaults. There are two places for this: Game engine defaults and in-game scripts and assets.

![OpenTTD menu OpenTTD main menu](https://opensource.com/sites/default/files/openttd-menu.jpg)

The OpenTTD menu

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.

## Game options

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

![The NewGRF settings menu NewGRF settings window](https://opensource.com/sites/default/files/openttd-newgrf.jpg)

The NewGRF settings menu

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 could learn 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.

## Quickstart

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 start 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.

![The new icon bar - railway option New icon bar - railway option](https://opensource.com/sites/default/files/openttd-iconbar-railway.jpg)

The new icon bar - railway option

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 dialog box.

![Station coverage information window Station coverage window](https://opensource.com/sites/default/files/openttd-window-station.jpg)

Station coverage information window

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.

![The create station menu create station menu](https://opensource.com/sites/default/files/openttd-create-station.jpg)

The create station menu

## 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. You must use the dynamite icon to remove rails. 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.

![Create depot menu create depot menu](https://opensource.com/sites/default/files/openttd-create-depot.jpg)

The create depot menu

## 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 to list 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.

![The create train menu create train menu](https://opensource.com/sites/default/files/openttd-create-train.jpg)

The create train menu

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 types 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.

![The create schedule menu create schedule menu](https://opensource.com/sites/default/files/openttd-create-schedule.png)

The create schedule menu

To create a schedule, click the **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!

![Train in service train moving from station to station](https://opensource.com/sites/default/files/openttd-train.jpg)

Train in service

## 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, 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 halfway to a successful virtual enterprise.

OpenTTD has an active and enthusiastic community, [an extensive wiki](https://wiki.openttd.org/en/), and there are lots of resources and tutorials available online. Download the game and give it a try!

## 4 Comments