[迷你地铁]自定义地图创建指南(三)
本文来自迷你地铁官方自定义地图指南,由Up主-高明-个人翻译,但保留英语原文。
注意:本编指南极长,且包含部分晦涩难懂的知识,仅适用于一心想要创建自定义地图的迷你地铁玩家。
原文链接:https://steamcommunity.com/sharedfiles/filedetails/?id=2295902845
本段目录
Initial Upgrades 初始升级
Weekly Upgrades 每周升级
Weekly Upgrade Names 自定义升级名称
Trains 列车
Initial Stations 初始车站
Lines 线路
Initial Upgrades 初始升级
The "upgrades" dictionary in your city.json file's main dictionary will define the lines, trains, and other upgrades that the player has available at the start of the game, and what they can gain throughout.
city.json 文件主字典中的 "upgrade" 字典定义了玩家在游戏开始时拥有的线路、机车以及其它财产的数量,以及在游戏的过程中获得的财产。
"upgrades": {
"initial": [
"Line",
"Line",
"Line",
"Locomotive",
"Locomotive",
"Tram",
"Shinkansen",
"Crossing",
"Crossing",
"Crossing",
"Carriage",
"Interchange",
"Interchange"
],
[...]
},
Inside of the "upgrades" dictionary, the "initial" array defines the upgrades that will be given to the player when starting a new game on your map.
"upgrades" 字典中的 "initial" 数组定义了游戏开始时玩家拥有的财产。
“Line” unlocks a new line for the player. Every vanilla map gives the player three Lines to begin.
"Line" 即为地铁线路,所以游戏自带地图在游戏开始时都有3条可用线路。
“Locomotive”, “Tram”, and “Shinkansen” unlock new trains for the player. Locomotives are the default train type, Trams are the slower trains in maps such as Melbourne, and Shinkansen are the faster trains in maps like Osaka.
"Locomotive", "Tram" 和 "Shinkansen" 是机车种类。Locomotive 是默认机车,Tram 是墨尔本地图中使用的慢速电车,而 Shinkansen 是大阪地图中使用的快速列车。
Make sure the player has at least one train per starting line. You can give the player more, but if you give them less then they won’t be able to use all the lines you’ve provided at the start of the game.
确保在游戏开始时为每条初始线路都准备至少一辆机车。你可以给予更多机车,但如果初始机车数量少于线路数量,则游戏开始时将无法使用所有的可用线路。(Up注:如果游戏开始时有3条线路,但只有2辆机车,第三条线路建成时上面不会有机车运行)
“Crossing” gives the player a new Bridge or Tunnel, depending on the value you set for "crossingStyle" above. Vanilla maps tend to start you out with two to four crossings.
"Crossing" 给予玩家桥梁或隧道,这取决于你的地图选择了那种过河方式。游戏自带地图通常包含2到4个初始桥梁或隧道。
"Carriage" and "Interchange" respectively unlock a carriage or interchange upgrade for the player, to apply to trains or stations to increase capacity.
"Carriage" 是车厢,可以被连接在机车后面增加列车容量。"Interchange" 是换乘站,可以增加某一座车站的容量以及换乘速度。
No vanilla map gives the player any of these upgrades in the initial setup, but giving the player unique initial upgrades can create interesting puzzles and make your map stand out.
游戏自带地图不会在游戏开始时提供车厢和换乘站,但你也可以在初始财产中包含这两项,使游戏更具有趣味性。
(In the city.json main dictionary, not the upgrades dictionary:)
"stationCapacity": 6,
"interchangeCapacity": 18,
By default, an Interchange upgrade increases the station capacity from six peeps to eighteen. However, both these values can be modified through the "stationCapacity" and "interchangeCapacity" integer values in the city.json file main dictionary.
每座普通车站的默认容量是6位乘客,而换乘站可以容纳18位乘客。但这两个值都可以在 city.json 文件主字典里的整型变量 "stationCapacity" 和 "interchangeCapacity" 中进行修改。

