Game definition jsons - Categories and terrains

Learn the .json format
used to define characteristics of units and other game elements
Post Reply
Stratego (dev)
Site Admin
Posts: 15741
Joined: Fri Apr 25, 2014 9:28 pm

Game definition jsons - Categories and terrains

Post by Stratego (dev) »

In the consts.json you can define the
- categories (including category icons and special categories for help file and mapeditor),
- category encapsulations
- category - effect category relations
- tile types
- their groupings

Categories

There are special category prefixes
- DOC_ : means categories to filter units in mapedit and in help section, these also not appear for users (eg. in unit stasheet)
- HIDDEN_: categories that you dont want to appear for users (eg. in unit stasheet)

Code: Select all

{
	"categories": [
		{"id": 1001111,       "idString": "U_MY_CAT"}
	],
	"catAss": [
		{"catIdString": "U_MY_CAT",          "toCatIdStrings": ["U_BURNABLE","U_ZOMBIES"]}
	],
	"catModifierRels": [
		{"catIdString": "U_ELVES",              	"toCatIdStrings": ["M_ELVEN_BUFFS"]},
		{"catIdString": "U_GOBLINS",            	"toCatIdStrings": ["M_GOBLIN_BUFFS"]},		
		{"catIdString": "U_ZOMBIES",            	"toCatIdStrings": ["M_UNDEAD_MODIFIERS"]},
		{"catIdString": "U_SKELETONS",         	 	"toCatIdStrings": ["M_UNDEAD_MODIFIERS"]},
		{"catIdString": "U_ZOMBIES",            	"toCatIdStrings": ["M_ZOMBIE_MODIFIERS"]},
		{"catIdString": "U_BURNABLE",           	"toCatIdStrings": ["M_BURNING"]},
		{"catIdString": "U_ARCHERS",            	"toCatIdStrings": ["M_ARCHER_MODIFIERS"]},
		{"catIdString": "U_ANTI_ARCHER_RANGED", 	"toCatIdStrings": ["M_ARCHER_MODIFIERS"]},
		{"catIdString": "U_WAR_UNITS",          	"toCatIdStrings": ["M_WAR_UNIT_BUFFS"]},
		{"catIdString": "U_NON_STRUCTURE_UNITS",	"toCatIdStrings": ["M_NON_STRUCTURE_UNIT_BUFFS"]},
		{"catIdString": "U_BUILDINGS",          	"toCatIdStrings": ["M_STRUCTURE_UNIT_BUFFS"]},
		{"catIdString": "U_MELEE",              	"toCatIdStrings": ["M_MELEE_MODIFIERS"]},
		{"catIdString": "U_INFANTRY_MELEE_ANTI_MOUNTED","toCatIdStrings": ["M_MELEE_MODIFIERS"]},
		{"catIdString": "U_FLESH_AND_BLOOD",    	"toCatIdStrings": ["M_FLESH_AND_BLOOD_MODS"]}
	],
	"tileTypes": [
		{"id": 100,    "idString": "TERRAIN_WATER",          "jsonNaming": "water",     "rgb": "#5c8eb1",  "tileType": "WATER",       "isWater": true},
		{"id": 110,    "idString": "TERRAIN_DEEP_WATER",     "jsonNaming": "dwater",    "rgb": "#42667f",  "tileType": "DWATER",      "isWater": true},
		{"id": 210,    "idString": "TERRAIN_HILL_CLIFF",     "jsonNaming": "cliff",     "rgb": "#808080",  "tileType": "HILL",        "isWater": false},
		{"id": 215,    "idString": "TERRAIN_HILL_CLIFF_SNOW","jsonNaming": "cliffsnow", "rgb": "#aaaaaa",  "tileType": "HILL",        "isWater": false},
		{"id": 150,    "idString": "TERRAIN_OBSTACLE",       "jsonNaming": "obst",      "rgb": "#808080",  "tileType": "OBSTACLE",    "isWater": false},
		{"id": 180,    "idString": "TERRAIN_SNOW",           "jsonNaming": "snow",      "rgb": "#f0f0f0",  "tileType": "SNOW",        "isWater": false},
		{"id": 170,    "idString": "TERRAIN_DESERT",         "jsonNaming": "desert",    "rgb": "#c1ad3b",  "tileType": "DESERT",      "isWater": false},
		{"id": 160,    "idString": "TERRAIN_ROCK",           "jsonNaming": "rock",      "rgb": "#808080",  "tileType": "ROCK",        "isWater": false},
		{"id": 190,    "idString": "TERRAIN_ROAD",           "jsonNaming": "road",      "rgb": "#ae9b75",  "tileType": "ROAD",        "isWater": false},
		{"id": 120,    "idString": "TERRAIN_WOOD",           "jsonNaming": "wood",      "rgb": "#396a18",  "tileType": "WOOD",        "isWater": false},
		{"id": 130,    "idString": "TERRAIN_CLEARGROUND",    "jsonNaming": "ground",    "rgb": "#738f2c",  "tileType": "CLEARGROUND", "isWater": false},
		{"id": 200,    "idString": "TERRAIN_BRIDGE",         "jsonNaming": "bridge",    "rgb": "#ae9b75",  "tileType": "BRIDGE",      "isWater": false},
		{"id": 140,    "idString": "TERRAIN_HILL",           "jsonNaming": "hill",      "rgb": "#808080",  "tileType": "HILL",        "isWater": false}
	],
	"tilePairs": [
		{"id": 10032,    "idString": "TERRAINS_FOREST_ONLY_WALKABLE",    "toTileIdStrings": ["TERRAIN_WOOD"]},
		{"id": 10020,    "idString": "TERRAINS_SAILABLE",                "toTileIdStrings": ["TERRAIN_WATER", "TERRAIN_DEEP_WATER", "TERRAIN_BRIDGE"], "isWater": true},
		{"id": 10031,    "idString": "TERRAINS_MOUNTAINWALKABLE",        "toTileIdStrings": ["TERRAIN_HILL", "TERRAIN_HILL_CLIFF", "TERRAIN_HILL_CLIFF_SNOW"]},
		{"id": 10000,    "idString": "TERRAINS_PLAINSWALKABLE",          "toTileIdStrings": ["TERRAIN_CLEARGROUND", "TERRAIN_DESERT", "TERRAIN_SNOW", "TERRAIN_ROAD", "TERRAIN_BRIDGE"]},
		{"id": 10010,    "idString": "TERRAINS_FORESTWALKABLE",          "toTileIdStrings": ["TERRAIN_CLEARGROUND", "TERRAIN_DESERT", "TERRAIN_SNOW", "TERRAIN_ROAD", "TERRAIN_BRIDGE", "TERRAIN_WOOD"]},
		{"id": 10030,    "idString": "TERRAINS_FLYABLE",                 "toTileIdStrings": ["TERRAIN_WATER", "TERRAIN_DEEP_WATER", "TERRAIN_CLEARGROUND", "TERRAIN_DESERT", "TERRAIN_SNOW", "TERRAIN_ROAD", "TERRAIN_BRIDGE", "TERRAIN_HILL", "TERRAIN_HILL_CLIFF", "TERRAIN_HILL_CLIFF_SNOW", "TERRAIN_OBSTACLE", "TERRAIN_ROCK", "TERRAIN_WOOD"]}
	]
	
}


