Difference between revisions of "Creature Format"

From VCMI Project Wiki
Jump to: navigation, search
(made schema hidden)
Line 1: Line 1:
 
See thread http://forum.vcmi.eu/viewtopic.php?t=533 for discussion.
 
See thread http://forum.vcmi.eu/viewtopic.php?t=533 for discussion.
 
todo:
 
* remove deprecated attributes once implemented in town config
 
 
Creature abilities use [[Bonus Format]].
 
 
<!--
 
<!--
  
Line 372: Line 367:
  
 
-->
 
-->
 
long version (83 lines):
 
 
<syntaxhighlight lang="javascript">
 
<syntaxhighlight lang="javascript">
 +
// camelCase unique creature identifier
 +
"creatureName" :
 
{
 
{
    "creatureName" : // should be camel case version of interface name. Examples: Pikeman, RoyalGriffin. Do not change after its released
+
// translatable names
    {
+
"name" :
        // mandatory
+
{
        "name" :
+
"singular" : "Creature",
        {
+
"plural" : "Creatures"
            "singular" : "",
+
},
            "plural" : ""
+
"level" : 0,
        },
+
        "level" : 0,
+
// config name of faction. Examples: castle, rampart
        "faction" : "", // config name of faction. Examples: Castle, Rampart
+
"faction" : "",
        "cost" : // cost, zero values can be omitted. Keys are the ids of the resources
+
// cost to recruit, zero values can be omitted.
        {
+
"cost" :  
            "Wood" : 0,
+
{
            "Mercury" : 0,
+
"wood" : 0,
            "Ore" : 0,
+
"mercury" : 0,
            "Sulfur" : 0,
+
"ore" : 0,
            "Crystal" : 0,
+
"sulfur" : 0,
            "Gems" : 0,
+
"crystal" : 0,
            "Gold" : 0
+
"gems" : 0,
        },
+
"gold" : 0
        "fightValue" : 0,
+
},
        "aiValue" : 0,
+
// "value" of creature, used to determine for example army strength
        "growth" : 0,
+
"fightValue" : 0,
        "hitPoints" : 0,
 
        "speed" : 0,
 
        "attack" : 0,
 
        "defence" : 0,
 
        "damage" :
 
        {
 
            "min" : 0,
 
            "max" : 0
 
        },
 
        "advMapAmount" :
 
        {
 
            "min" : 0,
 
            "max" : 0
 
        },
 
        "graphics" :
 
        {
 
            "animation" : "" // name of def file
 
        },
 
  
        // optional
+
// "ai value" - how valuable this creature should be for AI
        "upgrades" : [], // keys are names of creatures that this can be upgraded to
+
"aiValue" : 0,
        "doubleWide" : false,
+
        "shots" : 0,
+
// normal growth in town or external dwellings
        "spellPoints" : 0,
+
"growth" : 0,
        "abilities" :
+
        {
+
// growth bonus from horde building
        },
+
"hordeGrowth" : 0,
        "graphics" :
+
        {
+
// Creature stats in battle
            "timeBetweenFidgets" : 1.00,
+
"attack" : 0,
            "troopCountLocationOffset" : 0,
+
"defence" : 0,
            "attackClimaxFrame" : 0,
+
"hitPoints" : 0,
            "animationTime" :
+
"shots" : 0,
            {
+
"speed" : 0,
                "walk" : 1.00,
+
"damage" :
                "attack" : 1.00,
+
{
                "flight" : 1.00
+
"min" : 0,
            },
+
"max" : 0
            "background" :
+
},
            {
+
// spellpoints this creature has, how many times creature may cast its spells
                "120" : "", // if empty, uses faction background
+
"spellPoints" : 0,
                "130" : ""  // if empty, uses faction background
+
// initial size of creature army on adventure map
            },
+
"advMapAmount" :
            "missile" :
+
{
            {
+
"min" : 0,
                "animation" : "", // name of def file for missile
+
"max" : 0
                "spinning" : false,
+
},
                "offset" :
+
                {
+
// Creature to which this creature can be upgraded
                    "upperX" : 0,
+
// Note that only one upgrade can be available from UI
                    "upperY" : 0,
+
"upgrades" :
                    "middleX" : 0,
+
[
                    "middleY" : 0,
+
"anotherCreature"
                    "lowerX" : 0,
+
],
                    "lowerY" : 0
 
                },
 
                "frameAngles" : []
 
            }
 
        },
 
        "sound" : // names of sound files
 
        {
 
            "attack": "",
 
            "defend": "",
 
            "killed": "",
 
            "move": "",
 
            "shoot" : "",
 
            "wince": "",
 
            "moveStart" : "",
 
            "moveEnd" : ""
 
        },
 
  
        // deprecated, move to town config
+
// Creature is 2-tiles in size on the battlefield
        "hordeGrowth" : 0, // growth bonus from horde building
+
"doubleWide" : false,
        "turretShooter" : false // if used in turret
+
 
    },
+
// All creature abilities, using bonus format
    // more creatures
+
"abilities" :
}
+
[
</syntaxhighlight>
+
Bonus Format
pikeman long (39 lines):
+
],
<syntaxhighlight lang="javascript">
+
{
+
"graphics" :
    "Pikeman" :
+
{
    {
+
// name of file fith creature battle animation
        "name" :
+
"animation" : ""  
        {
+
            "singular" : "Pikeman",
+
// animation parameters
            "plural" : "Pikemen"
+
// TODO: explain meaning and use them by engine
        },
+
"timeBetweenFidgets" : 1.00,
        "level" : 1,
+
"troopCountLocationOffset" : 0,
        "faction" : "Castle",
+
"attackClimaxFrame" : 0,
        "upgrades" :
+
"animationTime" :
        {
+
{
            "Halberdier" : true
+
"walk" : 1.00,
        },
+
"attack" : 1.00,
        "cost" :
+
"flight" : 1.00
        {
+
},
            "Gold" : 60
+
"missile" :
        },
+
{
        "fightValue" : 100,
+
// name of file for missile
        "aiValue" : 80,
+
"animation" : "",  
        "growth" : 14,
+
// missile should spin, e.g. for throwing axes
        "hitPoints" : 10,
+
"spinning" : false,
        "speed" : 4,
+
"offset" :
        "attack" : 4,
+
{
        "defence" : 5,
+
"upperX" : 0,
        "damage" :
+
"upperY" : 0,
        {
+
"middleX" : 0,
            "min" : 1,
+
"middleY" : 0,
            "max" : 3
+
"lowerX" : 0,
        },
+
"lowerY" : 0
        "advMapAmount" :
+
},
        {
+
"frameAngles" : []
            "min" : 20,
+
}
            "max" : 50
+
},
        },
+
 
        "abilities" : // this is subject to change
+
// names of sound files
        {
+
"sound" :  
            "CHARGE_IMMUNITY" : {}
+
{
        },
+
"attack": "",
        "graphics" :
+
"defend": "",
        {
+
"killed": "",
            "animation" : "CPKMAN.DEF",
+
"move": "",
            "animationTime" :
+
"shoot" : "",
            {
+
"wince": "",
                "walk" : 1.15
+
"moveStart" : "",
            }
+
"moveEnd" : ""
        },
+
}
        "sound" :
 
        {
 
            "attack": "PIKEATTK.wav",
 
            "defend": "PIKEDFND.wav",
 
            "killed": "PIKEKILL.wav",
 
            "move": "PIKEMOVE.wav",
 
            "wince": "PIKEWNCE.wav"
 
        }
 
    }
 
 
}
 
}
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
== Additional lnks ==
 +