Weekly Upgrades 每周升级
"upgrades": {
[...],
"unlocks": [
[
{"type": "Locomotive", "max": 0, "count": 1, "weight": 1.0, "week": 0, "maxWeek": 4},
{"type": "Locomotive", "max": 0, "count": 2, "weight": 1.0, "week": 5},
{"type": "Tram", "max": 0, "count": 3, "weight": 1.0, "week": 5},
],
[
{"type": "Line", "max": 4, "count": 1, "weight": 0.5, "week": 0},
{"type": "Crossing", "max": 0, "count": 2, "weight": 1.0, "week": 0},
{"type": "Carriage", "max": 0, "count": 1, "weight": 1.0, "week": 0},
{"type": "Interchange", "max": 0, "count": 1, "weight": 0.5, "week": 0},
],
],
"numOptions": [2,3],
},
Once you pick out which upgrades the player will start with, next you’ll have to configure which upgrades they can get at the start of each new week. This is done through the "unlocks" array of arrays inside the "upgrades" dictionary.
当你选择好玩家在游戏开始时拥有的财产后,接下来就该设置每一周开始时玩家新获得的财产,这由 "upgrade" 字典中的 "unlocks" 数组决定。
Each array of dictionaries, inside the "unlocks" array, is a new round of upgrades. At the start of each new week in-game, the player will get a choice of one upgrade from each round.
"unlocks" 数组中的每一项字典里的数组都是新一轮的升级选项。在游戏中每一周的开始,玩家都可以从几个升级选项中选择一种。
All vanilla maps have a default two upgrade rounds, where the first gives a train and the second gives another upgrade. However, you can add more or less arrays inside "unlocks" to give the player as many rounds of upgrade choices as you like, and pick any type of upgrade for each screen.
所有自带地图只有两种升级方案,第一种选项是机车,第二中是其它任何财产中的一种。然而,你也可以通过增加或减少 "unlocks" 中的数组来改变选项的数量或者种类。
The example above shows a map where two upgrade rounds are shown every week. The first will show a choice of two upgrades, either a Locomotive or Tram. The second screen will show a choice between three upgrades, which could be a Line, extra Crossings, or a bonus Carriage or Interchange.
以上的例子中,每一周都有两个升级方案,第一个是机车和电车二选一。第二个是线路、桥梁/隧道、车厢和换乘站里的三选一。
You must include at least one round of upgrades.
你必须至少拥有一种升级方案。
"numOptions": [2,3],
By default, in each round, the game will randomly select two choices out of the upgrades in the round to be available.
默认设置下,在每一轮,游戏会从可用的升级方案中随机选择两种升级选项。
"numOptions" is an array of integers that sets the maximum number of choices available in each round. Here, you can give more or fewer choices in each upgrade round.
"numOptions" 是一个包含整型变量的数组,它决定了每一轮中升级选项的数量。你可以通过修改该数组来改变选项数量。
In this example, it tells the game to try and show a choice of three upgrades in the second round, if possible.
再本例子中,它命令游戏在条件允许的情况下在第二种方案中展示三种选项。
Upgrade Choice Options 升级选项设置
{
"type": "Locomotive",
"max": 0,
"count": 2,
"weight": 1.0,
"week": 0,
"maxWeek": 4,
},
Each dictionary with a round array sets the options for how and when each upgrade type can appear, and what the award will be.
升级方案数组中的每一种字典都设定了某种财产何时何地出现。
"type": "Locomotive",
The "type" value, of course, sets the type of upgrade that will be shown.
"type" 变量,顾名思义,设定了该财产升级的种类。
"count": 2,
Count determines how many of an upgrade is given to the player when they take this upgrade option. In this example, the player would get two new trains.
数量决定了当玩家选择该升级时将获得的财产数量。在本例子中,玩家将一次获得两辆机车。
"max": 0,
Max configures how many of this type of upgrade the player is allowed to have. If they already have at least that many of the upgrade, this option will not be shown. A setting of 0 or -1 means that there is no limit on the upgrade.
最大值决定了玩家最多能拥有多少该财产。如果玩家已经拥有最大值数量的财产,则之后的升级中不会再出现该财产。如果该变量的值为0或-1则没有上限。
You typically only need to set this for Line upgrades. When you setup your Line upgrades, it’s important to make sure the player can’t get more new Lines than are allowed by the "lineCount" value in city.json.
通常来说你只需要为线路财产设置上限。务必确保在开通所有线路之后停止提供新线路。
"weight": 1.0,
Weight, similar to the setting for station spawns, determines the likelihood that an option will be chosen, relative to all other upgrades in a given upgrade round.
此处的权重与生成车站权重类似,决定了某种选项相对于同一方案中其他选项出现的可能性。
"week": 0,
"maxWeek": 4,
Week and maxWeek configure the first and last week that an upgrade option is allowed to appear. MaxWeek will default to infinity — as in, the upgrades will always be available — if the key isn’t present, or set to -1.
Week 和 maxWeek 决定了某种升级选项开始出现和停止出现的时间(星期)。如果不设置相关键或者把值设置为-1,maxWeek 的默认值为无限。
Note that, week 1 is the first week of the game, but upgrade screens count for the upcoming set of seven days. The first upgrade screen occurs for week 2, so a “week”: 2 setting is identical to “week”: 0 for all intents and purposes. "week": 3, refers to the second upgrade screen, and so on.
注意:第1周是游戏中第一个星期,但升级选项在第二周开始时才会出现,所以 "week" 的值取2和取0时意义相同。同样的,"week": 3意味着第二次升级,以此类推。
Balance Advice 平衡建议
It’s important to not go too overboard with your upgrade system, or else you risk making your map too easy, or too dependent on getting lucky upgrades.
不要把升级做得太过了,否则你的地图可能过于简单,又可能过于依赖运气成分。
For most weekly upgrades in most vanilla maps, you’ll get one new train in the first round, and one other upgrade.
在自带地图中,大多数星期开始时的升级选项都包含一辆机车以及其它一种财产。
The major exceptions are with Crossings, where the player often will get two at once, and maps like Osaka where the player has the choice between one faster or two slower trains.
主要的例外是隧道或桥梁,玩家通常一次性会得到两个。在大阪地图中,玩家则会在1列快速列车2两列普通机车中选择一种。
The important thing, as always, is to know what you want your map to play like, and pick upgrades that play to its strengths. And of course, playtest lots!
最最重要的还是要明确你想要你的地图变成什么样子,并用适当的升级选项发挥它的优势。当然,多测试几次很有用。

