Difference between revisions of "Random map template"
From VCMI Project Wiki
(Imported info from RMG.json. Please add proper descriptions in zone format) |
(→Zone format) |
||
(14 intermediate revisions by 3 users not shown) | |||
Line 7: | Line 7: | ||
* Jebus Cross | * Jebus Cross | ||
==Template format== | ==Template format== | ||
− | |||
<syntaxhighlight lang="javascript"> | <syntaxhighlight lang="javascript"> | ||
/// Unique template name | /// Unique template name | ||
"Triangle" : | "Triangle" : | ||
{ | { | ||
+ | //optional name - useful to have several template variations with same name (since 0.99) | ||
+ | "name" : "Custom template name", | ||
+ | "description" : "Brief description of template, recommended setting or rules". | ||
+ | |||
/// Minimal and maximal size of the map. Possible formats: | /// Minimal and maximal size of the map. Possible formats: | ||
/// Size code: s, m, l or xl for size with optional suffix "+u" for underground | /// Size code: s, m, l or xl for size with optional suffix "+u" for underground | ||
Line 19: | Line 22: | ||
/// Number of players that will be present on map (human or AI) | /// Number of players that will be present on map (human or AI) | ||
− | "players" : "4", | + | "players" : "2-4", |
/// Number of AI-only players | /// Number of AI-only players | ||
"cpu" : "2", | "cpu" : "2", | ||
+ | |||
+ | ///Optional parameter allowing to prohibit some water modes. All modes are allowed if parameter is not specified | ||
+ | "allowedWaterContent" : ["none", "normal", "islands"] | ||
/// List of named zones, see below for format description | /// List of named zones, see below for format description | ||
Line 33: | Line 39: | ||
"connections" : | "connections" : | ||
[ | [ | ||
− | { "a" : "zoneA", "b" : "zoneB", "guard" : 5000 }, | + | { "a" : "zoneA", "b" : "zoneB", "guard" : 5000, "road" : "false" }, |
− | { "a" : "zoneA", "b" : "zoneC", "guard" : 5000 }, | + | { "a" : "zoneA", "b" : "zoneC", "guard" : 5000, "road" : "random" }, |
− | { "a" : "zoneB", "b" : "zoneC", " | + | { "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 | ||
] | ] | ||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
+ | |||
== Zone format == | == Zone format == | ||
<syntaxhighlight lang="javascript"> | <syntaxhighlight lang="javascript"> | ||
{ | { | ||
− | "type" : "playerStart", //"cpuStart" "treasure" | + | "type" : "playerStart", //"cpuStart" "treasure" "junction" |
− | "size" : 2, | + | "size" : 2, //relative size of zone |
− | "owner" : 1, | + | "owner" : 1, //player owned this zone |
"playerTowns" : { | "playerTowns" : { | ||
"castles" : 1 | "castles" : 1 | ||
+ | //"towns" : 1 | ||
}, | }, | ||
"neutralTowns" : { | "neutralTowns" : { | ||
+ | //"castles" : 1 | ||
"towns" : 1 | "towns" : 1 | ||
}, | }, | ||
"townsAreSameType" : true, | "townsAreSameType" : true, | ||
− | "monsters" : "normal", | + | "monsters" : "normal", //"weak" "strong", "none" - All treasures will be unguarded |
− | "terrainTypes" : [ "sand" ], | + | "terrainTypes" : [ "sand" ], //possible terrain types. All terrains will be available if not specified |
− | " | + | "bannedTerrains" : ["lava", "asphalt"] //optional |
+ | "matchTerrainToTown" : false, //if true, terrain for this zone will match native terrain of player faction | ||
"minesLikeZone" : 1, | "minesLikeZone" : 1, | ||
"treasureLikeZone" : 1 | "treasureLikeZone" : 1 | ||
"terrainTypeLikeZone" : 3 | "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 | ||
"mines" : { | "mines" : { |
Latest revision as of 06:55, 7 August 2023
Ideally, template format should be 100% compatible with OH3 format and bring additional improvements.
List of currently available templates
- Analogy
- Upgrade
- Golden Ring
- Unfair Game
- Jebus Cross
Template format
/// Unique template name
"Triangle" :
{
//optional name - useful to have several template variations with same name (since 0.99)
"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
/// Numeric size, e.g. 120x120x1 (width x height x depth). Note that right now depth can only be 0 or 1
"minSize" : "m",
"maxSize" : "xl+u",
/// Number of players that will be present on map (human or AI)
"players" : "2-4",
/// Number of AI-only players
"cpu" : "2",
///Optional parameter allowing to prohibit some water modes. All modes are allowed if parameter is not specified
"allowedWaterContent" : ["none", "normal", "islands"]
/// List of named zones, see below for format description
"zones" :
{
"zoneA" : { ... },
"zoneB" : { ... },
"zoneC" : { ... }
},
"connections" :
[
{ "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
]
}
Zone format
{
"type" : "playerStart", //"cpuStart" "treasure" "junction"
"size" : 2, //relative size of zone
"owner" : 1, //player owned this zone
"playerTowns" : {
"castles" : 1
//"towns" : 1
},
"neutralTowns" : {
//"castles" : 1
"towns" : 1
},
"townsAreSameType" : true,
"monsters" : "normal", //"weak" "strong", "none" - All treasures will be unguarded
"terrainTypes" : [ "sand" ], //possible terrain types. All terrains will be available if not specified
"bannedTerrains" : ["lava", "asphalt"] //optional
"matchTerrainToTown" : false, //if true, terrain for this zone will match native terrain of player faction
"minesLikeZone" : 1,
"treasureLikeZone" : 1
"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
"mines" : {
"wood" : 1,
"ore" : 1,
},
"treasure" : [
{
"min" : 2100,
"max": 3000,
"density" : 5
}
...
]
}