[迷你地铁]自定义地图创建指南(二)
本文来自迷你地铁官方自定义地图指南,由Up主-高明-个人翻译,但保留英语原文。
注意:本编指南极长,且包含部分晦涩难懂的知识,仅适用于一心想要创建自定义地图的迷你地铁玩家。
原文链接:https://steamcommunity.com/sharedfiles/filedetails/?id=2295902845
第一篇:CV9457864
本段目录
Zoom and Start Area 地图缩放与初始区域
City Areas 城区
City Area Options 城区选项
Station Spawns 车站生成
Zoom and Start Area 地图缩放与初始区域
Now that your obstacles are in place, you ought to configure the Zoom and Start Area values, to make sure you have the scale right.
现在你的障碍物已经设置完成,下一步就是设置缩放和初始区域,以确保地图的尺度适宜。
"origin": [0,0],
The "origin" array defines the center point of your map. It should go in your city.json file's main dictionary.
"origin" 数组定义了地图中心点的坐标,该条目应位于 city.json 文件的主要条目中。
"zoom": {
"start": 1.3,
"end": 0.4,
"delay": 1,
"duration": 55,
"earlyZoom": 0.5,
"lateZoom": 0.5,
},
These values should go inside your city.json file's main dictionary.
这些值应当位于 city.json 文件的主要条目中。
"start": 1.3,
"end": 0.4,
The "start" and "end" float values correspond to the initial and final camera zoom over the course of a map. A higher value means a closer-in camera.
浮点值 "start" 与 "end" 对应游戏开始时与最终电脑屏幕的缩放尺度,该值越大意味着放大程度越高。
You should play around with these values when your obstacles are in place, paying attention to the zoom at the end. Think about where stations will spawn in your map, or the “play area.”
在设置好障碍物后,你就应该着手调整缩放值,确保地图中生成车站的区域都被最终的缩放窗口包括。
The player around should roughly correspond to the border of the window with a end zoom scale between 0.35 to 0.55. Your map might be too big if you had to set the value too low, or too small if you had to set the value too high.
大部分情况下,最终的缩放值应当在0.35至0.55之间。如果该值太小,则地图会过于庞大。
"delay": 1,
"duration": 55,
The "delay" and "duration" integer values refer to the number of days before the camera zoom out begins, and how long it takes to reach the "end" value, respectively.
整型值 "delay" 与 "duration" 决定缩放开始的天数以及持续时间,即多少天后达到最终尺度。
To test your "start" and "end" values quickly, you can set the "duration" to 1 for now.
想要快速测试缩放尺度,可以暂时把 "duration" 设置为1。
"earlyZoom": 0.5,
"lateZoom": 0.5,
The "earlyZoom" and "lateZoom" float values configure the speed at which the camera zooms out, after the delay, in the first and second half of the game. Set early zoom higher if you want the map to sprawl out from the starting area, and set late zoom higher if you want a really dense middle of the map.
浮点型值 "earlyZoom" 与 "lateZoom" 决定了缩放速度。如果你想让城市快速拓展,则应当调高 "earlyZoom" 值。如果你想让市中心变得繁华,则应当调高 "lateZoom" 值。
Be careful: If your "start" and "earlyZoom" values make the screen too small, it can cause stations to not have enough space to spawn. Once a station type fails to spawn, due to not having enough room on screen, it will prevent all stations of that type from spawning again. Make sure you zoom the screen fast enough that all the stations in your Schedules can spawn! See the Station Spawns section below for more details.
注意:初始画面太小可能会导致没有足够的空间生成车站。如果某种车站生成失败,本局游戏的剩余时间内都不会再生成该种车站。一定要确保城市扩张速度和车站生成速度相匹配!更多详情请见下文。
"startArea": {
"rightBottom": [-0.3, -0.2],
"leftTop": [-0.3, -0.2]
},
The "startArea" dictionary also goes in the main dictionary of the city.json file. It defines the boundaries for where the camera may start on a map. A value of 1.0 or -1.0 means the far edge of the playing area along the X or Y axis.
city.json 文件的主要字典中还包括 "startArea" 字典。它定义了游戏开始时聚焦的地图范围。1.0或-1.0的值意味着横纵坐标的最两端。
Keeping the rightBottom and leftTop values identical lets you set a very specific start location.
使 rightBottom 和 leftTop 值相同可以使地图拥有一个精确的起始点。
In this example, it says: start a bit to the left (-0.3), a little up (-0.2), from the [0,0] point of the map. Having different values for "rightBottom" and "leftTop" will define a SQUARE of possible starting camera positions.
在本例子中,代码意思为:在原点[0,0]的基础上稍微向左(-0.3),稍微向上(-0.2)的位置开始游戏。为 "rightBottom" 和 "leftTop" 设置不同的值可定义一个四边形,起始地点会在该四边形中随机选择。

