afterschoolstudio / Depot

Structured data editor built inside VS Code
Apache License 2.0
186 stars 19 forks source link

Alternate JSON exports #55

Open skymen opened 2 years ago

skymen commented 2 years ago

Current format is fine, mostly because it allows for easy editing of the depot file. But when the depot needs to be included and read in a game engine, I'm weary of how things are currently stored.

I think there would be merit to having some form of export option that generates another json file by reordering data and removing useless stuff from the file. Also, make it so everything uses guid as keys so you can just do sheets[sheetGuid].lines[lineGuid] when searching for a line instead of sheets.find(x=>x.guid === sheetGuid).lines.find(x=> x.guid === lineGuid). I'm not fond of having to potentially go through a list of hundreds of elements just to find the one I'm looking for.

Alternative storing method would be to have a guid to id map. So it would be sheets[map.get(sheetGuid)].lines[map.get(lineGuid)] which is better.

Also, having a less wordy JSON document would make engine implementation much easier, and much simpler to maintain.