Weekly Upgrade Names 自定义升级名称
If you want the name of certain upgrades to appear differently on the weekly upgrades screen, you can add the "assetName"s array to your city.json file's main dictionary.
如果你想让某种财产拥有一个独特的名称,你可以在 city.json 文件主字典中添加一个 "assetName" 数组。
"assetNames": [
{
"asset": "Locomotive",
"title": "Subway Car",
"description": "Runs on lines 4 and up.",
"forceDescription": true,
},
{
"asset": "Tram",
"title": “Streetcar",
"description": "Runs on lines 1 to 3.",
"forceDescription": true,
},
],
Each entry in the "assetNames" array is a dictionary with a unique type, which will override the name and description of one upgrade. Each type of asset can only be overriden once.
"assetNames" 数组中的每一个条目都是一个有着独特类型的字典。它会覆盖某种财产默认的名称与描述,但每种财产只能被覆盖一次。
"asset": "Locomotive",
Within each dictionary, "asset" picks which upgrade type this will apply to.
"asset" 选定了将被改写的财产种类。
"title": "Subway Car",
Title sets the text that will appear as the asset’s name on the upgrade screen. In this case, it will make “Subway Car” show up instead of “Locomotive” on the weekly upgrade screen.
Title 设定了选定财产种类的新名称,在此例子中,每周升级界面中的机车的名称将会显示 "Subway Car" 而不是 "Locomotive"。
"description": "Runs on lines 4 and up.",
Description sets a description that will appear underneath the upgrade. It’s helpful to include this, especially if your train types are restricted to certain lines. See below, in the Lines section.
Descripstion 设定了在财产名称之下显示的描述文字。描述很有用,尤其是某种类型的机车只能在特定线路运行的时候。详见下文“线路”栏目。
"forceDescription": true,
To make sure this description always appears, set forceDescription to true.
将该布尔变量设置为 true 可以确保游戏中会始终显示自定义描述。