City Areas 城区
With your obstacles in place, the next step is to add City Areas to your map. City areas are shapes which tell the game where to spawn stations, how close together they can be, and how frequently each area should spawn each type of station.
当你放置好障碍物后即可开始为地图添加城区。城区的地图中会生成车站的地区,它还会定义车站间隔距离,以及每一种车站的生成频率。
"cityAreas": [
{
"paths": [
{
"points": [
[590.42,663.03],
[547.83,501.15],
[186.43,501.15],
[146.68,656.64],
[213.41,761.01],
[255.3,761.01],
[280.15,702.08],
[318.49,705.63]
]
},
{
"points": [
[579.78,418.79],
[558.47,361.28],
[589.01,290.28],
[673.49,246.26],
[712.54,138.34],
[698.34,91.48],
[819.76,58.82],
[875.84,73.73],
[858.8,257.62],
[751.59,462.1]
]
}
],
"density": 1.0,
"stationSpawns": [
{"type": "CIRCLE", "weight": 0.4, "maximum": -1, "activeDay": -1}
{"type": "TRIANGLE", "weight": 1.0, "maximum": -1, "activeDay": -1}
{"type": "SQUARE", "weight": 0.6, "maximum": -1, "activeDay": -1}
{"type": "SPECIAL", "weight": 0.2, "maximum": 1, "activeDay": -1}
],
},
[...]
],
Each city area is an dictionary inside of the "cityAreas" array in the city.json file's main dictionary. You can have as many city areas as you like. Try to stick to somewhere between six and nine city areas for a balanced map.
city.json 文件中的 "cityAreas" 数组包含所有定义城区的字典。城区的数量没有上限,一张平衡的地图通常拥有6至9个城区。
Paths and Points 道路和点
"paths": [
{
"points": [
[590.42,663.03],
[547.83,501.15],
[186.43,501.15],
[146.68,656.64],
[...]
]
},
{
"points": [
[579.78,418.79],
[558.47,361.28],
[589.01,290.28],
[673.49,246.26],
[...]
]
}
],
Like with obstacles, each city area is define by a list of verticies with a float X and Y value in an array of arrays.
和障碍物类似,城区也是由一个个坐标点组成的数组定义的。
However, a city area can be made up of multiple polygons at once. The "paths" array, is an array of dictionaries. Inside each dictionary a separate polygon can be defined in the "points" array, the same way you would for an obstacle. The example above is a city area with two separate polygons, sharing the same characters.
然而,一个城区可以由多个多边形组成。"path" 数组是一个包含若干字典的数组,其中每个字典都包含一个有多个点组成的多边形。例子中的城区由两个多边形组成,它们的特征相同。
When picking out where the city areas should be, draw on your map research and knowledge of the city. Try looking at the official administrative divisions in the city, and finding demographic information about which areas are more built up or spread out, which areas are primarily residential and which are more commerical or industrial, and so on.
你可以通过对城市真实情况的研究来确定城区范围。可以看看城市的行政区划,并找一找人口分布,以及哪里是居民区,哪里又偏向工业区或商业区,等等。
In addition, if you've already set up your map zoom, you have an idea of where the boundaries of the screen are at the zoom end. Your city areas should generally fit inside the screen.
此外,如果你已经调整好地图的缩放尺度,你应该对地图边界有大致的把握。城区范围应尽量在屏幕之中。
It's very important to make sure that none of your city areas overlap with any water obstacles! Otherwise, you may find that stations will start spawning inside the bodies of water in your map, which can lead to visual and gameplay issues with how crossings are used.
请务必确保城区范围不要和任何水体障碍重合!否则有些车站可能会在水里生成,它们无法被联通,从而会影响游戏进程。
Debugging 错误排除
While working on your map, you may want to check where your city areas are, to get a sense of whether your zoom values are correct, or if any city areas are colliding with obstacles.
在创建地图时,你可能会想要检查城区的位置,感受一下你的缩放是否正确,或者城区是否与障碍重合。
"debugShowCityAreas": true,
You can add this value to your main city.json dictionary, to render the city areas as non-gameplay-affecting obstacles in the map. Make sure to set the value to false, before you publish your map!
你可以在 city.json 文件的主字典中加入该变量,这样城区的位置会在游戏画面中显示出来。不过请确保在发布地图前将该变量移除或设置为 false!

