五月天青色头像情侣网名,国产亚洲av片在线观看18女人,黑人巨茎大战俄罗斯美女,扒下她的小内裤打屁股

歡迎光臨散文網(wǎng) 會(huì)員登陸 & 注冊(cè)

[迷你地鐵]自定義地圖創(chuàng)建指南(一)

2021-01-25 23:05 作者:高_(dá)明  | 我要投稿

本文來(lái)自迷你地鐵官方自定義地圖指南,由Up主-高明-個(gè)人翻譯,但保留英語(yǔ)原文。

注意:本編指南極長(zhǎng),且包含部分晦澀難懂的知識(shí),僅適用于一心想要?jiǎng)?chuàng)建自定義地圖的迷你地鐵玩家。

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

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


本段目錄

  • Installing Maps 導(dǎo)入地圖

  • Map Creation 創(chuàng)建地圖

  • City Basics 城市基礎(chǔ)

  • Theme 主題

  • Obstacles 障礙物

  • Obstacle Options 障礙物選項(xiàng)

Installing Maps 導(dǎo)入地圖

From the Steam Workshop 從 Steam 創(chuàng)意工坊導(dǎo)入

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.

只需在迷你地鐵創(chuàng)意工坊訂閱地圖即可在游戲中游玩。下次啟動(dòng)時(shí)游戲會(huì)嘗試加載地圖,如果加載失敗,則地圖不會(huì)出現(xiàn),且錯(cuò)誤會(huì)被記錄在游戲日志中。

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

你可以通過取消訂閱并刪除本地文件來(lái)移除社區(qū)地圖,社區(qū)地圖在玩家電腦中存放的地址為:

/steamapps/workshop/content/287980/

From a Map Folder 從地圖文件夾導(dǎo)入

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

當(dāng)你首次運(yùn)行迷你地鐵時(shí),它會(huì)在游戲文件中自動(dòng)創(chuàng)建一個(gè) /mod/ 文件夾。

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

你可以點(diǎn)擊游戲界面中的圖標(biāo)訪問該文件夾,也可以直接在你的電腦中找到它。

On Windows, this can be found in: Windows 系統(tǒng)文件地址

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

On Mac, this is in: Mac 系統(tǒng)文件地址

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

On Linux, this is in: Linux 系統(tǒng)文件地址

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

(Up注:如果你找不到上述文件夾,則可能需要在文件夾查看設(shè)置中選擇顯示被隱藏的文件夾)

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 創(chuàng)意工坊,你可以把該地圖的文件夾放入 /mod/?文件夾。如此一來(lái)地圖制作者需要提供一個(gè)下載地圖的鏈接。當(dāng)你有了地圖文件夾,就把它復(fù)制到?/mod/?文件夾中。地圖文件夾必須包含一個(gè) 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.

下次啟動(dòng)時(shí)游戲會(huì)嘗試加載地圖,如果加載失敗,則地圖不會(huì)出現(xiàn),且錯(cuò)誤會(huì)被記錄在游戲日志中。

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.

加載地圖時(shí)遇到的錯(cuò)誤會(huì)被記錄在日志文件中。如果你的地圖加載失敗,你可以查看日志得知原因。

On Windows, this can be found in: Windows 系統(tǒng)日志地址

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

On Mac, this is in: Mac 系統(tǒng)日志地址

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

On Linux, this is in: Linux 系統(tǒng)日志地址

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


Map Creation 創(chuàng)建地圖

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.

創(chuàng)建地圖的第一步是在?/mod/?文件夾中創(chuàng)建一個(gè)新文件夾,并根據(jù)所選城市為其命名。

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 格式文件。所有地圖都需要一個(gè) city.json,這個(gè)文件定義了地圖大部分信息。其它的一些文件則會(huì)改變地圖的其它特征。

  • 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 定義機(jī)車的速度,容量以及其它信息。

  • achievements.json lets you configure custom challenges.

    achievements.json 可以創(chuàng)建游玩該地圖時(shí)的可獲得的成就。

  • 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 創(chuàng)意工坊后顯示的信息。一張以"preview"命名的 png/jpg/gif 文件會(huì)被設(shè)置為地圖的預(yù)覽圖。

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 后綴的文件才會(huì)被讀取,而且文件中的格式必須是 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 格式是一種由“字典”和“數(shù)組”構(gòu)成的可讀取數(shù)據(jù)結(jié)構(gòu)格式。如果一個(gè)文件并不是正確的 JSON 格式,則地圖會(huì)加載失敗并報(bào)錯(cuò)。

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

JSON 格式通常易于理解。它使用“字典”“列表”儲(chǔ)存各種鍵和值。

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.

字典由{大括號(hào)}包裹,它包括有特定名稱的無(wú)序條目。字典中的條目以雙引號(hào)之間的鍵形式儲(chǔ)存,其后是冒號(hào)以及一個(gè)值。值可以是帶雙引號(hào)的字符串,數(shù)字或者布爾值。

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.

