mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-12 10:03:53 +02:00
6.0 KiB
6.0 KiB
VCMI allows overriding HoMM3 .def files with .json replacement. Compared to .def this format allows:
- Overriding individual frames from json file (e.g. icons)
- Modern graphics formats (targa, png - all formats supported by VCMI image loader)
- Does not requires any special tools - all you need is text editor and images.
Format description
{
// Base path of all images in animation. Optional.
// Can be used to avoid using long path to images
"basepath" : "path/to/images/directory/",
// List of sequiences / groups in animation
// This will replace original group with specified list of files
// even if original animation is longer
"sequences" :
[
{
// Index of group, zero-based
"group" : 1,
// List of files in this group
"frames" :
[
"frame1.png",
"frame2.png"
...
]
},
...
],
// Allow overriding individual frames in file
"images" :
[
{
// Group of this image. Optional, default = 0
"group" : 0,
// Imdex of the image in group
"frame" : 0,
// Filename for this frame
"file" : "filename.png"
}.
...
]
}
Creature animation groups
Animation for creatures consist from multiple groups, with each group representing specific one animation. VCMI uses groups as follows:
Basic animations
-
0
-
moved on the creature1
-
not acting2
-
3
-
defending and was hit in melee4
-
5
-
killed by ranged attack6
Rotation animations
-
part of animation, with stack turning towards viewer7
-
8
-
9
-
10
Melee attack animations
-
11
-
12
-
13
Ranged attack animations
-
14
-
15
-
downwards16
Special animations
-
group attack animations were not found17
-
group attack animations were not found18
-
group attack animations were not found19
Additional H3 animations
-
animation starts.20
-
ends.21
Additional VCMI animations
-
dead. If not present, will consist from last frame from "Death" group22
-
creature is dead after ranged attack. If not present, will consist from last frame from "Death (ranged)" group23
-
is resurrected. If not present, will consist from reversed version of "Death" animation24
Spellcasting animations
-
upwards30
-
facing front31
-
facing downwards32
Group attack animations
-
multiple target, with primary target facing up (Dragon Breath attack, or creatures like Hydra)40
-
multiple target, with primary target facing front (Dragon Breath attack, or creatures like Hydra)41
-
multiple target, with primary target facing downwards (Dragon Breath attack, or creatures like Hydra)42
Proposed format extensions
Texture atlas format
TODO
- arbitrary texture coordinates
- margins
- grid-like layout
Texture atlas format
{
// Base path of all images in animation. Optional.
// Can be used to avoid using long path to images
// If a path is a filename is is treated as single texture atlas
"basepath" : "path/to/images/atlas/bitmap.png",
// List of sequences / groups in animation
"sequences" :
[
{
// Index of group, zero-based
"group" : 1,
// List of files in this group
"frames" :
[
{"x":0, "y":0, "w": 64, "h": 64},
{"x":64, "y":0, "w": 64, "h": 64}
...
]
},
...
]
}
Texture atlas grid format
{
// filename is is treated as single texture atlas
"basepath" : "path/to/images/atlas/bitmap.png",
//optional, atlas is a grid with same size images
//located left to right, top to bottom
//[columns, rows]
//default [1,1]
"gridCols":3,
"gridRows":3,
// List of sequences / groups in animation
// sequence index -> images count in sequence
"sequences" :
[
1,3,5
]
}