Trains 列车
"trainDefinition": "default",
In your city.json file main dictionary, the "trainDefinition" value lets you change which types of trains to use.
在 city.json 文件的主字典中,"trainDefinition" 变量可以用于改变你所使用的机车种类。
The value "default" will use the regular types of Locomotives, Trams, and Shinkansen trains. The value "small" will use the 4-peep capacity trains from Cairo.
"default" 值将会使用常规的机车、电车以及新干线列车。"small" 值将会使列车变为开罗地图中使用的只能容纳4名乘客的小列车。
Custom Trains 自定义列车
You may want to modify the train settings to have certain types of trains carry more or less passengers, drive or accelerate faster, and so on. You can do this by creating a new trains.json file in your city folder.
你也可以修改列车的设定,使列车的容量、速度等特征改变。其方法是在地图文件夹中创建一个新的 trains.json 文件。
{
"id": "VLTCarioca",
"capacity": 6,
"locomotives": [
{
"type": "Locomotive",
"speed": 360,
"acceleration": 120,
"deceleration": 300,
"capacity": 6,
},
{
"type": "Shinkansen",
"speed": 480,
"acceleration": 180,
"deceleration": 300,
"capacity": 8,
},
{
"type": "Tram",
"speed": 250,
"acceleration": 1000,
"deceleration": 1000,
"capacity": 4,
}
]
}
The trains.json file should contain this JSON format.
trains.json 文件的内容如上所示。
"id": "VLTCarioca",
The "id" value needs to be a unique identifier for your train definition file.
"id" 变量是列车定义文件独一无二的身份变量。
Make sure that you copy this id into your city.json “trainDefinition” value.
请确保 city.json 文件中 "trainDefinition" 的值与此 "id" 相同。
"capacity": 6,
The first "capacity" integer value sets the default capacity for each train. This refers to how many peeps can ride in a train, or connected carriage, at one time.
第一个整型变量 "capacity" 设定了每一列机车的容量,也就是每一节车头和车厢最多可以容纳的乘客数量。
In vanilla maps, this value is 6 by default, and 4 in Cairo.
在自带地图中,该变量默认值为6,在开罗地图中为4。(Up注:孟买地图中的列车容量也是4)
The "locomotives" array contains three dictionaries, one for each type of train: Locomotive, Shinkansen, and Tram. This lets you configure custom values for each train type.
"locomotive" 数组中包含3个字典,分别对应三种机车:普通机车、新干线列车和电车。你可以为一种机车分别设置不同的特征。
"type": "Tram",
The string "type" sets the train type. Valid types are "Locomotive", "Shinkansen", and "Tram". There should be exactly one dictionary of each type in a trains.json file, with no duplicates or missing types, even if your map won't give the player that train type.
"type" 字符串选定了机车种类,可用的值包括 "Locomotive", "Shinkansen" 以及 "Tram"。trains.json 文件中必须同时包括这三种机车的设定,不能重复也不能少,即使你在游戏中没有使用全部三种机车。
"speed": 360,
"acceleration": 120,
"deceleration": 300,
The "speed" number value sets the maximum possible speed for the train, and "acceleration" and "deceleration" change how fast the train will reach that top speed.
"speed" 决定机车的最高速度。"acceleration" 和 "deceleration" 决定机车起步和刹车的速度。
"capacity": 4,
By setting the "capacity" integer value in a locomotive definition, you can override the default "capacity" at the top of the trains.json file, to set how many peepscan fit in this type of train or in an attached carriage.
通过修改此值可以为某一种机车设置一个新的容量,它会覆盖 trains.json 文件中的默认值。
If a capacity value isn’t given in the unique train dictionary, it defaults to the capacity value given in the overall dictionary.
你也可以不设置这个变量,这样所有机车都会使用默认设置。
In vanilla maps, this value is 6 by default, and 4 in Cairo.
在游戏自带地图中,默认容量为6,而开罗地图中是4。