the json for AOW at 2017.09.23
here:
consts.json
(8.88 KiB) Downloaded 193 times
Special categories
for mapeditor and help section

you have additional options when defining categories:
"textureID": contains the texture ID in the graphics json.
"specs": a few options you canset currently:

Code: Select all

            SHOW_AS_FILTER,               // set this to use as filter category on help and mapeditor unit selector
            SHOW_AS_FILTER_N_OTHERS       // set this to contain all other units too that were not categorized to SHOW_AS_FILTER categories (eg. unit json editor forgot to)
example lines from age of galaxy:

Code: Select all

	{"idString": "DOC_INFANTRY", 		"isDocAndOrder":1,    "specs":["SHOW_AS_FILTER"], "textureID":"TEXTURE_STIM"}, 
	{"idString": "DOC_TANKS", 		"isDocAndOrder":2,      "specs":["SHOW_AS_FILTER"], "textureID":"TEXTURE_CURVABLE_HANDGUNS"}, 
	{"idString": "DOC_AA_ARTILLERY", 	"isDocAndOrder":3,  "specs":["SHOW_AS_FILTER"], "textureID":"TEXTURE_LASER_BEAM_AT"},
	{"idString": "DOC_PLANES", 		"isDocAndOrder":4,      "specs":["SHOW_AS_FILTER"], "textureID":"TEXTURE_CONVERT"}, 
	{"idString": "DOC_SHIPS", 		"isDocAndOrder":5,      "specs":["SHOW_AS_FILTER"], "textureID":"TEXTURE_TELEPORT"}, 
	{"idString": "DOC_BUILDING", 		"isDocAndOrder":6,    "specs":["SHOW_AS_FILTER"], "textureID":"TEXTURE_SONIC_BOOST"}, 	
  {"idString": "DOC_SPACE", 		"isDocAndOrder":7,      "specs":["SHOW_AS_FILTER"], "textureID":"TEXTURE_JETPACK"}, 
  {"idString": "DOC_OTHERS", 		"isDocAndOrder":8,      "specs":["SHOW_AS_FILTER", "SHOW_AS_FILTER_N_OTHERS"], "textureID":"TEXTURE_ACTION_EMP_GRENADE"}, 

