Browse Source

Updated RMG template schema

Ivan Savenko 2 years ago
parent
commit
9f894d6ca0
2 changed files with 59 additions and 21 deletions
  1. 9 3
      config/schemas/template.json
  2. 50 18
      docs/modders/Random_Map_Template.md

+ 9 - 3
config/schemas/template.json

@@ -99,7 +99,6 @@
 				"type":
 				{
 					"type" : "string",
-					"additionalProperties" : false,
 					"enum" : ["wide", "fictive", "repulsive"]
 				}
 			}
@@ -107,7 +106,6 @@
 		"waterContent" :
 		{
 			"enum" : ["none", "normal", "islands"],
-			"additionalProperties" : false,
 			"type" : "string"
 		}
 	},
@@ -118,29 +116,37 @@
 		"required" : ["zones", "connections", "minSize", "maxSize", "players"],
 		
 		"players" : {
+			"description" : "Number of players that will be present on map (human or AI)",
 			"type": "string"
 		},
 		"cpu" : {
+			"description" : "Optional, number of AI-only players",
 			"type": "string"
 		},
 		"minSize" : {
+			"description" : "Minimal size of the map, e.g. 'm+u' or '120x120x1",
 			"type": "string"
 		},
 		"maxSize" : {
+			"description" : "Maximal size of the map, e.g. 'm+u' or '120x120x1",
 			"type": "string"
 		},
-		"description" : {
+		"name" : {
+			"description" : "Optional name - useful to have several template variations with same name",
 			"type": "string"
 		},
 		"zones" : {
+			"description" : "List of named zones",
 			"type" : "object",
 			"additionalProperties" : {"$ref" : "#/definitions/zone"	}
 		},
 		"connections" : {
+			"description" : "List of connections between zones",
 			"type" : "array",
 			"items" : {"$ref" : "#/definitions/connection"}	
 		},
 		"allowedWaterContent" : {
+			"description" : "Optional parameter allowing to prohibit some water modes. All modes are allowed if parameter is not specified",
 			"type" : "array",
 			"items" : {"$ref" : "#/definitions/waterContent"}
 		}

+ 50 - 18
docs/modders/Random_Map_Template.md

@@ -6,9 +6,8 @@
 /// Unique template name
 "Triangle" : 
 {
-	//optional name - useful to have several template variations with same name (since 0.99)
+	//Optional name - useful to have several template variations with same name
 	"name" : "Custom template name",
-	"description" : "Brief description of template, recommended setting or rules".
 
 	/// Minimal and maximal size of the map. Possible formats:
 	/// Size code: s, m, l or xl for size with optional suffix "+u" for underground
@@ -19,7 +18,7 @@
 	/// Number of players that will be present on map (human or AI)
 	"players" : "2-4",
 
-	/// Number of AI-only players
+	/// Optional, number of AI-only players
 	"cpu" : "2",
 
 	///Optional parameter allowing to prohibit some water modes. All modes are allowed if parameter is not specified
@@ -37,9 +36,9 @@
 		{ "a" : "zoneA", "b" : "zoneB", "guard" : 5000, "road" : "false" },
 		{ "a" : "zoneA", "b" : "zoneC", "guard" : 5000, "road" : "random" },
 		{ "a" : "zoneB", "b" : "zoneC", "type" : "wide" }
-        //"type" can be "guarded" (default), "wide", "fictive" or "repulsive"
-        //"wide" connections have no border, or guard. "fictive" and "repulsive" connections are virtual -
-        //they do not create actual path, but only attract or repulse zones, respectively
+		//"type" can be "guarded" (default), "wide", "fictive" or "repulsive"
+		//"wide" connections have no border, or guard. "fictive" and "repulsive" connections are virtual -
+		//they do not create actual path, but only attract or repulse zones, respectively
 	]
 }
 ```
@@ -48,38 +47,71 @@
 
 ``` javascript
 {
-	"type" : "playerStart", //"cpuStart" "treasure" "junction"
-	"size" : 2, //relative size of zone
-	"owner" : 1, //player owned this zone
+	// Type of this zone. Possible values are:
+	// "playerStart", "cpuStart", "treasure", "junction"
+	"type" : "playerStart", 
+
+	// relative size of zone
+	"size" : 2, 
+	
+	// index of player that owns this zone
+	"owner" : 1, 
+	
+	// castles and towns owned by player in this zone
 	"playerTowns" : {
 		"castles" : 1
-		//"towns" : 1
+		"towns" : 1
 	},
+	
+	// castles and towns that are neutral on game start in this zone
 	"neutralTowns" : {
 		//"castles" : 1
 		"towns" : 1
 	},
+	
+	// if true, all towns generated in this zone will belong to the same faction
 	"townsAreSameType" : true,
-	"monsters" : "normal", //"weak" "strong", "none" - All treasures will be unguarded
+	
+	//"weak" "strong", "none" - All treasures will be unguarded
+	"monsters" : "normal", 
 
-	"terrainTypes" : [ "sand" ], //possible terrain types. All terrains will be available if not specified
-	"bannedTerrains" : ["lava", "asphalt"] //optional
+	//possible terrain types. All terrains will be available if not specified
+	"terrainTypes" : [ "sand" ], 
+	
+	//optional, list of explicitly banned terrain types
+	"bannedTerrains" : ["lava", "asphalt"] 
 
-	"matchTerrainToTown" : false, //if true, terrain for this zone will match native terrain of player faction
+	// if true, terrain for this zone will match native terrain of player faction. Used only in owned zones
+	"matchTerrainToTown" : false, 
+	
+	// Mines will have same configuration as in linked zone
 	"minesLikeZone" : 1,
+	
+	// Treasures will have same configuration as in linked zone
 	"treasureLikeZone" : 1
+	
+	// Terrain type will have same configuration as in linked zone
 	"terrainTypeLikeZone" : 3
 
-	"allowedMonsters" : ["inferno", "necropolis"] //factions of monsters allowed on this zone
-	"bannedMonsters" : ["fortress", "stronghold", "conflux"] //These monsers will never appear in the zone
-	"allowedTowns" : ["castle", "tower", "rampart"] //towns allowed on this terrain
-	"bannedTowns" : ["necropolis"] //towns will never spawn on this terrain
+	// factions of monsters allowed on this zone
+	"allowedMonsters" : ["inferno", "necropolis"] 
+	
+	// These monsers will never appear in the zone
+	"bannedMonsters" : ["fortress", "stronghold", "conflux"]
+	
+	// towns allowed on this terrain
+	"allowedTowns" : ["castle", "tower", "rampart"] 
+	
+	// towns will never spawn on this terrain
+	"bannedTowns" : ["necropolis"] 
 
+	// List of mines that will be added to this zone
 	"mines" : {
 		"wood" : 1,
 		"ore" : 1,
 	},
 
+	// List of treasures that will be placed in this zone
 	"treasure" : [
 		{
 			"min" : 2100,