[迷你地铁]自定义地图创建指南(一)

您所在的位置:网站首页 迷你世界自定义模型下载安装手机版 [迷你地铁]自定义地图创建指南(一)

[迷你地铁]自定义地图创建指南(一)

2024-07-10 10:09| 来源: 网络整理| 查看: 265

本文来自迷你地铁官方自定义地图指南,由Up主-高明-个人翻译,但保留英语原文。

注意:本编指南极长,且包含部分晦涩难懂的知识,仅适用于一心想要创建自定义地图的迷你地铁玩家。

原文链接:https://steamcommunity.com/sharedfiles/filedetails/?id=2295902845

第二部分:CV9868683        第三部分:CV9868830        第四部分:CV9871463        附录:CV9871565

本段目录

Installing Maps 导入地图

Map Creation 创建地图

City Basics 城市基础

Theme 主题

Obstacles 障碍物

Obstacle Options 障碍物选项

Installing Maps 导入地图

From the Steam Workshop 从 Steam 创意工坊导入

To play maps from the Steam Workshop, you just need to Subscribe to the map from its the Mini Metro Steam Workshop page. Next time you start the game, Mini Metro will try and load the map. If it doesn’t appear, the map may have an error. The error should appear in your Unity Player log file.

只需在迷你地铁创意工坊订阅地图即可在游戏中游玩。下次启动时游戏会尝试加载地图,如果加载失败,则地图不会出现,且错误会被记录在游戏日志中。

You can remove Steam Workshop maps by unsubscribing, and deleting its respective folder in the Workshop Content location for Mini Metro, in:

你可以通过取消订阅并删除本地文件来移除社区地图,社区地图在玩家电脑中存放的地址为:

/steamapps/workshop/content/287980/

From a Map Folder 从地图文件夹导入

When you run Mini Metro for the first time, it will create a /mod/ folder in your Mini Metro Resources folder.

当你首次运行迷你地铁时,它会在游戏文件中自动创建一个 /mod/ 文件夹。

You can open this folder by clicking this button on the Community Maps screen, or by following the path below.

你可以点击游戏界面中的图标访问该文件夹,也可以直接在你的电脑中找到它。

On Windows, this can be found in: Windows 系统文件地址

/AppData/LocalLow/Dinosaur Polo Club/Mini Metro/mod/

On Mac, this is in: Mac 系统文件地址

/Library/Application Support/unity.Dinosaur Polo Club.Mini Metro/mod/

On Linux, this is in: Linux 系统文件地址

~/.config/unity3d/Dinosaur Polo Club/Mini Metro/mod/

(Up注:如果你找不到上述文件夹,则可能需要在文件夹查看设置中选择显示被隐藏的文件夹)

You can play maps that are not available on the Steam workshop by adding folders into the /mod/ folder. The map-maker will need to provide you a download link to a folder containing the map files. Once you have this, copy it into your /mod/ folder. The city folder must contain a city.json file, but may also include theme.json, train.json, audio.json, achievements.json, and steam.json.

如果你想游玩的地图不在 Steam 创意工坊,你可以把该地图的文件夹放入 /mod/ 文件夹。如此一来地图制作者需要提供一个下载地图的链接。当你有了地图文件夹,就把它复制到 /mod/ 文件夹中。地图文件夹必须包含一个 city.json 文件,其它非必要文件包括 theme.json, train.json, audio.json, achievements.json 以及 steam.json。

Next time you start the game, Mini Metro will try and load the map. If it doesn’t appear, the map may have an error. The error should appear in your Unity Player log file.

下次启动时游戏会尝试加载地图,如果加载失败,则地图不会出现,且错误会被记录在游戏日志中。

You can remove the map by deleting its city folder from the /mod/ folder.

如果你想移除地图,只需在 /mod/ 文件夹中将其删除。

Log Files 日志文件

Your Unity Player log file is where errors that occur during map-loading will appear. If a map does not appear in the Community Maps list, you should check here.

加载地图时遇到的错误会被记录在日志文件中。如果你的地图加载失败,你可以查看日志得知原因。