City Area Options 城区选项
Once you setup your city area paths, they can be configured as follows.
当你建立好城区道路之后,你可以这样设置它们。
Density 密度
Stations will only spawn within city areas during gameplay. The remaining options in a city area dictionary will define how and when they spawn.
在游戏过程中,车站只会在城区内生成。城区字典中其余的选项会定义车站会在何时以何种形式生成。
"density": 1.0,
The "density" float value configures how close to each other stations are allowed to spawn in this part of the map. A higher number means stations can spawn closer together, and a lower number means stations have to spawn further apart.
浮点型变量 "density" 设置了该城区中车站之间的间隔距离。如果该值较高,则意味着车站将会更加密集,更低的值则表示车站会更加分散。
The default value is 1.0, and most maps don’t have any city areas that deviate too far from this value. For instance, in London the downtown city areas are at about 1.2, and the furthest-out regions aren’t lower than 0.8.Try and keep density values within that range. Of course, don’t let that stop you from experimenting!
该变量默认值为1.0,大多数地图不会偏离该值太多。例如伦敦地图的市中心区密度为1.2,郊外区域则为0.8。尽量把密度设置在这两个值之间,不过你也可以大胆尝试其它值。
(In the main dictionary of city.json, not the city area:)
"stationSeparationScale": 1.0,
In addition, in the main dictionary of city.json, you can modify the global station spawn density by changing the "stationSeparationScale" float value. Likewise, 1.0 is the default value here, with higher values meaning closer stations in all city areas.
此外,在 city.json 文件的主字典中,你可以通过改变浮点型变量"stationSeparateScale"来修改整张地图的车站密度。同样的,1.0为默认值,车站密度随着该值增加而增加。

Station Spawns 车站生成
"stationSpawns": [
{"type": "CIRCLE", "weight": 0.4, "maximum": -1, "activeDay": -1}
{"type": "TRIANGLE", "weight": 1.0, "maximum": -1, "activeDay": -1}
{"type": "SQUARE", "weight": 0.6, "maximum": -1, "activeDay": -1}
{"type": "SPECIAL", "weight": 0.2, "maximum": 2, "activeDay": 22}
],
Finally, "stationSpawns" is an array of dictionaries inside each city area. Each dictionaries sets the spawning options for a specific type of station.
最后,"stationSpawns" 是每一个城区字典里都会有的数组。该数组中的每个字典都为每一种车站设置了生成的选项。
"type": "CIRCLE",
The "type" value defines a new station type that will be allowed to spawn in this city area. The allowed types are "CIRCLE", "TRIANGLE", "SQUARE", and "SPECIAL", as well as the specific Special station types, listed in the Station Spawns section below.
"type" 变量定义了该城区中会生成的新车站的种类。其中被允许的值包括"CIRCLE", "TRIANGLE", "SQUARE", "SPECIAL" 以及特殊车站类别下的所有车站种类。
Keep in mind that if there is no dictionary for a type of station in the "stationSpawns" array, that type of station will not spawn inside the city area.
如果某一个 "stationSpawns" 数组里没有某种车站的字典,则该城区中不会生成那种车站。
"maximum": 2,
The integer "maximum" value sets the maximum number of this type of station that can spawn in the city area. If this is set to -1, there will be no limit on this type.
整型变量 "maximum" 设置了每一种车站最多可以生成的数量。如果该值为-1,则没有上限。
Note that for "SPECIAL" stations, this will apply a maximum for each type of special station. With this example, up to two Star stations could appear in the area, along with two Pentagons, and two Diamonds, and so on.
注意如果车站种类是 "SPECIAL",该变量会为每一种特殊车站设置上限。在此例子中,每一种特殊车站,如星形车站、五边形车站、钻石形车站等,都最多可以生成2两个。
If you want to limit the number of specific types of special stations, you can use the individual special station types as your "type" value. For instance...
如果你想要规定特殊车站的种类,你可以用该车站的种类作为 "type" 变量的值,如下:
"stationSpawns": [
{"type": "PENTAGON", "weight": 0.4, "maximum": -1, "activeDay": -1}
{"type": "STAR", "weight": 1.0, "maximum": 1, "activeDay": -1}
],
This example would allow just one Star station to spawn, and an unlimited number of Pentagon stations to spawn in the city area. However, no other special stations would be permitted, unless they were also included in the array.
这个例子中,星形车站只能生成1个,五边形车站可以无限生成,而其它的所有特殊车站都不会生成,除非它们也被包括在这个数组中。
A full list of the Special station types can be found in the next section on Station Spawns.
所有特殊车站的种类见后文。
"activeDay": 22
Each dictionary also configures the first in-game day that this station type will spawn, using the "activeDay" integer value. The start of the first Monday of the game is day 1, Monday after the first upgrade screen is day 8, Monday after the second upgrade screen is 15, and so on.
每个字典也用整型变量 "activeDay" 设定了每种车站开始生成的时间。每局游戏的第1天都会从星期一开始,第二个星期一则为第8天,第三个星期一为第15天,以此类推。
"weight": 0.6,
The weight value determines the likelihood that a station spawns in this area.
权重变量决定了每一种车站生成的几率。
When a station of a particular type spawns in the map, it picks a city area to spawn in with a preference towards areas with higher weight for that station type in the city area's Station Spawns array.
当某一种类的车站生成时,它会优先选择在车站生成设置中权重较高的城区。
This value doesn't increase the likelihood or order in which stations spawn overall. That value is set by your Schedules. See below.
该值不会影响整局游戏中车站生成的几率。这个几率可以通过修改时刻表达成,见下文。
Unlike with density values, where you generally want to stick in a safe range, it’s actually better to have widely variable weight values. For an area with two station types, try giving one type 1.0 and the other 0.4. If there’s three, try giving one type 1.0, another 0.6, and the last 0.2 or 0.1.
不像密度变量,如果你想保持一个安全范围,不同种类车站的权重最好多样一些。如果某一城区只生成2种车站,它们对应的权重可以是1.0和0.4。如果有3种车站,可以将它们的权重设为1.0,0.6,以及0.2或0.1。
Having big ratios differences help make each area feel unique and make gameplay consistent. If the values are too close to each other, station spawning may feel more random and your map will feel muddy or unpredictable.
为每种城区设置不同的权重分布可以让地图变得更加有趣,也更加有规律。如果权重值过于接近,车站的生成过程将更加随机且无法预测。

