Difference between revisions of "Animation Format"

From VCMI Project Wiki
Jump to: navigation, search
(Proposed format extentions)
(Replaced content with "{{Template:MovedToWebpage|https://vcmi.eu/modders/Animation_Format/}}")
 
(13 intermediate revisions by 2 users not shown)
Line 1: Line 1:
VCMI allows overriding HoMM3 .def files with .json replacement. Compared to .def this format allows:
+
{{Template:MovedToWebpage|https://vcmi.eu/modders/Animation_Format/}}
* 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.
 
 
 
Note that right now this replacement is not supported fully: there are still some areas that can't use it. Most notable areas are:
 
* Adventure map
 
* Battles
 
=Format description=
 
<syntaxhighlight lang="javascript">
 
{
 
    // 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"
 
        }.
 
        ...
 
    ]
 
 
 
}
 
</syntaxhighlight>
 
 
 
=Proposed format extensions=
 
* vcmi client {{todo}}
 
* map editor {{todo}}
 
 
 
== Proposed format extensions ==
 
 
 
<syntaxhighlight lang="javascript">
 
{
 
    // 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/directory/",
 
 
 
    //"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}
 
                    ...
 
            ]
 
        },
 
        ...
 
    ]
 
}
 
</syntaxhighlight>
 
 
 
 
 
{{Modding}}
 

Latest revision as of 16:18, 16 July 2024

Logo256.png    Page moved to VCMI-Homepage