[[Bonus Format]]

Revision as of 15:30, 15 December 2012

See thread http://forum.vcmi.eu/viewtopic.php?t=533 for discussion.

// camelCase unique creature identifier
"creatureName" : 
{
	// translatable names
	"name" :
	{
		"singular" : "Creature",
		"plural" : "Creatures"
	},
	"level" : 0,
	
	// config name of faction. Examples: castle, rampart
	"faction" : "", 
	// cost to recruit, zero values can be omitted.
	"cost" : 
	{
		"wood" : 0,
		"mercury" : 0,
		"ore" : 0,
		"sulfur" : 0,
		"crystal" : 0,
		"gems" : 0,
		"gold" : 0
	},
	// "value" of creature, used to determine for example army strength
	"fightValue" : 0,

	// "ai value" - how valuable this creature should be for AI
	"aiValue" : 0,
	
	// normal growth in town or external dwellings
	"growth" : 0,
	
	// growth bonus from horde building
	"hordeGrowth" : 0,
	
	// Creature stats in battle
	"attack" : 0,
	"defence" : 0,
	"hitPoints" : 0,
	"shots" : 0,
	"speed" : 0,
	"damage" :
	{
		"min" : 0,
		"max" : 0
	},
	// spellpoints this creature has, how many times creature may cast its spells
	"spellPoints" : 0,
	// initial size of creature army on adventure map
	"advMapAmount" :
	{
		"min" : 0,
		"max" : 0
	},
	
	// Creature to which this creature can be upgraded
	// Note that only one upgrade can be available from UI
	"upgrades" :
	[
		"anotherCreature"
	],

	// Creature is 2-tiles in size on the battlefield
	"doubleWide" : false,

	// All creature abilities, using bonus format
	"abilities" :
	[
		Bonus Format
	],
	
	"graphics" :
	{
		// name of file fith creature battle animation
		"animation" : "" 
		
		// animation parameters
		// TODO: explain meaning and use them by engine
		"timeBetweenFidgets" : 1.00,
		"troopCountLocationOffset" : 0,
		"attackClimaxFrame" : 0,
		"animationTime" :
		{
			"walk" : 1.00,
			"attack" : 1.00,
			"flight" : 1.00
		},
		"missile" :
		{
			// name of file for missile
			"animation" : "", 
			// missile should spin, e.g. for throwing axes
			"spinning" : false,
			"offset" :
			{
				"upperX" : 0,
				"upperY" : 0,
				"middleX" : 0,
				"middleY" : 0,
				"lowerX" : 0,
				"lowerY" : 0
			},
			"frameAngles" : []
		}
	},

	// names of sound files
	"sound" : 
	{
		"attack": "",
		"defend": "",
		"killed": "",
		"move": "",
		"shoot" : "",
		"wince": "",
		"moveStart" : "",
		"moveEnd" : ""
	}
}

Additional lnks

Bonus Format