Forums

Full Version: Normalizing serialization format
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Not a priority, but still something that is a maintenance burden is that we are using 4 different text serialization formats:

1. graphics gl3: nested tables and lists, ordered, verbose, hard to read/modify

2. graphics gl2: tables (sections), table lists (multiple sections with the same name), unordered (sections and section entries order doesn't matter)

3. car/gui/settings: nested tables, no table lists, unordered

4. track objects list: table list with implicit keys, no nesting, ordered, hard to read/modify

I'd like to see a single text and binary format to contain this proliferation.

If it wasn't for the poor readability I'd go for gl3 format. My current preference is thus to extend car/gui/settings format to support table lists, but also enforce element order like in the gl3 format, as this massively simplifies serialization.

There is also the issue of default values. Should it be allowed to leave out entries, like it is right now with car and gui and gl2 configs? It allows more compact configs but hides elements.

I am using comments in gl2 files to track the defaults for example:
;[pass]
;light = sun
;camera = default
;cull = true
;clear_color = false
;clear_depth = false
;write_color = true
;write_alpha = true
;write_depth = postprocess ? false : true
;depthtest = postprocess ? disabled : lequal
;blendmode = disabled

Any preferences here (verbose vs defaults)?

PS:
I will provide conversion scripts to the new format where needed.



Edit:
I missed a fifth one for track roads, formatted list of values... Tongue