peter-kish / gloot

A universal inventory system for the Godot game engine.
MIT License
561 stars 20 forks source link

Support raw json format for item protoset #194

Open Nordsoft91 opened 4 months ago

Nordsoft91 commented 4 months ago

Currently item protoset is defined as res file which can be edited only with embedded editor and has some header, which is not very convenient. I suggest to support common .json file as item protoset so it can be easily edited with any tool

LeeWannacott commented 4 months ago

@Nordsoft91 You can save your item protoset as a .tres file (by renaming extension) which is human readable and editable in an external editor, there is a tradeoff however as .res is more performant because its binary.

peter-kish commented 4 months ago

Yeah, the idea is to store protosets as .tres resources and edit them in the protoset editor, which can be inconvenient compared to editing raw JSON ☹️

But the original idea was exactly how @Nordsoft91 described. The problem was that back in Godot 3 JSON files were not handled very well by the engine and you had to write an import plugin to work with them. According to one of the Godot maintainers supporting JSON wasn't even planned:

JSON files are not considered resources and will probably never be, since Godot has no use for them. Instead, a solution such as https://github.com/godotengine/godot-proposals/issues/677 should be implemented.

so I decided to give up on it.

However, this changed in Godot 4 and JSON resources are supported now. I'm planning to replace protoset resources with JSON files in GLoot 3.x as I think it would simplify prototype management, but also maintenance of the plugin (no need for a custom editor).