在這個(gè)升級(jí)字典(Up注:每周開始時(shí)選擇的升級(jí)財(cái)產(chǎn))中,"type" 就是鍵,而后面的 "Locomotive" 即為字符串值。鍵 "count" 和 "weight" 的值則是整型和浮點(diǎn)型。

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.

在這個(gè)車站字典中,可以看到數(shù)組也可以被儲(chǔ)存在鍵中。鍵 "position" 就是一個(gè)數(shù)組,里面是一個(gè)帶兩個(gè)數(shù)字的列表。

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.

數(shù)組被包裹在[方括號(hào)]中,是有序排列的數(shù)值列表。數(shù)組中所有元素都必須是同一類型,可以是雙引號(hào)間的字符串,數(shù)字或者布爾值。

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

這是一個(gè)包含若干字符串的數(shù)組,它定義了一張地圖的初始財(cái)產(chǎn)。

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.

除此之外,你也可以在數(shù)組中包含字典,或者數(shù)組套數(shù)組。以上這個(gè)數(shù)組就是字典的列表。每一個(gè)字典定義了一條地鐵路線。

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

字典和數(shù)組中的條目必須被逗號(hào)隔開

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.

你可以在網(wǎng)上找到很多學(xué)習(xí) JSON 格式的教程,比如說 W3School's syntax guide,以及為出錯(cuò)的 JSON 格式排除故障的工具。你可以下載諸如 Sublime Text 一類的文檔編輯器,它本身包含了 JSON 格式包,可以幫你找出錯(cuò)誤。


Debugging 排除錯(cuò)誤

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.

每當(dāng)你對(duì)地圖作出修改,都需要重啟游戲才能讓修改生效。只有在啟動(dòng)游戲時(shí),社區(qū)地圖和本地地圖才會(huì)加載。

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.

如果你的地圖有任何問題,游戲都不會(huì)加載它。你可以檢查游戲日志查看你地圖的錯(cuò)誤并嘗試改正。大多數(shù)錯(cuò)誤警告會(huì)包含?FromUgc,你可以用該詞條進(jìn)行搜索。



City Basics 城市基礎(chǔ)

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]?下載示范地圖,并在其基礎(chǔ)上根據(jù)此教程修改。示范地圖中的 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 文件中所有的條目都必須被包含于一個(gè)大字典中,以上這些元素應(yīng)該被寫在開頭

"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" 是一個(gè)用于識(shí)別地圖的獨(dú)特字符串。它不會(huì)在游戲中出現(xiàn),但每個(gè)地圖的 id 必須是獨(dú)一無(wú)二的。

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

這些字符串是地圖的名稱以及描述,它們會(huì)出現(xiàn)在社區(qū)地圖菜單中。

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

如果你的地圖有一個(gè)本地語(yǔ)言名稱,你可以額外創(chuàng)建一個(gè) "customLocalName" 鍵來(lái)展示它。

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.

如果本地名稱包含非英語(yǔ)字符,則需要?jiǎng)?chuàng)建 "customLocalNameLocale"?鍵設(shè)置本地名稱所適用的語(yǔ)言代碼。并不是所有字符都能顯示,尤其是對(duì)于包含 CJK?字符的語(yǔ)言。

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

你可以在附錄中查看不同語(yǔ)言設(shè)置對(duì)應(yīng)的代碼。

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"。不同過河方式對(duì)游戲性沒有任何影響,只會(huì)改變游戲中對(duì)應(yīng)的圖標(biāo)。

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

線路數(shù)量是一個(gè)整型值(注意:兩邊不能有雙引號(hào)?。?,它決定一張地圖中有多少條線路。

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條線路,所以創(chuàng)建新地圖時(shí)最好把線路數(shù)量保持在這個(gè)范圍內(nèi)。這個(gè)值最大不能超過20。

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

你可以通過修改 "audioLoadOutId" 來(lái)改變地圖背景音樂的風(fēng)格。

The “l(fā)ondon” 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.

默認(rèn)值是倫敦地圖的 "london",如果把它改成其它自帶地圖的小寫名稱,如 "sanfrancisco" 或 "saintpetersburg",背景音樂會(huì)略有不同。

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.

添加一個(gè) theme.json 文件可以讓你修改地圖的形象,包括線路的顏色、水體和車站的外觀以及邊框的粗細(xì)、夜間模式下的地圖外觀等等。


Theme File Basics 主題文件基礎(chǔ)

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

如同 city.json 文件中的 "id","name" 是每個(gè) theme.json 文件必須的獨(dú)一無(wú)二的身份。

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.

當(dāng)你創(chuàng)建了 "name" 之后,你需要回到 city.json 文件并把其中的 "theme" 值設(shè)定為 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).

