In latest revision I improved json validation which now implements ~90% of latest draft. There are some missing elements but nothing major (and nothing that can be implemented easily).
But the main part is set of schema’s that are used to validate all input from mods (see config/schemas directory). What this means is that vcmi can now find:
all typos like incorrectly named field.
all missing fields that were marked as required.
several other checks like incorrect length of an array
And the main feature is that instead of crash modders will see exactly what’s wrong with mod
Surprisingly all of this has almost 0 effect on loading time - 1-2 extra mods impose much bigger delays.
Make validation required and drop any data that will not pass it. Right now vcmi detects just too many errors in some 3rd party mods I found. And some of them are obvious bugs.
Use or write tool similar to onde to implement some kind of mod making utility.
repo: exavolt.github.com/onde/
And one more thing - would be great if somebody would recheck schemas especially one that validates bonus system. For example remove fields that should not be used by mods, check if all fields that can accept string ID’s are marked as such, add better description for use in tools like onde.
I saw logfile for Forge, and there absence of this area reported as error:
“At /graphics
Error: Required entry attackClimaxFrame is missing
Data in CyberDead is invalid!”
I think, this is overstrict.
Nobody garantees, that number of frames for animating attack Up/Straight/Down and for Shoot Up/Straight/Down is the same. So by the way there must be some array for each attack climax Frame.
I think, it at all is not needed parameter.
VCMI can count number of frames in DEF for each attack and just take as Climax frame in the center (if attackClimaxFrame is not specified).
Right now most of configuration file have same set of fields as original .txt files. This field comes from crtraits.txt
Quick check - elves have 12 frames with attack climax at 11
Gogs - 6 out of 8
Lich - 8 out of 11
I haven’t found any creature where “attack climax” is exactly at center. Although this field seems to be used only for ranged attacks so melee creatures don’t need it.