Initial Stations 初始车站
The "stations" array in the city.json main dictionary gives the map a list of stations to spawn at the start of the game. In a vanilla map, where you start with three randomly-placed stations, one each of a Circle, Triangle, and square, you would use the following JSON.
city.json 主字典中的 "stations" 数组设定了游戏开始时即存在的车站列表。游戏自带地图中,初始车站为3个(Up注:上海地图的初始车站有5个),包括一个圆形车站,一个三角形车站,以及一个正方形车站。设置方法如下。
"stations": [
{
"tag": "start-circle",
"type": "circle",
},
{
"tag": "start-triangle",
"type": "triangle",
},
{
"tag": "start-square",
"type": "square",
},
],
Each dictionary in the array corresponds to a unique station.
每一个字典都对应一座初始车站。
"tag": "start-circle",
Every station must have a totally unique "tag" string value.
每一座车站的 "tag" 值必须是独一无二的。
"type": "circle",
Furthermore, every station needs a type. Valid types are "circle", "triangle", "square", and the Special types "pentagon", "diamond", "star", "cross", "egg", "gem", and "wedge". The exact type of Special station must be specified, and "special" alone is not valid.
此外,没一座车站还要设置种类。可用的 "type" 值包括 "circle", "triangle", "square",以及特殊车站 "pentagon", "diamond", "star", "cross", "egg", "gem", 和 "wedge"。如果选择特殊车站,必须指明其种类,而不能用宽泛的 "special" 值去指代。
Extra Station Values 额外车站选项
Without any other information that shown above, the game will try to place each dictionary as a new station, in a valid city area at the start of the game. Extra details can be added to make stations spawn in specific ways. These are especially useful if you want to create Permanent Lines, or just have unique kinds of starting stations that your player will have to account for while building their map.
如果没有额外的设定,游戏会在城区内将每一个字典以新车站放置。你可以加入额外的细节设定,使车站以特定的方式生成。如果你想创建永久线路,或者在指定位置生成初始车站,这一条会很有用。(Up注:举个例子,首尔地图中,汉江中间的岛屿上永远会在游戏开始时生成一个正方形车站)
{
"tag": "Pavuna-L2SV",
"type": "square",
"position": [-2285, -217.7],
"interchange": true,
"invincible": true,
"ghost": false,
},
This JSON dictionary shows the full possible list of values for a single station.
以上是单个车站可用的所有变量。
"position": [-2285, -217.7],
The "position" array contains two floats, corresponding to the X and Y position of the station on the map. If "position" is not present, a random position inside a valid city area will be chosen.
"position" 数组包含两个浮点数,对应车站的横纵坐标,它可以确定车站生成的位置。如果没有该变量,车站将会随机生成。
"interchange": true,
Setting "interchange" to true means that it will start the game with an interchange applied. This value defaults to false if not present.
将该布尔变量设置为 true 将会使该车站在生成时就成为一个换乘站,如果不设置该变量,则默认为 false。
The "interchange" value is currently bugged, and will not be applied. This will be fixed in a future update.
"interchange" 变量目前存在漏洞,不会生效。后续更新将会修复这一漏洞。
"invincible": true,
Setting "invincible" to true overrides normal passenger limits, and forces the station to never overflow no matter how many people pile up. This value defaults to false if not present.
将该变量设置为 true 可以覆盖原有的乘客数量上限,无论站内有多拥挤都不会崩溃。如果不设置该变量,则使用默认值 false。
This is useful to set to true if you plan to have stations off-screen connected to a permanent line, which trains will bring into the map. This way, stations off-screen will not cause a Game Over.
如果你想在屏幕之外创建一个车站并用一条永久线路将其联通,"invincible" 变量将会很有用,因为如此一来地图之外的车站将不会使玩家输掉游戏。
"ghost": false,
Setting "ghost" to true means that the station won’t be visible, passengers won’t spawn there, and the player can’t connect lines to it during gameplay. This value defaults to false if not present.
将改变量设置为 true 会使车站隐形,不生成乘客,也无法被线路联通。其默认值为 false。
Ghost should only be set to true when you need to connect permanent lines through invisible stations. This can be used to create more complex curves in permanent lines.
"Ghost" 变量通常用于被永久线路联通的车站,这样可以修改线路的形状。

