Presently the game uses a CSV format, and the former maintainers tried to also split the CSV data into multiple CSV files which we've found to be problematic (see https://github.com/vegastrike/Assets-Production/pull/7 for details).
Let's move to a different save game format.
Currently JSON, TOML, and YML are all currently excepted formats. However, only JSON has native support in Python (even Py3) without requiring additional libraries so if we need to open it from within the Python code, then we should limit it to the JSON format. (NOTE: JSON and TOML are both related to YML; I don't know why Python doesn't have a built-in YML parser.)
Tasks:
My recommendation:
There are many formats available for serialization, the most commonly used being CSV, XML, JSON, YAML.
Our requirement for data serialization is that it would be:
Following the analysis and recommendations in this article, we equally recommend JSON as the select serialization data format for fulfilling all of the above criteria better than other formats.
[1] CSV vs XML vs JSON – Which is the Best Response Data Format?. Digital Hospital. 2016. Retrieved on 2020-02-23.
Source: https://github.com/LibreGamingManifest/libre-gaming-manifest/blob/master/libre-gaming-manifest.md#serialization-formats
Cool. Sounds like JSON might be the way to go then.
Question: Are we making the correct distinction between the CSV format of the assets (which don't change) vs. the saved game format?
I think @BenjamenMeyer meant the CSV assets table, since the savefile doesn't seem to be a CSV file at all.
In that regard, I would think about YAML, since it's more human friendly, especially for editing. And it is a superset of JSON, so moving from one to another should be easy.
I would also add to this discussion the game's config file.
Some more info on that:
https://www.json2yaml.com/yaml-vs-json
http://stackoverflow.com/questions/1726802/ddg#1729545
So this particular issue is the Save Game format itself; however, we might want to expand it towards what all the file formats should be. There is also some benefit to using one format versus a dozen formats as it can simplify any tool chains.
@nabaco my only issue with YAML is that it requires an additional library for Python to load it natively, and for how we use Python it'd be best to keep to just what is built-in if we can. JSON fulfills that requirement. Otherwise I wouldn't have any objection to YAML.
Most helpful comment
My recommendation:
Serialization Formats
There are many formats available for serialization, the most commonly used being CSV, XML, JSON, YAML.
Our requirement for data serialization is that it would be:
Following the analysis and recommendations in this article, we equally recommend JSON as the select serialization data format for fulfilling all of the above criteria better than other formats.
[1] CSV vs XML vs JSON – Which is the Best Response Data Format?. Digital Hospital. 2016. Retrieved on 2020-02-23.
Source: https://github.com/LibreGamingManifest/libre-gaming-manifest/blob/master/libre-gaming-manifest.md#serialization-formats