Terrain Affinity setting

you can set which terrain causes what affect to units on it.

You can set it in consts.json.

int his form:

Code: Select all

  
  "terrainAffects":{
    "affectList":[ 
      {"terrainTypeIdStrings":["TERRAIN_HILL"], "trnEffects":["EFFECT_TERRAIN_HILL"], "trnAffectedUnits":{ "categories":["U_INFANTRY"]}, "trnRequires":{"unitTypes":["TECH_COMUFLAGE"]}}
    ]
  }
  
where
- affectList: list here the affinity definitions (list)
in one definition line:
- terrainTypeIdStrings: The terrain type you are defining
- trnEffects: the list of effect names to apply (can be morem than one)
- trnAffectedUnits: which unit(s) should be checked and the effect(s) to be applied to, youcan give by categories like in unit jsons.
- trnRequires: list of techs needed to be invented by player to take this effect on his/her units from this terrain - can be omitted meanin every player will get it
Stratego (dev)
Site Admin
Posts: 15741
Joined: Fri Apr 25, 2014 9:28 pm

Re: Game definition jsons - Categories and terrains

Post by Stratego (dev) »

AOW current categories are in first post of this thread.
Stratego (dev)
Site Admin
Posts: 15741
Joined: Fri Apr 25, 2014 9:28 pm

Re: Game definition jsons - Categories and terrains

Post by Stratego (dev) »

AOF categories listed.
User avatar
godOfKings
Posts: 3302
Joined: Fri Sep 22, 2017 4:50 pm

Re: Game definition jsons - Categories and terrains

Post by godOfKings »

where is the list of aos categories?
There is no place for false kings here, only those who proves themselves to b the true kings of legend, or serves under me

For I watch over this world looking for those worthy to become kings, and on the way get rid of the fakes and rule over the fools
Stratego (dev)
Site Admin
Posts: 15741
Joined: Fri Apr 25, 2014 9:28 pm

Re: Game definition jsons - Categories and terrains

Post by Stratego (dev) »

they are not in json, but here they are (in first post)
User avatar
godOfKings
Posts: 3302
Joined: Fri Sep 22, 2017 4:50 pm

Re: Game definition jsons - Categories and terrains

Post by godOfKings »

As long as I know they exist and r identified by the game engine :)
There is no place for false kings here, only those who proves themselves to b the true kings of legend, or serves under me

For I watch over this world looking for those worthy to become kings, and on the way get rid of the fakes and rule over the fools
Stratego (dev)
Site Admin
Posts: 15741
Joined: Fri Apr 25, 2014 9:28 pm

Re: Game definition jsons - Categories and terrains

