I thought about posting this in the modding system thread but decided to make a new thread because the post is so long, I hope that was the right decision. If not, I can post in the other thread and this can be deleted.
Here is a proposal for a format for creature configs. I joined the settings from cr_sounds.json, cranim.txt, creature_backgrounds.json, creatures.json and zcrtrait.txt. I did not include the creature experience setings because I don’t really know what they do. They should be easy to add to the format.
The example is the Pikeman. The commented out settings are not needed for the pikeman but I included them so that the format is complete. Many settings have default values so that they don’t need to be specified. The format is also very self-documenting (read verbose… :))
Many creatures can be specified in such a file. I propose that files with creatures are called .creature.json. Then it is easy to see that the format is json (good for syntax highlighting) and the content are creatures (good for using the right parser).
A couple of comments/questions:
- What is amm (min, max)? In the code it has something to do with random numbers.
- horde growth is for the building in the town, correct?
- I think turret shooter should be set in the town config, then a modder could set different shooters for different turrets.
- It would be possible to set a different background for every creature, default would be the faction background.
- I chose a different syntax for removing abilities (put a minus sign before the name). The current syntax “add_ability”/“remove_ability” is also ok.
- I think that arguments for abilities should be reworked to have different numbers and types of arguments for each ability. This would give more flexibility and make the format easier to understand. It is easy to change this format to use the current argument system.
- Another good thing is that the format makes it possible to have many files with creatures. The current .txt files use the order of the creatures for ids (horrible for modding). Smaller files with only the creatures from one faction would be easier to understand.
{
"Pikeman" : // "id" of creature, remove numerical ids from configs for better modding
{
"names" :
{
"singular" : "Pikeman",
"plural" : "Pikemen"
},
"level" : 1,
"faction" : "Castle", // default none, "neutral"
"upgrades" : "Halberdier", // default none, this is an "id"
"cost" :
{
// "Wood" : 0, // default 0
// "Mercury" : 0, // default 0
// "Ore" : 0, // default 0
// "Sulfur" : 0, // default 0
// "Crystal" : 0, // default 0
// "Gems" : 0, // default 0
"Gold" : 60 // default 0
},
"fightValue" : 100,
"aiValue" : 80,
"growth" : 14,
// "hordeGrowth" : 0, // default 0 // for the town building?
"hitPoints" : 10,
"speed" : 4,
"attack" : 4,
"defence" : 5,
"damage" : // or just "damage" : 2
{
"min" : 1,
"max" : 3
},
// "shots" : 0, // default 0
// "spellPoints" : 0, // default 0
"amm" : // or just "amm" : 30 // what is this?
{
"min" : 20,
"max" : 50
},
// "turretShooter" : false, // default false // should be in town config, could define all turrets separately
"abilities" : // default none
{
"CHARGE_IMMUNITY" : {}
// use syntax "-CHARGE_IMMUNITY" : {} to remove, must have same arguments
// arguments are different for each ability, invoke correct handler based on name
},
"graphics" :
{
"file" : "CPKMAN.DEF",
// "timeBetweenFidgets" : 1.00, // default 1.00
// "troopCountLocationOffset" : 0, // default 0
// "attackClimaxFrame" : 0, // default 0
"animationTime" : // default all 1.00
// {
"walk" : 1.15, // default 1.00
// "attack" : 1.00, // default 1.00
// "flight" : 1.00 // default 1.00
},
// "backgrounds" : // default faction background, set in town config
// {
// "120" : "TPCASNEU.bmp", // default faction background, set in town config // set to "" to restore default
// "130" : "CRBKGNEU.bmp" // default faction background, set in town config // set to "" to restore default
// },
// "missile" : // default none
// {
// "file" : "", // set to "" to remove missile
// "spin" : false, // default false
// "offset" : // default 0
// {
// "upperX" : 0, // default 0
// "upperY" : 0, // default 0
// "middleX" : 0, // default 0
// "middleY" : 0, // default 0
// "lowerX" : 0, // default 0
// "lowerY" : 0 // default 0
// },
// "missileFrameAngles" : // default 0.0
//
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0,
// 0
// ]
// }
},
"sounds" : // default none
{
"attack": "PIKEATTK.wav", // default none, ""
"defend": "PIKEDFND.wav", // default none, ""
"killed": "PIKEKILL.wav", // default none, ""
"move": "PIKEMOVE.wav", // default none, ""
// "shoot" : "", // default none, ""
"wince": "PIKEWNCE.wav", // default none, ""
// "ext1" : "", // default none, ""
// "ext2" : "", // default none, ""
// "moveStart" : "", // default none, ""
// "moveEnd" : "" // default none, ""
}
},
// more creatures
}