You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hyperlap2d seems very promising for people wanting to make a custom engine and having a generic editor, but right now if I want to make a "runtime" for the output of hyperlap2d I need to generate a scene/world and reverse engineer the format.
Another project called ldtk fixed this issue by offering a json schema file following the json schema format. This enables to validate json files on export(for testing) and enables other projects to make importers/parsers for the json output of ldtk. Also, quicktype enables to automate the process of making parsers for multiple languages(including java) when using json schema files.
The text was updated successfully, but these errors were encountered:
mundusnine
changed the title
[Feature Request] Add a json shema file
[Feature Request] Add a json schema file
Aug 2, 2022
Hi @mundusnine sorry for my late response but unfortunately I was busy on other stuff.. I've looked into JSON schema and it turns out pretty more difficult to implement than expected. The issue is that JSON Schema is made to define static JSON documents, in the past (like the old Overlap2D) this program exported things with a fixed JSON format, but since the first Beta JSONs are meant to be dynamic in order to not give any constraints for plugins that might be developed in future by anyone else. Another difficulty I'm having is describing the "default" value of a field. In HyperLap2D Json anything is not required but everything has a default value in case the field is missing in the JSON. This is how libGDX Json serializer works and it's very smart because those JSONs tends to explode very quickly in terms of dimensions, stripping all default values is not only good for file size but also for upgrades with backward compatibility.
Saying that, I'm totally still for a way to describe HyperLap2D JSONs both for validation and for helps other runtimes to parse them but at moment I need some suggestions how to properly do that.
Thanks for having a look at this. To adress your issues I might of found some guidance on ways we could go.
For the "fixed" part of JSON schema, there is actually a way around that by having subschemas and conditionals.
For "default" values, have a look in the annotations section in this document.
Now, the thing I wonder about is how dynamic are the JSON files, are there any necessary fields or are all fields totally dynamic and generated by the editor ?
Hyperlap2d seems very promising for people wanting to make a custom engine and having a generic editor, but right now if I want to make a "runtime" for the output of hyperlap2d I need to generate a scene/world and reverse engineer the format.
Another project called ldtk fixed this issue by offering a json schema file following the json schema format. This enables to validate json files on export(for testing) and enables other projects to make importers/parsers for the json output of ldtk. Also, quicktype enables to automate the process of making parsers for multiple languages(including java) when using json schema files.
The text was updated successfully, but these errors were encountered: