Skip to content

Instantly share code, notes, and snippets.

@tiernan
Created March 20, 2022 03:30
Show Gist options
  • Save tiernan/f2197c22f99d9bcafa519aa6be86beea to your computer and use it in GitHub Desktop.
Save tiernan/f2197c22f99d9bcafa519aa6be86beea to your computer and use it in GitHub Desktop.
Mini Metro JSON Schema Definitions for IDE's [INCOMPLETE!]
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://schemas.tiernanx.com/mini-metro/maps/achievements.schema.json",
"author": "Tiernan Cridland (tiernanc@gmail.com)",
"constributors": [ ],
"credits": [
"Mini Metro Workshop Guide by Dinosaur Polo Club"
],
"licenseType": "ISC",
"licenseText": "ISC License (ISC)\nCopyright 2002 Tiernan Cridland\n\nPermission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.\n\nTHE SOFTWARE IS PROVIDED “AS IS” AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.",
"copyright": "© Tiernan Cridland December 2020",
"version": "0.1",
"disclaimers": "Mini Metro, and Dinosaur Polo Club are a trademarks of its respected owner(s).",
"title": "Achievements List Object",
"description": "A list of achievements for a Mini-Metro mod map",
"definitions": {
"achievement": {
"description": "Achievement",
"defaultSnippets": [
{
"label": "Creates a score achievement",
"body": { "achievements": [ { "id": "${1:city-1}", "city": "${2:city}", "difficultyPriority": "^${3:0}", "type": "Score", "score": "^${4:500}", "customDescription": "${5:Reach a score of 500}", "icon": "${6:passenger}", "restrictions": [ "^$0" ] } ] }
},
{
"label": "Creates a day achievement",
"body": { "achievements": [ { "id": "${1:city-1}", "city": "${2:city}", "difficultyPriority": "^${3:0}", "type": "Day", "day": "^${4:35}", "customDescription": "${5:Reach day 35}", "icon": "${6:passenger}", "restrictions": [ "^$0" ] } ] }
}
],
"type": "object",
"properties": {
"id": {
"description": "Unique achievement ID (e.g. \"city-17\")",
"default": "city-17",
"examples": [ "caprica-1" ],
"type": "string",
"pattern": "^[a-z]+[a-z0-9-]+",
"minLength": 1
},
"city": {
"description": "Unique city ID (e.g. \"city\")",
"default": "city",
"examples": [ "caprica" ],
"type": "string",
"pattern": "^[a-z]+[a-z0-9]*$",
"minLength": 1
},
"difficultyPriority": {
"description": "Priority of achievment. 0 = lowest, 2 = highest",
"type": "integer",
"default": 0,
"maximum": 2,
"minimum": 0
},
"type": {
"description": "Type of challenge",
"default": "Score",
"type": "string",
"enum": [ "Score", "Day" ]
},
"score": {
"description": "Number of passengers delivered (Required if type is Score)",
"default": 500,
"type": "integer",
"minimum": 1
},
"day": {
"description": "Days passed (Required if type is Day).",
"default": 35,
"type": "integer",
"minimum": 3
},
"customDescription": {
"description": "Challenge description",
"examples": [ "Score 500 points with two lines on Casablanca." ],
"type": "string"
},
"icon": {
"description": "Icon to use with achievement",
"type": "string",
"enum": ["passenger", "line", "interchange", "crossing", "carriage", "locomotive"]
},
"restrictions": {
"description": "List of achievement restrictions",
"default": [],
"type": "array",
"items": {
"$ref": "#/definitions/restriction"
},
"minItems": 1
}
},
"required": [ "id", "city", "type", "customDescription", "icon", "restrictions" ],
"minProperties": 6,
"maxProperties": 8,
"oneOf": [
{
"properties": {
"type": { "const": "Score" }
},
"required": ["score"]
},
{
"properties": {
"type": { "const": "Day" }
},
"required": ["day"]
}
]
},
"restriction": {
"description": "Restriction",
"defaultSnippets": [
{
"label": "Creates a restriction template",
"body": { "type": "$1", "max": "^$2", "scope": "$3" }
},
{
"label": "Create example: Don’t use more than 6 carriages anywhere",
"body": {"type": "Carriage", "max": 6, "scope": "Global"}
},
{
"label": "Create example: Don’t use more than 3 locomotives on each line",
"body": {"type": "Locomotive", "max": 3, "scope": "Line"}
},
{
"label": "Create example: Don’t use more than one loop line in total",
"body": {"type": "Loop", "max": 1, "scope": "Global"}
},
{
"label": "Create example: Have at least one station connected to all lines",
"body": {"type": "Hub", "min": 1, "scope": "Global"}
},
{
"label": "Create example: Make every line a loop",
"body": {"type": "Loop", "min": 1, "scope": "Line"}
},
{
"label": "Create example: Don’t use any loops",
"body": {"type": "Loop", "max": 0, "scope": "Line"}
},
{
"label": "Create example: Have at most two lines with squares",
"body": {"type": "Line", "max": 2, "scope": "Square"}
},
{
"label": "Create example: Have only one line with any tunnels",
"body": {"type": "Line", "max": 1, "scope": "Crossing"}
},
{
"label": "Create example: Only use two tunnels in total",
"body": {"type": "Crossing", "max": 2, "scope": "Global"}
}
],
"type": "object",
"properties": {
"type": {
"description": "Restriction type (n.b. Hub counts the number of stations connected to all lines)",
"type": "string",
"enum": [ "Line", "Locomotive", "Carriage", "Crossing", "Loop", "Station", "Hub" ]
},
"max": {
"type": "integer",
"minimum": 1
},
"min": {
"type": "integer",
"minimum": 1
},
"scope": {
"type": "string",
"enum": [ "Global", "Line", "Square", "Crossing" ]
}
},
"required": [ "type", "scope" ],
"maxProperties": 3,
"minProperties": 3,
"not": {
"anyOf": [
{
"properties": {
"scope": { "const": "Global" },
"type": { "const": "Station" }
}
},
{
"properties": {
"scope": { "const": "Line" },
"type": { "enum": [ "Line", "Hub" ] }
}
},
{
"properties": {
"scope": { "const": "Square" },
"type": {
"not": { "const": "Line" }
}
}
},
{
"properties": {
"scope": { "const": "Crossing" },
"type": {
"not": { "const": "Line" }
}
}
},
{
"properties": {
"scope": { "const": "Crossing" }
},
"required": [ "min" ]
},
{
"required": [ "max", "min" ]
}
]
}
}
},
"default": { "achievments": [ { "id": "", "city": "", "difficultyPriority": "", "type": "", "customDescription": "", "icon": "", "restrictions": [ ] } ] },
"examples": [
{ "achievements": [ ] },
{ "achievments": [ { "id": "city-1", "city": "city", "difficultyPriority": 0, "type": "Score", "score": 500, "customDescription": "Score 500 points with only two lines on {City}.", "icon": "passenger", "restrictions": [ { "max": 2, "type": "Line", "scope": "Global" } ] } ] }
],
"defaultSnippets": [
{
"label": "Creates an achievement document with sample achievement",
"body": { "achievements": [ { "id": "${1:city-1}", "city": "${2:city}", "difficultyPriority": "^${3:0}", "type": "Score", "score": "^${4:500}", "customDescription": "${5:Reach a score of 500}", "icon": "${6:passenger}", "restrictions": [ "^$0" ] } ] }
}
],
"type": "object",
"properties": {
"achievements": {
"description": "List of achievements",
"default": [ { "id": "", "city": "", "difficultyPriority": "", "type": "", "customDescription": "", "icon": "", "restrictions": [ ] } ],
"examples": [
[ ],
[ { "id": "city-1", "city": "city", "difficultyPriority": 0, "type": "Score", "score": 500, "customDescription": "Score 500 points with only two lines on {City}.", "icon": "passenger", "restrictions": [ { "max": 2, "type": "Line", "scope": "Global" } ] } ]
],
"defaultSnippets": [
{
"label": "Creates the achievement list with template",
"body": [ { "id": "$1", "city": "$2", "difficultyPriority": "^$3", "type": "$4", "customDescription": "$5", "icon": "$6", "restrictions": [ ] } ]
}
],
"type": "array",
"items": {
"$ref": "#/definitions/achievement"
},
"minItems": 1
}
},
"required": [ "achievements" ]
}
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://schemas.tiernanx.com/mini-metro/maps/city.schema.json",
"author": "Tiernan Cridland (tiernanc@gmail.com)",
"constributors": [ ],
"credits": [
"Mini Metro Workshop Guide by Dinosaur Polo Club"
],
"licenseType": "ISC",
"licenseText": "ISC License (ISC)\nCopyright 2002 Tiernan Cridland\n\nPermission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.\n\nTHE SOFTWARE IS PROVIDED “AS IS” AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.",
"copyright": "© Tiernan Cridland December 2020",
"version": "0.1",
"disclaimers": "Mini Metro, and Dinosaur Polo Club are a trademarks of its respected owner(s).",
"title": "Map Parameters",
"description": "Mini Metro map definition",
"definitions": {
"objects": {
"asset": {
"description": "Allows customization of in game asset names"
},
"cityArea": {
"description": "Allows control over what type of stations spawn within the specified region of the map"
},
"line": {
"description": "Properties of the line"
},
"obstacle": {
"description": "Obstacle (e.g. a water body)",
"properties": {
"points": {
"description": "List of 2D points describing the objects geometry on the map",
"type":"array",
"items": {
"$ref": "#/definitions/types/point"
},
"minItems": 3
},
"visual": {
"description": "Whether to render the obstacle visible",
"default": true,
"type": "boolean"
},
"inverted": {
"description": "Whether to use water or background colour set (e.g. true makes the obstacle use the water colours specified for your theme)",
"default": false,
"type": "boolean"
},
"decoration": {
"title": "Decorative Object Flag",
"description": "Whether the obstacle has collision disabled (e.g. true marks the obstacle as decoration only and disables collision)",
"default": false,
"type": "boolean"
},
"inPreview": {
"description": "Whether the obstacle appears in the map preview",
"default": true,
"type": "boolean"
},
"cornerRadius": {
"description": "Any value about 0 will bevel corners. Use -1.0 to disable",
"type": "number",
"oneOf": [
{
"exclusiveMinimum": 0
},
{
"const": -1.0
}
]
},
"color": {
"$comment": "May change to common schema if more than one object found.",
"$ref": "https://schemas.tiernanx.com/mini-metro/maps/theme.schema.json#/definitions/colorSet",
"description": "Obstacle colour set"
},
"parent": {
"description": "For use with nesting obstacles: index number of the parent obstacle",
"default": 1,
"type": "integer",
"minimum": 0
},
"fixPreview": {
"description": "Enable if your obstacle is displaying incorrectly in the map preview. If this does not fix the issue, you may have to change the \"inPreview\" property",
"default": false,
"type": "boolean"
}
},
"required": [ "points", "visual", "inverted", "decoration", "inPreview", "cornerRadius" ]
},
"station": {
"description": "Fixed station (n.b. Use to populate the map initially)"
},
"transition": {
"description": "Animation paramters for pausing game/exiting"
}
},
"types": {
"point": {
"description": "X,Y value list of map coordinates",
"type": "array",
"allOf": [
{
"items": {
"type": "number",
"maximum": 5000.0,
"minimum": -5000.0
}
},
{
"items": [
{
"title": "X Coordinate"
},
{
"title": "Y Coordinate"
}
]
}
],
"maxItems": 2,
"minItems": 2
}
}
},
"type": "object",
"properties": {
"id": {
"title": "Internal City ID",
"description": "Unique city identifier (n.b. CANNOT conflict with vanilla city names; should be lowercased version of the city name with no spaces or punctuation, but may include numbers: e.g. \"caprica\")",
"default": "cityid",
"examples": [ "caprica", "sebridge", "cuross", "cardiff" ],
"type": "string",
"pattern": "^[a-z]+[a-z0-9-]*$",
"minLength": 1,
"not": {
"anyOf": [
{
"enum": [
"auckland",
"barcelona",
"berlin",
"cairo",
"canberra",
"guangzhou",
"hongkong",
"istanbul",
"lagos",
"london",
"london1960",
"melbourne",
"montreal",
"mumbai",
"nyc",
"nyc1972",
"osaka",
"paris",
"paris1937",
"sanfrancisco",
"santiago",
"saopaulo",
"seoul",
"shanghai",
"singapore",
"stockholm",
"stpetersburg",
"washingtondc"
]
}
]
}
},
"customName": {
"description": "Unique city name (Real or fictional: e.g. \"Cardiff\", \"Caprica\")",
"default": "City Name",
"examples": [ "Caprica", "Sebridge", "Cuross", "Cardiff" ],
"type": "string",
"minLength": 1
},
"customDescription": {
"description": "Description of city (n.b. its best to subtly suggest major obstacles, or limited resources here)",
"default": "Redesign Tampa’s public transport network in this fast growing city.",
"examples": [ "Keep Caprica’s Mag-Lev rails alive." ],
"type": "string",
"minLength": 1
},
"customLocalName": {
"description": "(Optional) Name formatted in local language of this city (e.g. \"Каприка\")",
"default": "Город",
"examples": [ "Каприка" ],
"type": "string",
"minLength": 1
},
"customLocalNameLocale": {
"title": "Language Code of Local Name (Optional)",
"description": "ISO 639-1 language code of local name if it uses non English characters (n.b. Not all CJK languages can be displayed: You must test if using these!)",
"default": "sv",
"examples": [ "aa", "ab", "ae", "af", "ak", "am", "an", "ar", "as", "av", "ay", "az", "ba", "be", "bg", "bh", "bi", "bm", "bn", "bo", "br", "bs", "ca", "ce", "ch", "co", "cr", "cs", "cu", "cv", "cy", "da", "de", "dv", "dz", "ee", "el", "en", "eo", "es", "et", "eu", "fa", "ff", "fi", "fj", "fo", "fr", "fy", "ga", "gd", "gl", "gn", "gu", "gv", "ha", "he", "hi", "ho", "hr", "ht", "hu", "hy", "hz", "ia", "id", "ie", "ig", "ii", "ik", "io", "is", "it", "iu", "ja", "jv", "ka", "kg", "ki", "kj", "kk", "kl", "km", "kn", "ko", "kr", "ks", "ku", "kv", "kw", "ky", "la", "lb", "lg", "li", "ln", "lo", "lt", "lu", "lv", "mg", "mh", "mi", "mk", "ml", "mn", "mr", "ms", "mt", "my", "na", "nb", "nd", "ne", "ng", "nl", "nn", "no", "nr", "nv", "ny", "oc", "oj", "om", "or", "os", "pa", "pi", "pl", "ps", "pt", "qu", "rm", "rn", "ro", "ru", "rw", "sa", "sc", "sd", "se", "sg", "si", "sk", "sl", "sm", "sn", "so", "sq", "sr", "ss", "st", "su", "sv", "sw", "ta", "te", "tg", "th", "ti", "tk", "tl", "tn", "to", "tr", "ts", "tt", "tw", "ty", "ug", "uk", "ur", "uz", "ve", "vi", "vo", "wa", "wo", "xh", "yi", "yo", "za", "zh", "zu" ],
"type": "string",
"pattern": "[a-z]{2}(_[A-Z]{2})?",
"maxLength": 5,
"minLength": 2
},
"crossingStyle": {
"description": "Crossing type (n.b. For stylistic purposes only. One of \"Bridge\", or \"Tunnel\")",
"default": "Bridge",
"examples": [ "Tunnel" ],
"type": "string",
"enum": [ "Bridge", "Tunnel" ]
},
"lineCount": {
"description": "Number of transit lines in the city (n.b. There must be at least as many color definitions in theme.json#/lineColors list. Vanilla maps use 5-7.)",
"default": 6,
"examples": [ 5, 7 ],
"type": "integer",
"minimum": 1,
"maximum": 20
},
"audioLoadoutId": {
"title": "Audio Loudout ID (Optional)",
"description": "Change the audio to that of a vanilla city by using that city’s ID (n.b. All known vanilla city IDs are in the examples. City IDs are lowercased versions of the city name with no spaces: e.g. \"sanfrancisco\", \"saintpetersburg\")",
"default": "london",
"examples": [
"auckland",
"barcelona",
"berlin",
"cairo",
"canberra",
"guangzhou",
"hongkong",
"istanbul",
"lagos",
"london",
"london1960",
"melbourne",
"montreal",
"mumbai",
"nyc",
"nyc1972",
"osaka",
"paris",
"paris1937",
"sanfrancisco",
"santiago",
"saopaulo",
"seoul",
"shanghai",
"singapore",
"stockholm",
"stpetersburg",
"washingtondc"
],
"type": "string",
"minLength": 1
},
"theme": {
"$comment": "Regex restriction matches that in theme.schema.json.",
"title": "Theme ID",
"description": "Unique theme ID matching ID in theme.json (e.g. \"ThemeName\")",
"default": "ThemeName",
"examples": [ "Dnieper" ],
"type": "string",
"pattern": "^[a-zA-Z0-9]+$",
"minLength": 1
},
"obstacles": {
"description": "Map obstacles such as water bodies.",
"type": "array",
"items": {
"$ref": "#/definitions/objects/obstacle"
}
},
"origin": {
"$ref": "#/definitions/types/point",
"description": "Origin coordinates in map",
"default": [ 0, 0 ]
},
"zoom": {
"description": "Map zoom level parammeters",
"type": "object",
"properties": {
}
},
"startArea": {
"description": "Parameters to describe camera starting area.",
"type": "object",
"properties": {
}
},
"cityAreas": {
"description": "",
"type": "array",
"items": {
"$ref": "#/definitions/objects/cityArea"
}
},
"stationSpawns": {
"description": "Station spawning parameters",
"type": "object",
"properties": {
}
},
"passengerSpawnScale": {
"description": "",
"type": "number"
},
"stationCapacity": {
"description": "",
"type": "integer"
},
"interchangeCapacity": {
"description": "",
"type": "integer"
},
"upgrades": {
"description": "Upgrades distribution paramters (includes starting assets)",
"type": "object",
"properties": {
}
},
"assetNames": {
"description": "",
"type": "array",
"items": {
"$ref": "#/definitions/objects/asset"
}
},
"trainDefinition": {
"$comment": "Pattern is presumtuous at the moment.",
"description": "",
"type": "string",
"anyOf": [
{
"enum": [ "default", "small" ]
},
{
"minLength": 1,
"pattern": "^[a-zA-Z]+[a-zA-Z0-9]*$"
}
]
},
"stations": {
"description": "",
"type": "array",
"items": {
"$ref": "#/definitions/objects/station"
}
},
"lines": {
"description": "",
"type": "array",
"items": {
"$ref": "#/definitions/objects/line"
}
},
"transitions": {
"description": "",
"type": "array",
"items": {
"$ref": "#/definitions/objects/transition"
}
},
"preview": {
"description": "Properties of the map preview in game",
"type": "object",
"properties": {
"window": {
"type": "object",
"properties": {
"position": {
"$ref": "#/definitions/types/point",
"description": "Coordinates of the bottom left edge of the preview",
"default": [ -250, -175 ]
},
"size": {
"description": "Size (width, height) of preview window in map",
"default": 800,
"type": "integer"
}
}
},
"hidePermanentLines": {
"description": "Whether to hide permanent lines from preview window",
"default": true,
"type": "boolean"
}
},
"required": [ "window", "hidePermanentLines" ]
}
},
"required": [ "id", "customName", "customDescription", "crossingStyle", "lineCount", "theme", "obstacles", "origin", "zoom" ]
}
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://schemas.tiernanx.com/mini-metro/maps/steam.schema.json",
"author": "Tiernan Cridland (tiernanc@gmail.com)",
"constributors": [ ],
"credits": [
"Mini Metro Workshop Guide by Dinosaur Polo Club"
],
"licenseType": "ISC",
"licenseText": "ISC License (ISC)\nCopyright 2002 Tiernan Cridland\n\nPermission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.\n\nTHE SOFTWARE IS PROVIDED “AS IS” AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.",
"copyright": "© Tiernan Cridland December 2020",
"version": "0.1",
"disclaimers": "Mini Metro, Dinosaur Polo Club, Steam, and Steam Workshop are a trademarks of its respected owner(s).",
"title": "Steam Workshop Metadata",
"description": "Properties for steam workshop submission",
"default": { "publishFieldId": "", "itemTitle": "", "itemDescription": "", "itemTags": "", "itemChangelog": "" },
"examples": [
{ },
{ "publishFieldId": "", "itemTitle": "Title", "itemDescription": "Description", "itemTags": "tags,list", "itemChangelog": "#.# Fixed some bug" }
],
"defaultSnippets": [
{
"label": "Creates a Steam document template",
"body": { "publishFieldId": "", "itemTitle": "${1:Title}", "itemDescription": "${2:Description}", "itemTags": "${3:tag,secondtag}", "itemChangelog": "${4:#.# Fixed some bug}" }
}
],
"type": "object",
"properties": {
"publishFieldId": {
"title": "Steam Workshop ID",
"description": "Unique Steam Workshop ID (Leave blank if new (\"\"); never modify if set)",
"default": "",
"type": "string",
"readOnly": true,
"pattern": "^[0-9]*$",
"minLength": 0
},
"itemTitle": {
"title": "Map Title",
"description": "Title to be used in Steam Workshop (n.b. This should use Title Case)",
"type": "string",
"minLength": 1
},
"itemDescription": {
"title": "Map Description",
"description": "Long description of your map",
"type": "string",
"minLength": 1
},
"itemTags": {
"title": "Tags",
"description": "Comma seperated lowercase list of tags (e.g. \"cairo,egypt,africa,difficult\"",
"type": "string",
"pattern": "^[a-z0-9-]*?(,[a-z0-9-]+)*$",
"minLength": 0
},
"itemChangelog": {
"title": "Change Log",
"description": "Recent changes to your mod (e.g. \"1.1 Fixed some bug\"",
"type": "string",
"minLength": 0
}
},
"required": [ "publishFieldId", "itemTitle", "itemDescription", "itemTags", "itemChangelog" ],
"additionalProperties": false
}
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://schemas.tiernanx.com/mini-metro/maps/theme.schema.json",
"author": "Tiernan Cridland (tiernanc@gmail.com)",
"constributors": [ ],
"credits": [
"Mini Metro Workshop Guide by Dinosaur Polo Club"
],
"licenseType": "ISC",
"licenseText": "ISC License (ISC)\nCopyright 2002 Tiernan Cridland\n\nPermission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.\n\nTHE SOFTWARE IS PROVIDED “AS IS” AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.",
"copyright": "© Tiernan Cridland December 2020",
"version": "0.1",
"disclaimers": "Mini Metro, and Dinosaur Polo Club are a trademarks of its respected owner(s).",
"title": "Map Colour Theme",
"description": "Colour values to stylise a Mini Metro map",
"definitions": {
"types": {
"color": {
"title": "Color",
"description": "Set of decimal RGB values from 0 to 255\ne.g. [ 68, 51, 51 ]",
"type": "array",
"allOf": [
{
"items": {
"description": "Value of 0-255",
"type": "integer",
"maximum": 255,
"minimum": 0
}
},
{
"items": [
{
"title": "Red"
},
{
"title": "Green"
},
{
"title": "Blue"
}
]
}
],
"maxItems": 3,
"minItems": 3
}
},
"dayColor": {
"$ref": "#/definitions/types/color",
"title": "Default Color",
"description": "Default color as a set of decimal RGB values\ne.g. [ 68, 51, 51 ]",
"examples": [
[ 68, 51, 51 ],
[ 47, 79, 79 ]
]
},
"nightColor": {
"$ref": "#/definitions/types/color",
"title": "Night Mode Color",
"description": "Night Mode color as a set of decimal RGB values\ne.g. [ 242, 242, 242 ]",
"examples": [
[ 242, 242, 242 ],
[ 255, 239, 213 ]
]
},
"outlineWidth": {
"default": 4.0,
"examples": [ -1.0, 2.0, 3.0 ],
"type": "number",
"oneOf": [
{
"exclusiveMinimum": 0
},
{
"const": -1.0
}
]
},
"colorSet": {
"type": "object",
"properties": {
"day": {
"$ref": "#/definitions/dayColor"
},
"night": {
"$ref": "#/definitions/nightColor"
}
},
"required": [ "day" ]
},
"outlinedColorSet": {
"default": { "internal": {}, "outline": {}, "outlineWidth": 4.0, "previewOutlineWidth": -1.0 },
"type": "object",
"properties": {
"internal": {
"$ref": "#/definitions/colorSet",
"description": "Object’s internal color"
},
"outline": {
"$ref": "#/definitions/colorSet",
"description": "Object’s outline color"
},
"outlineWidth": {
"$ref": "#/definitions/outlineWidth",
"description": "Width (stroke) of outline\nn.b. Use -1.0 to disable"
},
"previewOutlineWidth": {
"$ref": "#/definitions/outlineWidth",
"description": "Width (stroke) of outline in preview\nn.b. Use -1.0 to disable"
}
},
"required": [ "internal", "outline", "outlineWidth" ]
}
},
"defaultSnippets": [
{
"label": "Create document template",
"body": { "name": "${1:ThemeName}", "backgroundColor": { "day": [ 255, 239, 213 ], "night": [ 47, 79, 79 ] }, "peepColor": { "day": [ 68, 51, 51 ], "night": [ 242, 242, 242 ] }, "waterColor": { "internal": { "day": [ 228, 236, 244 ], "night": [ 228, 236, 244 ] }, "outline": { "day": [ 228, 236, 244 ], "night": [ 228, 236, 244 ] }, "outlineWidth": -1.0, "previewOutlineWidth": -1.0 }, "stationColor": { "internal": { "day": [255, 255, 255 ], "night": [53, 49, 54 ] }, "outline": { "day": [ 10, 4, 4 ], "night": [ 242, 242, 242 ] }, "outlineWidth": 4.0 }, "lineColors": [ { "day": [ 221, 37, 21 ] }, { "day": [ 37, 129, 196 ] }, { "day": [ 53, 171, 82 ] }, { "day": [ 240, 171, 0 ] }, { "day": [ 0, 191, 255 ] }, { "day": [ 255, 221, 85 ] } ] }
}
],
"type": "object",
"properties": {
"name": {
"$comment": "Regex restriction matches that in city.schema.json.",
"description": "Unique theme ID (e.g. \"ThemeName\")",
"default": "ThemeName",
"examples": [ "Dnieper" ],
"type": "string",
"pattern": "^[a-zA-Z0-9]+$",
"minLength": 1
},
"backgroundColor": {
"$ref": "#/definitions/colorSet",
"description": "Map background colour set",
"default": {
"day": [ 255, 255, 255 ],
"night": [36, 32, 33]
},
"properties": {
"day": {
"$ref": "#/definitions/dayColor",
"default": [ 255, 255, 255 ],
"examples": [
[ 255, 239, 213 ]
]
},
"night": {
"$ref": "#/definitions/nightColor",
"default": [36, 32, 33],
"examples": [
[ 47, 79, 79 ]
]
}
}
},
"peepColor": {
"$ref": "#/definitions/colorSet",
"description": "Commuter icon colour set",
"properties": {
"day": {
"$ref": "#/definitions/dayColor",
"default": [68, 51, 51]
},
"night": {
"$ref": "#/definitions/nightColor",
"default": [242, 242, 242]
}
}
},
"waterColor": {
"allOf": [
{
"$ref": "#/definitions/outlinedColorSet",
"description": "Water colour set"
},
{
"properties": {
"internal": {
"default": { "day": { "default": [ 228, 236, 244 ] }, "night": { "default": [ 228, 236, 244 ] } },
"properties": {
"day": {
"default": [ 228, 236, 244 ]
},
"night": {
"default": [ 228, 236, 244 ]
}
}
},
"outline": {
"default": { "day": { "default": [ 228, 236, 244 ] }, "night": { "default": [ 228, 236, 244 ] } },
"properties": {
"day": {
"default": [ 228, 236, 244 ]
},
"night": {
"default": [ 228, 236, 244 ]
}
}
}
}
}
]
},
"stationColor": {
"allOf": [
{
"$ref": "#/definitions/outlinedColorSet",
"description": "Station colour set"
},
{
"properties": {
"internal": {
"properties": {
"day": {
"default": [255, 255, 255 ]
},
"night": {
"default": [53, 49, 54 ]
}
}
},
"outline": {
"properties": {
"day": {
"default": [ 10, 4, 4 ]
},
"night": {
"default": [ 242, 242, 242 ]
}
},
"required": [ "day" ]
}
}
}
]
},
"lineColors": {
"description": "Colours of transit lines (n.b. Minimum number of items must match number of lines in map)",
"default": [
{ "day": [ 221, 37, 21 ] },
{ "day": [ 37, 129, 196 ] },
{ "day": [ 53, 171, 82 ] },
{ "day": [ 240, 171, 0 ] },
{ "day": [ 0, 191, 255 ] },
{ "day": [ 255, 221, 85 ] }
],
"type": "array",
"items": {
"$ref": "#/definitions/colorSet",
"defaultSnippets": [
{
"label": "Create line template",
"body": { "day": [ ] }
},
{
"label": "Create deep red line",
"body": { "day": [ 221, 37, 21 ] }
},
{
"label": "Create stone blue line",
"body": { "day": [ 37, 129, 196 ] }
},
{
"label": "Create medium green line",
"body": { "day": [ 53, 171, 82 ] }
},
{
"label": "Create orange line",
"body": { "day": [ 240, 171, 0 ] }
},
{
"label": "Create cyan line",
"body": { "day": [ 0, 191, 255 ] }
},
{
"label": "Create yellow line",
"body": { "day": [ 255, 221, 85 ] }
},
{
"label": "Create magenta line",
"body": { "day": [ 255, 51, 255 ] }
},
{
"label": "Create violet line",
"body": { "day": [ 153, 102, 204 ] }
},
{
"label": "Create brown line",
"body": { "day": [ 153, 51, 51 ] }
},
{
"label": "Create purple line",
"body": { "day": [ 51, 0, 255 ] }
},
{
"label": "Create chartreuse line",
"body": { "day": [ 204, 204, 51 ] }
},
{
"label": "Create pastel cyan line",
"body": { "day": [ 151, 255, 255 ] }
}
]
},
"minItems": 1,
"maxItems": 20
}
},
"required": [ "name", "backgroundColor", "peepColor", "waterColor", "stationColor", "lineColors" ],
"additionalProperties": false
}
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://schemas.tiernanx.com/mini-metro/maps/trains.schema.json",
"author": "Tiernan Cridland (tiernanc@gmail.com)",
"constributors": [ ],
"credits": [
"Mini Metro Workshop Guide by Dinosaur Polo Club"
],
"licenseType": "ISC",
"licenseText": "ISC License (ISC)\nCopyright 2002 Tiernan Cridland\n\nPermission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.\n\nTHE SOFTWARE IS PROVIDED “AS IS” AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.",
"copyright": "© Tiernan Cridland December 2020",
"version": "0.1",
"disclaimers": "Mini Metro, and Dinosaur Polo Club are a trademarks of its respected owner(s).",
"title": "Custom Train Definitions",
"description": "Definitions for locomotive types available on map",
"definitions": {
"locomotive": {
"title": "Locomotive",
"description": "Describes locomotive speed and capacity properties",
"type": "object",
"properties": {
"type": {
"title": "Type",
"description": "Locomotive type of \"Locomotive\", \"Shinkansen\", or \"Tram\" (n.b. exactly one of each type must exist in the locomotives list)",
"type": "string",
"enum": [ "Locomotive", "Shinkansen", "Tram" ]
},
"speed": {
"title": "Maximum Speed",
"description": "Maximum speed of locomotive",
"default": 360,
"examples": [ 250, 480 ],
"type": "integer",
"minimum": 1
},
"acceleration": {
"title": "Acceleration",
"description": "Acceleration speed of locomotive\nn.b. 1000 is the highest value in the vanilla game",
"default": 120,
"examples": [ 180, 1000 ],
"type": "integer",
"minimum": 1
},
"deceleration": {
"title": "Deceleration",
"description": "Deceleration speed of locomotive\nn.b. 1000 is the highest value in the vanilla game",
"default": 300,
"examples": [ 300, 1000 ],
"type": "integer",
"minimum": 1
},
"capacity": {
"title": "Commuter Capacity",
"description": "Commuter capacity of locomotive and attached carriages\nn.b. If omitted will default to the root capacity value (#/capacity)",
"default": 6,
"examples": [ 4, 8 ],
"type": "integer",
"minimum": 1
}
},
"required": [ "type", "speed", "acceleration", "deceleration" ],
"additionalProperties": false
}
},
"defaultSnippets": [
{
"label": "Create document template",
"description": "Creates a train template",
"body": { "id": "${1:CustomTrains}", "capacity": "^${2:6}", "locomotives": "^$0" }
},
{
"label": "Create document template with complete example",
"description": "Creates a train template",
"body": { "id": "${1:CustomTrains}", "capacity": "^${2:6}", "locomotives": [ { "type": "Locomotive", "speed": "^${3:360}", "acceleration": "^${4:120}", "deceleration": "^${5:300}", "capacity": "^${6:6}" }, { "type": "Shinkansen", "speed": "^${7:480}", "acceleration": "^${8:180}", "deceleration": "^${9:300}", "capacity": "^${10:8}" }, { "type": "Tram", "speed": "^${11:250}", "acceleration": "^${12:1000}", "deceleration": "^${13:1000}", "capacity": "^${14:4}" } ] }
}
],
"type": "object",
"properties": {
"id": {
"title": "Train Definitions ID",
"description": "Unique train definition file identifier\ne.g. \"CustomTrains\", \"DieselPower\"\nn.b. Cannot be \"default\", or \"small\"",
"default": "CustomTrains",
"examples": [ "XTransit" ],
"type": "string",
"minLength": 1,
"pattern": "^[a-zA-Z]+[a-zA-Z0-9]*$",
"not": {
"enum": [ "default", "small" ]
}
},
"capacity": {
"title": "Commuter Capacity",
"description": "Default capacity of locomotives and attached carriages\nn.b. Used if capacity is not specified in a locomotive definition",
"default": 6,
"examples": [ 4, 8 ],
"type": "integer",
"minimum": 1
},
"locomotives": {
"title": "Locomotive Types",
"description": "Speed and passenger properties of the locomotives your map uses.\nn.b. In-game iconography matches the locomotive type and cannot be changed\nn.b. Exactly one each \"Locomotive\", \"Shinkansen\", and \"Tram\" type must exist in this list regardless if used in `city.json`.\nn.b. This schema will only validate if these items are defined in the exact order listed above",
"default": [ { "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 } ],
"defaultSnippets": [
{
"label": "Create all required locomotives",
"body": [ { "type": "Locomotive", "speed": "^${1:360}", "acceleration": "^${2:120}", "deceleration": "^${3:300}", "capacity": "^${4:6}" }, { "type": "Shinkansen", "speed": "^${5:480}", "acceleration": "^${6:180}", "deceleration": "^${7:300}", "capacity": "^${8:8}" }, { "type": "Tram", "speed": "^${9:250}", "acceleration": "^${10:1000}", "deceleration": "^${11:1000}", "capacity": "^${12:4}" } ]
}
],
"type": "array",
"allOf": [
{
"items": {
"$ref": "#/definitions/locomotive",
"$comment": "Blanking title and description allows them to be overridden below",
"title": "",
"description": ""
}
},
{
"items": [
{
"title": "Locomotive",
"description": "Properties of the default locomotive (steam/diesel/standard train)",
"defaultSnippets": [
{
"label": "Create default standard locomotive",
"body": { "type": "Locomotive", "speed": "^${1:360}", "acceleration": "^${2:120}", "deceleration": "^${3:300}", "capacity": "^${4:6}" }
}
],
"properties": {
"type": {
"default": "Locomotive",
"const": "Locomotive"
}
}
},
{
"title": "Shinkansen",
"description": "Properties of Shinkansen style locomotive (bullet train)",
"defaultSnippets": [
{
"label": "Create default shinkansen",
"body": { "type": "Shinkansen", "speed": "^${1:480}", "acceleration": "^${2:180}", "deceleration": "^${3:300}", "capacity": "^${4:8}" }
}
],
"properties": {
"type": {
"default": "Shinkansen",
"const": "Shinkansen"
}
}
},
{
"title": "Tram",
"description": "Properties of Tram style locomotive (light rail, cable cars, trolleys)",
"defaultSnippets": [
{
"label": "Create default tram",
"body": { "type": "Tram", "speed": "^${1:250}", "acceleration": "^${2:1000}", "deceleration": "^${3:1000}", "capacity": "^${4:4}" }
}
],
"properties": {
"type": {
"default": "Tram",
"const": "Tram"
}
}
}
]
}
],
"maxItems": 3,
"minItems": 3
}
},
"required": [ "id", "capacity", "locomotives" ],
"additionalProperties": false
}
{
"folders": [
{
"path": "."
}
],
"settings": {
"json.schemaDownload.enable": false,
"json.schemas": [
{
"fileMatch": [
"achievements.json"
],
"url": "./schemas/achievements.schema.json"
},
{
"fileMatch": [
"city.json"
],
"url": "./schemas/city.schema.json"
},
{
"fileMatch": [
"steam.json"
],
"url": "./schemas/steam.schema.json"
},
{
"fileMatch": [
"theme.json"
],
"url": "./schemas/theme.schema.json"
},
{
"fileMatch": [
"trains.json"
],
"url": "./schemas/trains.schema.json"
}
],
"files.trimTrailingWhitespace": true,
"[json]": {
"editor.quickSuggestions": {
"strings": true
},
"editor.suggest.insertMode": "replace"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment