Open Rexhunter99 opened 4 years ago
What about something like JSON or even YAML?
What about something like JSON or even YAML?
It would be easier to stick with the current script format for now and just simply write a better interpreter for it, offering those later would be useful. I would not be opposed to JSON for handing things.
The problem with JSON is that comments are not allowed, which, as the format becomes more complex, makes it less and less easy for normal users to understand/edit. I think writing a better parser for the current format (or even YAML) would be much more helpful here.
What about HOCON? Interestingly, it’s not that different from the _RES custom format.
Never heard of it before, thanks for point it out ;) It seems to be JSON basically but with some stricter rules, and support for comments, so it would be more user-friendly then plain JSON.
I guess the big question is if it is worth introducing another format now, having to maintain both the current format and the new format, or fixing up the current config parser. I guess it'll be up to whoever ends up acting on this ticket ;)
Totally. Though to me the trade off is more about rewriting the existing parser (and extending to support new features, and documenting the format) vs rewriting the configs to use an open source parser and externally documented format.
Speaking from personal experience, maintaining two formats for the same thing sucks. If the decision is to switch to an open-source option, my recommendation is to consider the current format legacy and refuse to do any maintenance on it other than absolutely apocalyptically important stuff (e.g. security fixes).
_RES.txt files need to be written in very specific ways or they will fail to load. Error reporting as to what caused the script loading to fail is nearly non-existant in the vanilla game. Implementing a more robust interpreter of the script with better error reporting would be a big step in the right direction to making _RES less painful to work with. It would also make it easier to implement new features to the _RES script.
As a long-term future goal, a stripped down binary version would be useful and interesting.