Lines 线路
For every line in your city, you need to define some settings about how it will interact with upgrades, and other gameplay elements.
你需要配置地图中的每一条线路,以设定它们如何与财产升级互动等等。
"lines": [
{
"maxTrains": 8,
"allowedTrains": ["Tram", "Carriage", "Crossing",],
},
{
"maxTrains": 8,
"allowedTrains": ["Tram", "Carriage", "Crossing",],
},
{
"maxTrains": 8,
"allowedTrains": ["Tram", "Carriage", "Crossing",],
},
{
"maxTrains": 6,
"allowedTrains": ["Locomotive", "Carriage", "Crossing",],
},
[...]
],
The "lines" array is an array of dictionaries which is in your city.json file main dictionary.
city.json 文件主字典中的 "lines" 数组包括了对应每一条线路的字典。
You need to have a dictionary in this array for each line in the level. Therefore, the array should have as many dictionaries as your previously-set "lineCount" value. Your first line corresponds to the first dictionary in the array, and so on.
该数组中的字典对应没一条线路,所以字典的数量应当与 "lineCount" 的值相同。第一个字典对应第一条线路,以此类推。
The line colours will correspond to the RGB values you set in your theme.json "lineColors" array.
线路的颜色将会使用你之前在 theme.json 文件中已经设定好的RGB颜色值。
{
"maxTrains": 6,
"allowedTrains": ["Locomotive", "Carriage", "Crossing",],
},
Each line dictionary must have these two values.
每个线路的字典都必须包含以上两个变量。
The "maxTrains" value is an integer that sets the maximum number of total trains — Trams, Locomotives, and Shinkansen counted together — allowed on this line.
"maxTrains" 变量是一个整数,它设定了一条线路最多可以容纳的机车数量。
The default setting in the vanilla game, or if this value is not present, is 11 minus the total number of lines in the city. So in a 7-line city, you’d allow 4 trains per line, or 6 trains per line in a 5-line city. If you have 8 or more lines, make sure you set this higher, so that the player won't run into restrictions with the trains allowed per line.
如果不设置该变量,每条线路的默认容量是11减去线路的数量。在一张有7条线路的地图中,每一条线路上最多可以容纳4辆机车。在5张线路的地图中,每条线路则能容纳6辆机车。如果你的地图有8条或更多线路,请把该变量设置的高一些,避免受到限制。
"allowedTrains": [
"Locomotive",
"Carriage",
"Crossing",
],
The "allowedTrains" array is the other required value. This lets you configure which types of upgrades can be used on each line.
"allowedTrains" 是另一个必须存在的数组。这个数组设定了一条线路上可以使用哪些财产。
By default, you should allow all five possible line upgrades: "Locomotive", "Tram", "Shinkansen", "Carriage", and "Crossing". If the array is missing, all assets will be allowed on the line by default.
一般情况下,你应当允许一条线路使用5种财产:"Locomotive", "Tram", "Shinkansen", "Carriage", 和 "Crossing"。这也是每条线路的默认值。
The example at the top of this section is from the Mini Metro More - Toronto map, and shows a case where the initial three lines are only allowed to run Trams, and the rest of the lines can only run Locomotives, by deleting the other types of trains in the "allowedTrains" array. All lines in the example are allowed to use Carriages and Crossings.
本栏目中的例子来自迷你地铁的多伦多地图,通过移除数组中的某些元素使得其中前三条线路只能使用电车,而之后的线路只能使用机车。但所有线路都能使用车厢和隧道/桥梁。
If "Carriage" is not present, trains on this line will not be able to add Carriages.
如果移除了 "Carriage" 元素,线路上的机车将不能拖挂车厢。
If "Crossing is not present, the line will not be allowed to cross water obstacles.
如果移除了 "Crossing" 元素,线路将无法跨越水体障碍。
If no type of train is present, trains will not be able to be placed on the line at all. Make sure you include at least one of "Locomotive", "Tram" or "Shinkansen".
如果所有机车种类都被移除,则该线路将无法运行任何机车。请确保每条线路至少能运行一种机车。
There is no way to disallow Interchanges from being used on stations on this line.
换乘站无法被禁用。