On Windows, this can be found in: Windows 系统日志地址

/AppData/LocalLow/Dinosaur Polo Club/Mini Metro/Player.log

On Mac, this is in: Mac 系统日志地址

/Library/Logs/Dinosaur Polo Club/Mini Metro/Player.log

On Linux, this is in: Linux 系统日志地址

~/.config/unity3d/Dinosaur Polo Club/Mini Metro/Player.log

Map Creation 创建地图

To create a new map, you’ll need to create a new sub-folder for the city within the /mod/ folder. You can find the location of this folder, above. Give the folder a unique name, based on the city.

创建地图的第一步是在 /mod/ 文件夹中创建一个新文件夹,并根据所选城市为其命名。

Maps are edited through JSON-formatted files you add into this subfolder. All maps need a city.json, which defines the majority of gameplay info about the city. Other files, which you can add to the folder, change other aspects of your city.

想要编辑地图,需要在地图文件夹中加入 JSON 格式文件。所有地图都需要一个 city.json,这个文件定义了地图大部分信息。其它的一些文件则会改变地图的其它特征。

theme.json defines the appearance of the map.

theme.json 文件定义地图的外观。

trains.json defines the speed, capacity, and other information about locomotives in the city.

train.json 定义机车的速度,容量以及其它信息。

achievements.json lets you configure custom challenges.

achievements.json 可以创建游玩该地图时的可获得的成就。

steam.json contains info that is used to upload to the Steam Workshop, and a preview.png/jpg/gif file will be uploaded for your mod's preview image.

steam.json 文件包括该地图上传到 Steam 创意工坊后显示的信息。一张以"preview"命名的 png/jpg/gif 文件会被设置为地图的预览图。

File Format 文件格式

Mini Metro will only attempt to read files ending with .txt and .json, and the text content of these files must be in JSON format.

只有 .txt 和 .json 后缀的文件才会被读取,而且文件中的格式必须是 JSON 格式。

JSON format is a readable data structure format made up of dictionaries and arrays. If a file isn’t in correct JSON format, the map will fail to load and try to print an error message to your Unity Player log.

JSON 格式是一种由“字典”和“数组”构成的可读取数据结构格式。如果一个文件并不是正确的 JSON 格式,则地图会加载失败并报错。

JSON format is generally easy to read, and store information with keys and values in Dictionaries and Lists.

JSON 格式通常易于理解。它使用“字典”和“列表”储存各种键和值。

Dictionaries are in {curly brackets}, which contain unordered entries with specific names. Entries in dictionaries are stored with keys between quotation marks, followed by a value after a colon. Values can be strings of text between quotation marks, numbers, or booleans with the values true and false.

字典由{大括号}包裹,它包括有特定名称的无序条目。字典中的条目以双引号之间的键形式储存,其后是冒号以及一个值。值可以是带双引号的字符串,数字或者布尔值。

Within this upgrade dictionary, you can see the key "type" with a string value "Locomotive", and the key "count" and "weight" with integer (whole number) and float (number with decimal points) values respectively.

在这个升级字典(Up注:每周开始时选择的升级财产)中,"type" 就是键,而后面的 "Locomotive" 即为字符串值。键 "count" 和 "weight" 的值则是整型和浮点型。

In this station dictionary, you can also see that arrays can be stored within dictionaries with a key. The key "position" is itself an array, with a list of two numbers.

在这个车站字典中,可以看到数组也可以被储存在键中。键 "position" 就是一个数组,里面是一个带两个数字的列表。

Arrays are in [square brackets], and contain an ordered list of values without keys to correspond to values. All the values in an array must be the same type. Values can be strings of text between quotation marks, numbers, or booleans with the values true and false.

数组被包裹在[方括号]中,是有序排列的数值列表。数组中所有元素都必须是同一类型,可以是双引号间的字符串,数字或者布尔值。

This array is a list of strings, which read out the initial upgrades for a city.

这是一个包含若干字符串的数组,它定义了一张地图的初始财产。

In addition, you can have arrays of dictionaries, or arrays of arrays. The above array is a list of dictionaries. Each dictionary configures options for the lines in a city.