當(dāng)設(shè)置顏色時(shí),它們以包含三個(gè)數(shù)字的數(shù)組形式出現(xiàn),對(duì)應(yīng)RGB顏色值(0到255的整數(shù))。

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.

當(dāng)你挑選顏色時(shí),最好以游戲中現(xiàn)有的地圖進(jìn)行參考。你可以用圖片修改軟件(比如Photoshop 或 Gimp)提取顏色并獲得其RGB值,然后把它輸入進(jìn) 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" 字典十分直截了當(dāng),它包含兩個(gè)顏色數(shù)組。"day" 定義默認(rèn)條件下的背景顏色,"night"則定義夜間模式下的背景顏色。

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

如果你不設(shè)置夜間顏色,則夜間模式下也會(huì)使用默認(rèn)顏色。

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" 字典分別定義了內(nèi)部和邊框的顏色,并且各有默認(rèn)值和夜間值。

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" 值分別決定游戲中以及預(yù)覽時(shí)邊框的粗細(xì)程度。如果值為 -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" 數(shù)組是一系列包含日間與夜間顏色的數(shù)組的列表(夜間顏色也可以沒有)。列表中的順序?qū)?yīng)著游戲中線路的順序。

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 中線路數(shù)量相等的顏色值。如果線路顏色值少于線路數(shù)量,地圖就無(wú)法成功加載。



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.

障礙以字典形式被儲(chǔ)存于 city.json 文件中的 "obstacle" 數(shù)組里。

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.

障礙物添加的順序十分關(guān)鍵,靠前的字典會(huì)先被加載。這也就是說島嶼字典必須寫在包含它的水體字典之后,而水體字典必須寫在它包含的任何物體字典之前。


Points 點(diǎn)

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" 數(shù)組包含被用于創(chuàng)建障礙物的二維坐標(biāo)列表。每個(gè)數(shù)組包含兩個(gè)浮點(diǎn)型數(shù),對(duì)應(yīng)著地圖上的 X 坐標(biāo)和 Y 坐標(biāo)。

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.

第一個(gè)數(shù)字對(duì)應(yīng)橫坐標(biāo) X,越靠右的點(diǎn)其 X 坐標(biāo)值越大。第二個(gè)數(shù)字對(duì)應(yīng)縱坐標(biāo) Y,越靠上的點(diǎn)?Y 坐標(biāo)值越大。


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.
在勾畫障礙物時(shí),適合的工具十分重要。比較簡(jiǎn)單的設(shè)計(jì)方式便是使用矢量編輯器制作 SVG 格式的地圖,可用的工具包括 ,,或者 。畢竟我們只是畫一些簡(jiǎn)單的圖形,大多數(shù)應(yīng)用都能讓我們很快上手使用。
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.
強(qiáng)烈推薦把真實(shí)的地鐵線路圖或者不同分辨率衛(wèi)星照片當(dāng)作勾勒水體輪廓時(shí)的參考。
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 編輯器中,使用筆點(diǎn)擊并移動(dòng)鼠標(biāo)以畫出直線描繪形狀。請(qǐng)確保每一個(gè)物體的輪廓都是閉合的。此外,請(qǐng)不要使用編輯器中的曲率工具。所有線條都必須是線段。
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.
一般來(lái)說,不要讓地圖的游玩區(qū)域的寬和高超過4000和3000像素,且?SVG 編輯器中的左上角為原點(diǎn) [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.
請(qǐng)確保你的地圖中央為原點(diǎn) [0,0],這也會(huì)是最終游玩時(shí)屏幕的中心。在 和 中,界面的左上角才是原點(diǎn)。如此一來(lái),你需要將障礙物的位置進(jìn)行調(diào)整,以吻合編輯器的坐標(biāo)系統(tǒng)。
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.

當(dāng)你畫完障礙物后,將它保存為 .svg 后綴的文件,最好是 SVG 1.1 的格式。

Converting SVG to JSON Format 將 SVG 轉(zhuǎn)換為 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.
現(xiàn)在你需要使用文本編輯器(如 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 看起來(lái)應(yīng)該比較整齊。如果你正確地閉合了所有輪廓路徑,你就能看見它們組成的形狀。如果你標(biāo)記了它們,你還能搜到它們的標(biāo)記。你將會(huì)看到一個(gè)包含所有絕對(duì)坐標(biāo)的列表。
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.
如果你在任何形狀的描述中見到了字母,你可能是在創(chuàng)建它的時(shí)候用到了曲率。此外,如果形狀和大小不對(duì)勁,有可能是因?yàn)槭褂昧?strong>相對(duì)坐標(biāo)。這些問題的解決方法請(qǐng)參見附錄。
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:
將障礙物所有的點(diǎn)的坐標(biāo)復(fù)制到一個(gè)新文件中,并把它們改成游戲可以讀取的格式。具體步驟如下:

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

    刪除一個(gè)障礙物定義中所有的換行。所有的點(diǎn)都應(yīng)在同一行上,且被空格分開。每個(gè)點(diǎn)將包括被逗號(hào)分隔的?X 與 Y 坐標(biāo)值。

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

    將所有空格變成換行,使得每一行只有一個(gè)點(diǎn)的坐標(biāo)。

  3. 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àn)橛螒蛑猩戏绞秦?fù) Y 軸,調(diào)轉(zhuǎn)所有 Y 坐標(biāo)值的正負(fù)符號(hào)。

  4. 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!

    最后,將每一行上的點(diǎn)坐標(biāo)都用[方括號(hào)]包住,這樣就是 JSON 中的數(shù)組格式了!

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.
你也可以檢查看看是否有重復(fù)的點(diǎn),不過兩個(gè)挨著的重復(fù)坐標(biāo)也不會(huì)有影響障礙物正常加載。此外,因?yàn)檎系K物的輪廓都是閉合的,所有第一個(gè)點(diǎn)與最后一個(gè)點(diǎn)的坐標(biāo)也應(yīng)該是相同的。
Now just copy out your newly JSON-formatted list into the “points” array, and you have yourself an obstacle!