Station Spawns 生成车站
The Stations Spawns dictionary is the backbone of a map’s progression, and give you the control of the balance of the map. Schedules and other features here let you configure the order and rate that stations spawn.
车站生成字典是游戏进程的支柱,它也控制着整张地图的平衡性。时刻表以及其它特征可以用于设定车站生成的顺序和比例。
"stationSpawns": {
"schedule": [
{
"numDays": 6,
"randomness": 0.35,
"types": [
"CIRCLE",
"CIRCLE",
"CIRCLE",
"TRIANGLE",
],
},
{
"numDays": 11,
"randomness": 0.0,
"types": [
"CIRCLE",
"CIRCLE",
"CIRCLE",
"TRIANGLE",
"TRIANGLE",
"TRIANGLE",
"TRIANGLE",
"TRIANGLE",
"SQUARE",
"SPECIAL",
],
},
],
"cooldown": 0,
"special": ["PENTAGON", "DIAMOND", "DIAMOND", "STAR", "CROSS", "WEDGE"],
},
The "stationSpawns" dictionary must appear in the main dictionary of city.json.
city.json 文件的主字典中必须包含 "stationSpawns" 字典。
Schedules 时刻表
"schedule": [
{
"numDays": 6,
"randomness": 0.35,
"types": [
"CIRCLE",
"CIRCLE",
"CIRCLE",
"TRIANGLE",
],
},
]
The "schedule" array is an array of dictionaries. Schedules are picked by the game to choose which stations to spawn during gameplay.
"schedule" 数组包含若干字典。它决定了游戏中该生成哪些种类的车站。
"types": [
"CIRCLE",
"CIRCLE",
"CIRCLE",
TRIANGLE",
],
At the start of a game, one schedule will be picked at random. All the stations inside of the randomly-chosen schedule's "types" array will be queued up to spawn.
游戏在开始时会随机选择一个时刻表,该列表中的所有车站会按照顺序依次生成。
The valid types are "CIRCLE", "TRIANGLE", "SQUARE", and "SPECIAL".
时刻表中允许的车站种类为 "CIRCLE", "TRIANGLE", "SQUARE" 以及 "SPECIAL"。
"numDays": 6,
The stations will spawn over the course of the integer value of days, set by "numDays" in the schedule.
时刻表中的车站会在整型变量 "numDays" 设置的天数中完成生成。
"randomness": 0.35,
The "randomness" float value, which must be set between 0.0 and 1.0, determines how regular or random the timing of the station spawns will be. A value of 0.0 means that the four stations would spawn exactly every 1.5 days in-game. A value of 1.0 means that the four stations would spawn at completely random times.
浮点型变量 "randomness" 必须在0.0到1.0之间,它决定了车站生成的时刻是有规律的还是随机的。如果该值为0.0,那么例子中的4座车站生成之间的间隔都会是精确的1.5天,如果该值为1.0,4座车站可能在任何时刻生成。
"cooldown": 0,"
In the main "stationSpawn" dictionary again, the "cooldown" integer value sets how many days the game will wait before picking a new schedule, after all the stations in "types" are spawned.
整型变量 "cooldown" 设置了在一个时刻表中的车站全部生成与下一个时刻表开始执行之间的天数。
Keep in mind, as mentioned in the section above on Zoom and Start Areas, that if you spawn too many stations before the screen zooms out it can stop stations of a particular type from spawning ever again. Make sure you set the zoom fast enough to accommodate for the rate of stations spawning!
时刻记住,就像之前提醒过的,如果你的车站生成得太快,因为没有足够空间而生成失败的车站种类无法再次生成。务必确保地图扩张的速度与车站生成的速度相匹配。
Special Stations 特殊车站
"special": [
"PENTAGON",
"DIAMOND",
"DIAMOND",
"DIAMOND",
"STAR",
"CROSS",
"WEDGE"
],
"SPECIAL" stations are the extra, unique shapes of stations that can spawn or replace existing stations.
"SPECIAL" 是一种独特的车站种类,它们会自己生成,或者直接替换已经存在的车站。
To control exactly which types of unique stations show up, you can modify the "special" array. This is a list of the Special stations that will appear in the game.
如果你想精确控制特殊车站的种类,你可以修改 "special" 数组。这个数组包括所有会在游戏中生成的特殊车站。
Duplicates in this list will allow for multiple stations of that Special type to spawn. In the example above, it would allow three "DIAMOND" stations to spawn, and one of all the other lists types.
列表中重复的值表示该种车站可以重复生成。在上面这个例子中,钻石形车站可以生成3个,而其它车站只会生成1个。
The types of Special stations are "CROSS", "DIAMOND", "EGG", "GEM", "PENTAGON", "STAR", and "WEDGE".
特殊车站的种类包括"CROSS", "DIAMOND", "EGG", "GEM", "PENTAGON", "STAR" 和 "WEDGE"。
Station Replacements 车站替换
Every time a "WEDGE", "STAR", or "CROSS" station spawns, there's a 50% chance it will replace an existing non-Special station. This is a hard-coded value and can't be modified.
每当一个楔形车站、星形车站或者十字形车站生成时,它们有50%的概率替换一个已经存在非特殊车站。这是一个常量,无法修改。
Keep this in mind when planning out which special stations to use, in case you don't want your regular stations to be replaced!
如果你不想让原来的车站被替换,请避免使用以上三种特殊车站。
Balance Advice 平衡建议
When picking out the types to use across schedules, Vanilla maps tend to have more CIRCLEs than TRIANGLEs, and more TRIANGLEs than SQUAREs and SPECIALs, which have around the same amount as each other. You can experiment and modify this as you like!
在游戏自带地图中,圆形车站通常比三角形车站多,三角形车站比正方形车站和特殊车站多,而正方形车站与特殊车站的数量基本持平。不过你也可以自由发挥你的创造力!
You can also make a map feel more or less random based on how different each possible schedule is. In the example above, the first schedule has no SQUARE or SPECIAL stations, meaning it’s possible that the player may not see one of these stations for over two weeks if that station is randomly selected multiple times in a row.
你也可通过增加或减少不同时刻表之间的差距来放大或缩小地图的随机性。在本文的例子中,第一个时刻表不包含正方形车站和特殊车站,这意味着有可能在游戏中连着几周都见不到这两种车站。
Keep in mind the overall ratio of CIRCLE-to-TRIANGLE-to-SQUARE-to- SPECIAL, and a ratio of stations-per-day for each schedule. Try and pick a baseline value for each of these, and make two to four schedules varied around these values (with more or fewer stations or days) depending on how random you want the map to feel on each new playthrough.
时刻牢记圆形车站、三角形车站、正方形车站和特殊车站的数量比例,以及每个时刻表的车站生成速度。尝试着设定一个基准,然后使每个时刻表都基于此标准稍稍变化(比如改变车站数量或天数)。
(In the city.json main dictionary:)
"passengerSpawnScale": 1.1
Lastly, if a map is too hard and spawning too many stations, or too easy and spawning too few, the "passengerSpawnScale" float value in the main city.json dictionary can be modified. 1.0 is the baseline, and higher numbers will cause more peeps to spawn, and vice versa.
最后,如果地图生成的车站太多或者太少,你也可以修改 city.json 文件主字典中的浮点型变量 "passengerSpawnScale"。它的基准值为1.0,更高值会导致生成更多的乘客。
Playtest often and tweak these values to make your map a fun experience to play!
经常测试并对这些值进行微调可以使你的地图日趋完善!