Currently i trying to make something like library for working with big amounts of data-like content for S&box, and i am not so sure about how it should be organized first of all for convenience.
data-like contents it is something like hundreds or thousands of JSON files that describe some generic objects in games (rpg, surivival or rouglikes as an example.). JSON files can be really convenient for such stuff, so i think it can be really cool stuff, and using generic entity templates to make big amount of parametrizable items, enemies and other content very fast. Look at how content organized in Cataclysm DDA or DwarfFortress (but DF uses its own data format)
How i see it currently:
You can register in your Game class something like Loader. that based on BaseFileSystem, and you can regster any C# Classes, that can be deserialized automatically when game loads. At any time you can register JSONData, specify folder when your json files should be suited, and it loads it recursively.
Example JSON representation:
I Know that some stuff are really bulky, but i want to ask expierenced devs about what kind of methods can be added for stuff like that?
My additional ideas:
- Fully change reloading to FileWatcher. But IDK about perfomance hits, because you need to filewatch for every Template Type, but there can be a lot of them.
- Not only loading but saving JSON. Technically it can be implemented. You can load and save JSON data easily, use it something like save system in some way.