現(xiàn)在,你就可以把這些 JSON 列表放進(jìn)你的 "points" 數(shù)組里,你的障礙物就設(shè)置好了!



Obstacle Options 障礙選項(xiàng)

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" 決定該障礙物是水體還是島嶼,又或者是背景物體。水體應(yīng)使用 false 值,而背景和島嶼應(yīng)使用 true 值。

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

布爾值 "decoration" 決定該障礙物是否會(huì)檢測(cè)碰撞。

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,則游戲中線路通過該障礙物時(shí)不需要消耗隧道或橋梁。

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.

對(duì)于地圖中不會(huì)被越過的障礙物,或者不會(huì)生成車站的島嶼,你都可以將它們的 "decoration" 值設(shè)置為 true,這樣可以改善游戲性能并減少加載時(shí)間,尤其是輪廓包含很多點(diǎn)的障礙物。

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" 決定該障礙物是否在預(yù)覽圖中顯示。任何可見的水體或島嶼的此值都應(yīng)設(shè)置為 true。但將預(yù)覽范圍外的障礙物的此值設(shè)置為 false 可改善游戲性能并減少加載時(shí)間。

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" 值可以使障礙物的邊角變得圓潤(rùn)。將其設(shè)置為一個(gè)正浮點(diǎn)數(shù)值可以把鋒利的角變得更有弧度。

Setting "cornerRadius" to -1.0 disables corner rounding.

若將該值設(shè)置為 -1.0,則邊角不會(huì)發(fā)生變化。

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" 值是一個(gè)可以自行添加的字典。你可以為特定障礙物指定一種顏色。

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" 值十分特殊,只有地圖中存在多個(gè)水體時(shí)才需要添加該值。

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.

任何會(huì)檢測(cè)碰撞的島嶼都必須指明它所在的水體,而整型值 "parent" 起到這一作用。障礙物列表中第一個(gè)障礙物索引值為0,第二個(gè)為1,以此類推。島嶼的 "parent" 值必須和它對(duì)應(yīng)水體的索引數(shù)相等。如果不設(shè)置該值,則默認(rèn)使用第一個(gè)水體作為母體。

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

如果該值設(shè)置不正確,游戲畫面會(huì)出現(xiàn)明顯錯(cuò)誤,水體和島嶼會(huì)互相交錯(cuò)。

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

如果某一障礙物不能正確的填充進(jìn)預(yù)覽圖,其布爾變量 "fixPreview" 應(yīng)被設(shè)置為 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.

這種情況的通?,F(xiàn)象是預(yù)覽圖會(huì)把障礙物分割成若干部分,而不是一個(gè)聯(lián)通的物體。


由于字?jǐn)?shù)限制,第一部分到此為止


[迷你地鐵]自定義地圖創(chuàng)建指南(一)的評(píng)論 (共 條)

分享到微博請(qǐng)遵守國(guó)家法律
吉隆县| 林芝县| 清水县| 洪江市| 抚州市| 桐乡市| 日土县| 宜城市| 扶沟县| 胶州市| 北海市| 株洲县| 寿光市| 连平县| 招远市| 汝南县| 洞头县| 宝丰县| 绥滨县| 邹城市| 炎陵县| 新营市| 汉源县| 安福县| 闽清县| 汉川市| 秦皇岛市| 富民县| 安溪县| 射阳县| 乌拉特前旗| 博乐市| 南城县| 浙江省| 通化县| 象州县| 屏边| 鄢陵县| 中卫市| 乌拉特前旗| 临海市|