Game definition jsons - Initialization jsons

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

Game definition jsons - Initialization jsons

Post by Stratego (dev) » Thu Sep 28, 2017 8:01 am

A new file where there will be some settings, the first is MINIMAL/FEW/MANY starting units definition

here the sample for AOW, i think everything is obvious seeing the sample

Code: Select all


{
   "defStrings":[
		{"key":"IMG_CROSSHAIR", 			"val":"64_crosshair.png"},
		{"key":"IMG_BALL", 				"val":"64_ball.png"}, 
		{"key":"IMG_SELECTION", 			"val":"64_selection.png"}, 
		{"key":"IMG_HUD_MAPEDIT_RANGED", 		"val":"unit_ger_artillery_lefh18_howitzer.png"},
		{"key":"IMG_HUD_MAPEDIT_BUILDING", 		"val":"mapeditor_buildings.png"},
		{"key":"IMG_HUD_MAPEDIT_CLOSECOMBAT", 		"val":"unit_rus_tank_t34.png"},
		{"key":"IMG_HUD_MAPEDIT_SHIPS", 		"val":"unit_us_ship_fletcher.png"},
		{"key":"IMG_HUD_MAPEDIT_GREY_RANGED", 		"val":"mapeditor_ranged_off.png"},
		{"key":"IMG_HUD_MAPEDIT_GREY_BUILDING", 	"val":"mapeditor_buildings_off.png"},
		{"key":"IMG_HUD_MAPEDIT_GREY_CLOSECOMBAT", 	"val":"mapeditor_closecombat_off.png"},
		{"key":"IMG_HUD_MAPEDIT_GREY_SHIPS", 		"val":"mapeditor_ships_off.png"}
   ],
   "defIntegers":[
		{"key":"MAPEDITOR_DEFAULT_UNIT_ID", 		"val":"105"}
   ],
   "defBools":[
		{"key":"GRAPHICS_MOSTLY_RIGHT", 		"val":true}
   ],
   
   "trnDailyGiftUnitTypes": ["UNIT_GER_INF_ENGINEERS", "UNIT_US_INF_ENGINEERS", "UNIT_JP_INF_ENGINEERS", "UNIT_RU_INF_ENGINEERS", "UNIT_GB_INF_ENGINEERS"],
   
   "initialUnitSpawning": [
      { "trnRaceID": "RACE_US", "mapStartingUnits": "MINIMAL", "trnUnitTypesToPlace": ["UNIT_US_INF_INFANTRY"] },
      { "trnRaceID": "RACE_US", "mapStartingUnits": "FEW",     "trnUnitTypesToPlace": ["UNIT_US_INF_INFANTRY","UNIT_US_VEHICLE_JEEP"] },
      { "trnRaceID": "RACE_US", "mapStartingUnits": "MANY",    "trnUnitTypesToPlace": ["UNIT_US_INF_INFANTRY", "UNIT_US_INF_INFANTRY", "UNIT_US_VEHICLE_JEEP", "UNIT_US_SHERMAN"] },
      
      { "trnRaceID": "RACE_GER", "mapStartingUnits": "MINIMAL", "trnUnitTypesToPlace": ["UNIT_GER_INF_INFANTRY"] },
      { "trnRaceID": "RACE_GER", "mapStartingUnits": "FEW",     "trnUnitTypesToPlace": ["UNIT_GER_INF_INFANTRY","UNIT_GER_VEHICLE_KUBELWAGEN"] },
      { "trnRaceID": "RACE_GER", "mapStartingUnits": "MANY",    "trnUnitTypesToPlace": ["UNIT_GER_INF_INFANTRY", "UNIT_GER_INF_INFANTRY", "UNIT_GER_VEHICLE_KUBELWAGEN", "UNIT_GER_PANZER_III"] },
      
      { "trnRaceID": "RACE_RU", "mapStartingUnits": "MINIMAL", "trnUnitTypesToPlace": ["UNIT_RU_INF_INFANTRY"] },
      { "trnRaceID": "RACE_RU", "mapStartingUnits": "FEW",     "trnUnitTypesToPlace": ["UNIT_RU_INF_INFANTRY","UNIT_RU_VEHICLE_BA_64"] },
      { "trnRaceID": "RACE_RU", "mapStartingUnits": "MANY",    "trnUnitTypesToPlace": ["UNIT_RU_INF_INFANTRY", "UNIT_RU_INF_INFANTRY", "UNIT_RU_VEHICLE_BA_64", "UNIT_RU_T34"] },
      
      { "trnRaceID": "RACE_AXIS", "mapStartingUnits": "MINIMAL", "trnUnitTypesToPlace": ["UNIT_GER_INF_INFANTRY"] },
      { "trnRaceID": "RACE_AXIS", "mapStartingUnits": "FEW",     "trnUnitTypesToPlace": ["UNIT_GER_INF_INFANTRY","UNIT_GER_VEHICLE_KUBELWAGEN"] },
      { "trnRaceID": "RACE_AXIS", "mapStartingUnits": "MANY",    "trnUnitTypesToPlace": ["UNIT_GER_INF_INFANTRY", "UNIT_GER_INF_INFANTRY", "UNIT_GER_VEHICLE_KUBELWAGEN", "UNIT_GER_PANZER_III"] },
      
      { "trnRaceID": "RACE_ALLIES", "mapStartingUnits": "MINIMAL", "trnUnitTypesToPlace": ["UNIT_US_INF_INFANTRY"] },
      { "trnRaceID": "RACE_ALLIES", "mapStartingUnits": "FEW",     "trnUnitTypesToPlace": ["UNIT_US_INF_INFANTRY","UNIT_RU_VEHICLE_BA_64"] },
      { "trnRaceID": "RACE_ALLIES", "mapStartingUnits": "MANY",    "trnUnitTypesToPlace": ["UNIT_US_INF_INFANTRY","UNIT_RU_INF_INFANTRY","UNIT_US_VEHICLE_JEEP", "UNIT_RU_T34"] }
   ]
}