Post by Stratego (dev) »

- trnRequires: list of techs needed to be invented by player to take this effect on his/her units from this terrain - can be omitted meanin every player will get it

"terrainAffects":{
"affectList":[
{"terrainTypeIdStrings":["TERRAIN_HILL"], "trnEffects":["EFFECT_TERRAIN_HILL"], "trnAffectedUnits":{ "categories":["U_INFANTRY"]}, "trnRequires":{"unitTypes":["TECH_COMUFLAGE"]}}
]
}
Stratego (dev)
Site Admin
Posts: 15741
Joined: Fri Apr 25, 2014 9:28 pm

Re: Game definition jsons - Categories and terrains

Post by Stratego (dev) »

new option to restructure the filter categories in mapeditor / help section

in all alternatives i started earlier to set categories like DOC_INFANTRY and such so DOC_* for all units and techs, those were ment to prepare for this feature, i hope it still exists in all alternatives and all units/techs still have such setting - if so by puttin 4-5 lines in consts.json will show the categories the new way.


Special categories
for mapeditor and help section

you have additional options when defining categories:
"textureID": contains the texture ID in the graphics json.
"specs": a few options you canset currently:

Code: Select all

            SHOW_AS_FILTER,               // set this to use as filter category on help and mapeditor unit selector
            SHOW_AS_FILTER_N_OTHERS       // set this to contain all other units too that were not categorized to SHOW_AS_FILTER categories (eg. unit json editor forgot to)
example lines from age of galaxy:

Code: Select all

	{"idString": "DOC_INFANTRY", 		"isDocAndOrder":1,    "specs":["SHOW_AS_FILTER"], "textureID":"TEXTURE_STIM"}, 
	{"idString": "DOC_TANKS", 		"isDocAndOrder":2,      "specs":["SHOW_AS_FILTER"], "textureID":"TEXTURE_CURVABLE_HANDGUNS"}, 
	{"idString": "DOC_AA_ARTILLERY", 	"isDocAndOrder":3,  "specs":["SHOW_AS_FILTER"], "textureID":"TEXTURE_LASER_BEAM_AT"},
	{"idString": "DOC_PLANES", 		"isDocAndOrder":4,      "specs":["SHOW_AS_FILTER"], "textureID":"TEXTURE_CONVERT"}, 
	{"idString": "DOC_SHIPS", 		"isDocAndOrder":5,      "specs":["SHOW_AS_FILTER"], "textureID":"TEXTURE_TELEPORT"}, 
	{"idString": "DOC_BUILDING", 		"isDocAndOrder":6,    "specs":["SHOW_AS_FILTER"], "textureID":"TEXTURE_SONIC_BOOST"}, 	
  {"idString": "DOC_SPACE", 		"isDocAndOrder":7,      "specs":["SHOW_AS_FILTER"], "textureID":"TEXTURE_JETPACK"}, 
  {"idString": "DOC_OTHERS", 		"isDocAndOrder":8,      "specs":["SHOW_AS_FILTER", "SHOW_AS_FILTER_N_OTHERS"], "textureID":"TEXTURE_ACTION_EMP_GRENADE"}, 

Midonik
Posts: 5325
Joined: Mon Sep 05, 2016 5:27 pm
Location: Poland

Re: Game definition jsons - Categories and terrains

Post by Midonik »

Great, I always wondered what the DOC_ things were for.
Support new AoS variant, Age of Galaxy: http://ageofstrategy.net/viewforum.php? ... 608408ebc8
All help will be welcome.
User avatar
L4cus
Posts: 2358
Joined: Fri Jan 31, 2020 7:51 pm
Location: Perú

Re: Game definition jsons - Categories and terrains

Post by L4cus »

Question! can an unit have two or more of those special categories?
i would like to have categories for unit type and for eras...so an infantry unit would have: DOC_INFANTRY and DOC_ERA_1
Extra ecclesiam nulla salus...
AOD, a new variant...
viewforum.php?f=230
Stratego (dev)
Site Admin
Posts: 15741
Joined: Fri Apr 25, 2014 9:28 pm

