You just need to cut and paste the struct, make your changes, and change the name of it to the new version, scene_serialisation_v2_t would become scene_serialisation_v3_t. You’d then need to provide some functions to forward convert the older struct to the newer one (or provide parallel versions of the code to convert the struct to scene_flash_t).
The binary file contains a header with a magic number and version so that we know what it is.
Also by keeping a separation between the serialisation structs and the internal use structs, we have a bit of freedom with regards to internal layout of data structures.
It’s not perfect by any means, but there is a clearly defined logic to it. IMO the problems you’d have with different versions of text file format will be harder to deal with.
I’ve stated earlier in this thread that I’d prefer a text file format. The question is whether the extra work required to make a robust text parser is worth the investment.
Or alternatively, what would we prefer? A text format that would be harder to provide backwards compatibility with, or a binary format.
I do think it’s worth exploring alternate ideas for how the binary serialisation would work. I didn’t put a lot of effort into what I wrote earlier, so there might be much better ways of doing it.