除此之外,你也可以在数组中包含字典,或者数组套数组。以上这个数组就是字典的列表。每一个字典定义了一条地铁路线。

Entries in dictionaries and arrays must always be separated by commas.

字典和数组中的条目必须被逗号隔开。

There are many excellent guides to learn JSON formatting online, such as W3School’s syntax guide [www.w3schools.com], and various tools to debug incorrect JSON format [jsonformatter.curiousconcept.com]. You can download a text editor such as Sublime Text [www.sublimetext.com], which contains built-in JSON format packages that will point out errors as you type.

你可以在网上找到很多学习 JSON 格式的教程,比如说 W3School's syntax guide,以及为出错的 JSON 格式排除故障的工具。你可以下载诸如 Sublime Text 一类的文档编辑器,它本身包含了 JSON 格式包,可以帮你找出错误。

Debugging 排除错误

Every time you make a change to a map, you need to restart the game for it to take effect. Maps that you've subscribed to on the Steam Workshop, or from your /mod/ folder, are only loaded when the game starts.

每当你对地图作出修改,都需要重启游戏才能让修改生效。只有在启动游戏时,社区地图和本地地图才会加载。

If there's any kind of major issue with your map, Mini Metro will not load it. You can check your Unity Player log file to look for any issues with your map, and try and fix them. Most map-loading warnings or errors will appear on a line with FromUgc, so you can search for that.

如果你的地图有任何问题,游戏都不会加载它。你可以检查游戏日志查看你地图的错误并尝试改正。大多数错误警告会包含 FromUgc,你可以用该词条进行搜索。

City Basics 城市基础

The city.json file will contain the core gameplay info for your new city.

city.json 文件包括地图的核心信息。

If you want to get started fast, you can download the Workshop Demo Map file here [drive.google.com], and follow along with this guide. All the information in the JSON files in the Demo Map will follow the order that it appears in this guide.