Re: Game definition jsons - Categories and terrains

Post by Stratego (dev) »

yes it can!
User avatar
L4cus
Posts: 2358
Joined: Fri Jan 31, 2020 7:51 pm
Location: Perú

Re: Game definition jsons - Categories and terrains

Post by L4cus »

GOOD!
Extra ecclesiam nulla salus...
AOD, a new variant...
viewforum.php?f=230
Stratego (dev)
Site Admin
Posts: 15741
Joined: Fri Apr 25, 2014 9:28 pm

Re: Game definition jsons - Categories and terrains

Post by Stratego (dev) »

added information:

There are special category prefixes
- DOC_ : means categories to filter units in mapedit and in help section, these also not appear for users (eg. in unit stasheet)
- HIDDEN_: categories that you dont want to appear for users (eg. in unit stasheet)
User avatar
L4cus
Posts: 2358
Joined: Fri Jan 31, 2020 7:51 pm
Location: Perú

Re: Game definition jsons - Categories and terrains

Post by L4cus »

if i make a bonus with HIDDEN prefixe then the bonus is no shown?
Extra ecclesiam nulla salus...
AOD, a new variant...
viewforum.php?f=230
Stratego (dev)
Site Admin
Posts: 15741
Joined: Fri Apr 25, 2014 9:28 pm

Re: Game definition jsons - Categories and terrains

Post by Stratego (dev) »

yes, so dont do that :)
same true for DOC_
User avatar
Endru1241
Posts: 2717
Joined: Fri Sep 11, 2015 8:43 am
Location: Poland

Re: Game definition jsons - Categories and terrains

Post by Endru1241 »

In other words DOC_ are meant as a duplicate, an additional category only for purposes of filters.
HIDDEN_ are for categories only used by AI logic, that could be too out of game style or confusing for players.
Age of Strategy design leader
User avatar
L4cus
Posts: 2358
Joined: Fri Jan 31, 2020 7:51 pm
Location: Perú

Re: Game definition jsons - Categories and terrains

Post by L4cus »

so now we can have those AFFECTED_BY_ARMOR_LVL_1 category without being seing?
Extra ecclesiam nulla salus...
AOD, a new variant...
viewforum.php?f=230
User avatar
Endru1241
Posts: 2717
Joined: Fri Sep 11, 2015 8:43 am
Location: Poland

Re: Game definition jsons - Categories and terrains

Post by Endru1241 »

We could, but I believe it needs to be visible as one of the more needed information.
HIDDEN_ example is HIDDEN_CHEAP category - designed to be used as a counter for some units (AI would prefer producing these units).
Or training categories assigned to buildings (they have a list of produced units anyway).
Age of Strategy design leader
Stratego (dev)
Site Admin
Posts: 15741
Joined: Fri Apr 25, 2014 9:28 pm

Re: Game definition jsons - Categories and terrains

Post by Stratego (dev) »

what endru menitons are the "bestAgainsMe*" settings in json that the AI uses.
User avatar
L4cus
Posts: 2358
Joined: Fri Jan 31, 2020 7:51 pm
Location: Perú

Re: Game definition jsons - Categories and terrains

Post by L4cus »

Do "DOC_SOMETHING" categories work for techs?
Extra ecclesiam nulla salus...
AOD, a new variant...
viewforum.php?f=230
Stratego (dev)
Site Admin
Posts: 15741
Joined: Fri Apr 25, 2014 9:28 pm

Re: Game definition jsons - Categories and terrains

Post by Stratego (dev) »

not yet, but eventually they will, so yes, set some categories to techs too. (howe ver you dont need to set them to be SHOW_AS_FILTER yet)

currently all techs is shown regardless of filter status (not nice though)
User avatar
L4cus
Posts: 2358
Joined: Fri Jan 31, 2020 7:51 pm
Location: Perú

Re: Game definition jsons - Categories and terrains

Post by L4cus »

interesting! some categories like eras for clasificaction could work...
Extra ecclesiam nulla salus...
AOD, a new variant...
viewforum.php?f=230
Post Reply

Return to “Game Definition .JSON”