Boolean: "GRAPHICS_MOSTLY_RIGHT":
meaningall unit images are looking right (and all exceptional directions are set in unit jsons in "uiDefinition":"imageFacingDirection")
false: means they are mostly looking left.

Integer: DEFINE_UNIT_BIG_HP_VALUE, DEFINE_UNIT_BIG_POWER_VALUE,DEFINE_UNIT_SMALL_HP_VALUE, DEFINE_UNIT_SMALL_POWER_VALUE
if spell is "RESISTED_BY_HP"/"RESISTED_BY_POWER" type spell, than it will resisted based on hp or power and these boundary values
if hp/power is < small value than no resistance, if hp/power is > big value than 100% resistance, in between propotional to the value and the small-big range.

trnDailyGiftUnitTypes
Here you can define which unit types to prefer as daily gift (if not yet owned) eg. in AOS the Castle + trebuchet should be the firsts.
(the order in the list is also matters, first will be first offered and so on)

Stratego (dev)
Site Admin
Posts: 9983
Joined: Fri Apr 25, 2014 9:28 pm

Re: Game definition jsons - Initialization jsons

Post by Stratego (dev) » Wed Dec 12, 2018 11:25 pm

new items can be set (special images)

Stratego (dev)
Site Admin
Posts: 9983
Joined: Fri Apr 25, 2014 9:28 pm

Re: Game definition jsons - Initialization jsons

Post by Stratego (dev) » Mon Aug 19, 2019 9:28 am

new bolean alue can be set:
{"key":"GRAPHICS_MOSTLY_RIGHT", "val":true}

meaningall unit images are looking right (and all exceptional directions are sen in unit jsons in "uiDefinition":"imageFacingDirection")
false: means they are mostly looking left.

Stratego (dev)
Site Admin
Posts: 9983
Joined: Fri Apr 25, 2014 9:28 pm

Re: Game definition jsons - Initialization jsons

Post by Stratego (dev) » Fri Jan 24, 2020 8:16 pm

new values:
{"key":"DEFINE_UNIT_BIG_HP_VALUE", "val":"50"},
{"key":"DEFINE_UNIT_BIG_POWER_VALUE", "val":"20"},
{"key":"DEFINE_UNIT_SMALL_HP_VALUE", "val":"10"},
{"key":"DEFINE_UNIT_SMALL_POWER_VALUE", "val":"5"}

Stratego (dev)
Site Admin
Posts: 9983
Joined: Fri Apr 25, 2014 9:28 pm

Re: Game definition jsons - Initialization jsons

Post by Stratego (dev) » Thu Mar 05, 2020 2:42 pm

new option:

"trnDailyGiftUnitTypes": ["UNIT_GER_INF_ENGINEERS", "UNIT_US_INF_ENGINEERS", "UNIT_JP_INF_ENGINEERS", "UNIT_RU_INF_ENGINEERS", "UNIT_GB_INF_ENGINEERS"],

trnDailyGiftUnitTypes
Here you can define which unit types to offer as daily gift (if not yet owned) eg. in AOS the Castle + trebuchet should be the firsts.

Post Reply

Return to “Game Definition .JSON”