可以通过 [https://drive.google.com/file/d/1mgxFwjlCdANfR0QC3bMp64I9LVuYd71A/view] 下载示范地图,并在其基础上根据此教程修改。示范地图中的 JSON 文件和此教程中的代码顺序相同。(Up注:此链接需要VPN才能访问)

Everything inside a city.json file should be included in one large dictionary. These elements should appear at the top!

city.json 文件中所有的条目都必须被包含于一个大字典中,以上这些元素应该被写在开头

"id" is a unique string that identifies your map. It won’t show up anywhere in-game, but it needs to be different from any other city’s ID.

"id" 是一个用于识别地图的独特字符串。它不会在游戏中出现,但每个地图的 id 必须是独一无二的。

These string values determine the what will be shown for the map's name, and description, on the Community Maps menu.

这些字符串是地图的名称以及描述,它们会出现在社区地图菜单中。

If your city has a unique name in the native language to the region, you can make that local name appear in smaller text beneath the main name by setting "customLocalName".

如果你的地图有一个本地语言名称,你可以额外创建一个 "customLocalName" 键来展示它。

You also need to set the "customLocalNameLocale" to the language code for that local name, if it uses non-English characters. Not all characters can be shown, especially for CJK languages.

如果本地名称包含非英语字符,则需要创建 "customLocalNameLocale" 键设置本地名称所适用的语言代码。并不是所有字符都能显示,尤其是对于包含 CJK 字符的语言。

You can check out the Language Codes appendix for a list of all usable values.

你可以在附录中查看不同语言设置对应的代码。

Crossing Style determines whether the map will use Tunnels or Bridges. The value can either be “Bridge” or “Tunnel”. This has no gameplay effect and only determines if the game shows the bridge or tunnel symbol in the upgrades toolbar, and in the weekly upgrades screen.

跨越类型决定了一张地图是使用隧道还是桥梁。这里的值可以是 "Bridge" 或者 "Tunnel"。不同过河方式对游戏性没有任何影响,只会改变游戏中对应的图标。

Line Count is a number value (note: no quotations around the number!) determines how many lines are available at most in the city.

线路数量是一个整型值(注意:两边不能有双引号!),它决定一张地图中有多少条线路。

Keep in mind that all vanilla maps have between 5 to 7 lines, so keeping the value within this range is a good idea. The maximum allowed is 20 lines.

注意,游戏自带地图只有5到7条线路,所以创建新地图时最好把线路数量保持在这个范围内。这个值最大不能超过20。

Optionally, you can change the "audioLoadoutId" string value in city.json to make your map use the sounds of another vanilla city.

你可以通过修改 "audioLoadOutId" 来改变地图背景音乐的风格。

The “london” loadout is used by default, but try changing it to “sanfrancisco” or “saintpetersburg”, or the lowercase, space-less name of any other vanilla city, and hear how the game will sound different.

默认值是伦敦地图的 "london",如果把它改成其它自带地图的小写名称,如 "sanfrancisco" 或 "saintpetersburg",背景音乐会略有不同。

You can use any value from the Audio IDs Appendix section for this value.

你可以在附录中查找不同的背景音乐代码。

Theme 主题

Adding a theme.json file will give you control over how the map looks, including the line colours, water and station appearance and outline weight, night mode options, and so on.

添加一个 theme.json 文件可以让你修改地图的形象,包括线路的颜色、水体和车站的外观以及边框的粗细、夜间模式下的地图外观等等。

Theme File Basics 主题文件基础

Like the "id" in the city.json file, "name" is a unique ID that each theme.json file must have.

如同 city.json 文件中的 "id","name" 是每个 theme.json 文件必须的独一无二的身份。

Once you set the "name", make sure to go back to your city.json file, and set the city’s “theme” value to the “name” in your theme.json file.

当你创建了 "name" 之后,你需要回到 city.json 文件并把其中的 "theme" 值设定为 theme.json 文件中的 "name" 值。

If you don't want to make a custom theme, you can use any of the values from the Vanilla Theme Appendix as the value for "theme" in the city.json file.

如果你不想要自定义主题,你可以使用自带地图的主题。它们的 "name" 可以在附录中查看。

When adding colours, they appear in an array of three numbers, corresponding to the RGB values of a colour (from 0 to 255 with no decimals).

当设置颜色时,它们以包含三个数字的数组形式出现,对应RGB颜色值(0到255的整数)。

When picking out the colour values, it’s best to reference any existing metro maps of the city that you're making. You can use image editing software such as Photoshop or Gimp to pick out the RGB values of colours in the image with an Eyedropper tool, and then use those values in the theme.

当你挑选颜色时,最好以游戏中现有的地图进行参考。你可以用图片修改软件(比如Photoshop 或 Gimp)提取颜色并获得其RGB值,然后把它输入进 theme.json 文件。

Backgrounds and People 背景与通勤者

The "backgroundColor" dictionary is the most straightforward in the file. This dictionary contains two colour arrays. "day" is a colour array that defines how the background will be coloured if the player has default options, and "night" is a colour array that defines how the background will appear with Night Mode enabled.

"backgroundColor" 字典十分直截了当,它包含两个颜色数组。"day" 定义默认条件下的背景颜色,"night"则定义夜间模式下的背景颜色。

If you don't set a "night" colour, the "day" colour will be used.

如果你不设置夜间颜色,则夜间模式下也会使用默认颜色。

Structured similarly, the "peepColor" dictionary defines how peeps (the commuters represented as shapes that appear at stations) will be coloured on the map.

相似的,"peepColor" 字典定义了通勤者(不同形状的多边形▲◼)的颜色。

Obstacles and Stations 障碍与车站

The "waterColor" and "stationColor" dictionaries define the colour of water obstacles, and stations in the city, respectively.

"waterColor" 与 "stationColor" 字典分别定义了水体障碍和车站的颜色。

These colour dictionaries work a little differently. The "internal" and "outline" dictionaries define the body and outline colour for obstacles and stations, and contain a day and night variant as above.

这些颜色字典的工作方式略有不同。"internal" 和 "outline" 字典分别定义了内部和边框的颜色,并且各有默认值和夜间值。

The "outlineWidth" and "previewOutlineWidth" values set how thick the outline colour should appear, during gameplay and in the city preview respectively. These can be set to -1.0 to not appear at all.

"outlineWidth" 和 "previewOutlineWidth" 值分别决定游戏中以及预览时边框的粗细程度。如果值为 -1.0,则没有边框。

Lines 线路

The "lineColors" array is a list of dictionaries with day and (optionally) night colour arrays. The order of colours listed will correspond to the colours of lines that are used in the map.

"lineColors" 数组是一系列包含日间与夜间颜色的数组的列表(夜间颜色也可以没有)。列表中的顺序对应着游戏中线路的顺序。

You must include at least as many Line Colours as your Line Count value, set in city.json. The city will fail to load if it cannot find enough line colours.

你必须在此列表中包含至少与 city.json 中线路数量相等的颜色值。如果线路颜色值少于线路数量,地图就无法成功加载。

Obstacles 障碍

Obstacles are the rivers, lakes, water bodies and islands that will shape the way your map plays, as well as other visual elements you want to include in your maps, and background elements to give your map a smooth transition in.

障碍就是地图中各种各样的河流、湖泊、水体、岛屿,以及其它各种你想包含在地图中的元素。

Obstacles are stored as dictionaries in the "obstacle" array of your city.json file.

障碍以字典形式被储存于 city.json 文件中的 "obstacle" 数组里。

The order that obstacles are added is important. The first dictionary in this array is drawn first, then the second on top of that, and so on. That means that islands have to be added after your main body of water, which is added after any background shapes.

障碍物添加的顺序十分关键,靠前的字典会先被加载。这也就是说岛屿字典必须写在包含它的水体字典之后,而水体字典必须写在它包含的任何物体字典之前。

Points 点

The "points" array provides a list of 2D vertices, which are filled in to create the obstacle visually. Each array inside "points" contains two float numbers, corresponding to the X and Y values in the map.

"points" 数组包含被用于创建障碍物的二维坐标列表。每个数组包含两个浮点型数,对应着地图上的 X 坐标和 Y 坐标。

The first number refers to the left-right X axis, and a higher X number will mean a point further right, and a lower number means a point further left. The second number is for the up-down Y axis where a Y lower number will make a point higher up on the screen, and a higher number means a point lower down.

第一个数字对应横坐标 X,越靠右的点其 X 坐标值越大。第二个数字对应纵坐标 Y,越靠上的点 Y 坐标值越大。

Tools for Drawing Points 画图工具

It’s helpful to have a tool to draw your map’s obstacles with. It’s easiest to design maps in SVG format using a vector editor, such as ,  or . Since you’ll just be making relatively simple shapes without complex curvature, most software should let you work on this right out of the box.在勾画障碍物时,适合的工具十分重要。比较简单的设计方式便是使用矢量编辑器制作 SVG 格式的地图,可用的工具包括 ,,或者 。毕竟我们只是画一些简单的图形,大多数应用都能让我们很快上手使用。It's helpful to import real metro maps or some satellite screenshots of a city at various resolutions, to have some references to trace your water bodies from.强烈推荐把真实的地铁线路图或者不同分辨率卫星照片当作勾勒水体轮廓时的参考。In your SVG editor, you should use a basic Pen or Pencil tool to draw each of your planned obstacles: your background, any colliding water features and islands, and decorative obstacles.在你的 SVG 编辑器中,你可以使用一支笔画出你想要的形状,包括:大背景、水体、水中的岛屿,以及装饰性的障碍。All islands that you draw should be totally contained within a water obstacle. Otherwise, obstacle-loading may fail, and your map won't load correctly.所有岛屿都必须完全位于水体中,否则地图加载可能失败。In your SVG Editor, click without dragging to create straight lines from point to point with the Pen or Pencil tool. Make sure to close each of these objects into a shape, not just an open path, by clicking the first point of the line when you're done. This closes the shape. In addition, make sure to not use the curvature tools that your SVG editor will have to make curved vectors. Everything should be a straight line.在 SVG 编辑器中,使用笔点击并移动鼠标以画出直线描绘形状。请确保每一个物体的轮廓都是闭合的。此外,请不要使用编辑器中的曲率工具。所有线条都必须是线段。As a general rule of thumb, try and keep the core gameplay features of your map in a 4000 pixel wide, by 3000 pixel high region, centered at the top left [0,0] point of your SVG workspace. Be mindful that you have less vertical space and vision in-game than you do horizontal.一般来说,不要让地图的游玩区域的宽和高超过4000和3000像素,且 SVG 编辑器中的左上角为原点 [0,0],毕竟游戏界面都是宽度大于高度的。It’s important to have the map centred at [0,0], as this will be the centre of your screen when the map is fully zoomed out. In Illustrator or Inkscape, the [0,0] point is the top-left corner of your artboard or workspace. You might have to drag your obstacle up and off the screen to center them in the top-left corner.请确保你的地图中央为原点 [0,0],这也会是最终游玩时屏幕的中心。在 和 中,界面的左上角才是原点。如此一来,你需要将障碍物的位置进行调整,以吻合编辑器的坐标系统。Once you’re happy with the way your map looks in your editor, save the file in .svg format. If you have the option, save with SVG 1.1 format.当你画完障碍物后,将它保存为 .svg 后缀的文件,最好是 SVG 1.1 的格式。

Converting SVG to JSON Format 将 SVG 转换为 JSON

Now you need to use a tool like Sublime Text, or any other text editor, and open your .svg file as if it were plain text. Right click the SVG, and Open With your preferred text editor.现在你需要使用文本编辑器(如 Sublime Text)把 SVG 文件右键打开。If you’ve done everything right, you’ll find that SVG is saved in a readable format. If you correctly close the paths you were drawing to create polygons, you’ll see your shape. Search for its name, if you labelled it, and you should see a list of all the absolute points.如果一切正常的话,你的 SVG 看起来应该比较整齐。如果你正确地闭合了所有轮廓路径,你就能看见它们组成的形状。如果你标记了它们,你还能搜到它们的标记。你将会看到一个包含所有绝对坐标的列表。If you find any letters in the definition of the shape, it's likely you've added curvature somewhere. Alternatively, if the coordinates don't look right, or the numbers aren't large enough, it may be the case that the coordinates are in relative points. In both of these cases, refer to the "Obstacles Troubleshooting" section for a fix.如果你在任何形状的描述中见到了字母,你可能是在创建它的时候用到了曲率。此外,如果形状和大小不对劲,有可能是因为使用了相对坐标。这些问题的解决方法请参见附录。Copy out the points for each obstacle into a new file, and do some find-and-replaces to get the format correct for the obstacle points array. You can follow these steps:将障碍物所有的点的坐标复制到一个新文件中,并把它们改成游戏可以读取的格式。具体步骤如下:

Delete any line breaks within the obstacle. All the points should then be on one line, separated by spaces, with the X and Y values separated by commas.

删除一个障碍物定义中所有的换行。所有的点都应在同一行上,且被空格分开。每个点将包括被逗号分隔的 X 与 Y 坐标值。

Replace all spaces with line breaks, so each point is on a new line.

将所有空格变成换行,使得每一行只有一个点的坐标。

Because Mini Metro’s negative Y coordinate is up, replace each "," with ",-" to flip the Y value. Then, delete each "--", since a double negative makes a positive!

因为游戏中上方是负 Y 轴,调转所有 Y 坐标值的正负符号。

Finally, add a "[" to the start of each line, and a "]," with a comma to the end of each line, and you have your JSON array of arrays!

最后,将每一行上的点坐标都用[方括号]包住,这样就是 JSON 中的数组格式了!

You may also want to check for any duplicate points. Duplicate points that immediately follow each other in your obstacles can cause the obstacle to not load improperly. Also keep in mind that the obstacle is a looping path, so the first and last points will automatically connect.你也可以检查看看是否有重复的点,不过两个挨着的重复坐标也不会有影响障碍物正常加载。此外,因为障碍物的轮廓都是闭合的,所有第一个点与最后一个点的坐标也应该是相同的。Now just copy out your newly JSON-formatted list into the “points” array, and you have yourself an obstacle!

现在,你就可以把这些 JSON 列表放进你的 "points" 数组里,你的障碍物就设置好了!

Obstacle Options 障碍选项

The other values in an obstacle dictionary configure what an obstacle is doing in the map, how it affects gameplay, and so on.

其它的值也有各自的功能。

The boolean value "“visual” determines if an obstacle is drawn on the map during gameplay.

布尔值 "visual" 决定游戏画面是否显示该障碍物。

The boolean value "inverted“ determines if an obstacle is drawn is drawn as a water body, with the water colours set in theme.json, or, as an island or background object with the background colours. Your bodies of water should use the false value, whereas backdrops and islands will be set to true.

布尔值 "inverted" 决定该障碍物是水体还是岛屿,又或者是背景物体。水体应使用 false 值,而背景和岛屿应使用 true 值。

The boolean value "decoration" determines if the obstacle will be used to check collision.

布尔值 "decoration" 决定该障碍物是否会检测碰撞。

Setting this to true disables it as a gameplay element, and won’t require you to spent tunnels to cross it as a water obstacle.

如果该值为 true,则游戏中线路通过该障碍物时不需要消耗隧道或桥梁。

Enabling this on obstacles that you know won’t ever be crossed, or on islands where you know stations shouldn’t appear, you can increase performance and cut loading time, especially on obstacles with many points.

对于地图中不会被越过的障碍物,或者不会生成车站的岛屿,你都可以将它们的 "decoration" 值设置为 true,这样可以改善游戏性能并减少加载时间,尤其是轮廓包含很多点的障碍物。

The boolean value "inPreview" determines whether this obstacle will be drawn in the preview image. Any visual body of water or island should set this to true, but, setting this to false for objects that you know will be outside the preview window can increase performance and cut loading time.

布尔值 "inPreview" 决定该障碍物是否在预览图中显示。任何可见的水体或岛屿的此值都应设置为 true。但将预览范围外的障碍物的此值设置为 false 可改善游戏性能并减少加载时间。

The "cornerRadius" value can be used to round out the edges of an obstacle. Setting this to a float value above 0 will bevel the sharp edges of an obstacle and create smooth corners.

"cornerRadius" 值可以使障碍物的边角变得圆润。将其设置为一个正浮点数值可以把锋利的角变得更有弧度。

Setting "cornerRadius" to -1.0 disables corner rounding.

若将该值设置为 -1.0,则边角不会发生变化。

The "color" value is an extra optional dictionary you can add. Adding this will let you set custom colours for a specific obstacle, overriding the default water colour, or background colour, set in the theme.json file.

"color" 值是一个可以自行添加的字典。你可以为特定障碍物指定一种颜色。

The "parent" value is a special value that you only need to add if you intend to have multiple bodies of water in a map.

"parent" 值十分特殊,只有地图中存在多个水体时才需要添加该值。

Any island with collision needs to declare which water body it belongs to. The integer value of “parent” declares which water obstacle, starting at the top of your dictionary with 0, the island is a part of. If it’s excluded, the game will default to using the first body of water found from the top of the obstacles list.

任何会检测碰撞的岛屿都必须指明它所在的水体,而整型值 "parent" 起到这一作用。障碍物列表中第一个障碍物索引值为0,第二个为1,以此类推。岛屿的 "parent" 值必须和它对应水体的索引数相等。如果不设置该值,则默认使用第一个水体作为母体。

Setting this incorrectly will cause obvious gameplay and visual issues with islands and water crossings in the map.

如果该值设置不正确,游戏画面会出现明显错误,水体和岛屿会互相交错。

The "fixPreview" boolean value should be set to true if the obstacle is failing to fill-in correctly in your preview image.

如果某一障碍物不能正确的填充进预览图,其布尔变量 "fixPreview" 应被设置为 true。

This typically occurs when the preview window size (see the Preview section below) would cut the preview into multiple objects, rather than one connected object.

这种情况的通常现象是预览图会把障碍物分割成若干部分,而不是一个联通的物体。

由于字数限制,第一部分到此为止



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3