by ajuc · 11y ago · 0 comments
Save game if you use index for referencing objects = one fwrite call.
Save game if you use pointers = a lot of pain.
I think it is generally not a good idea when in-memory representation of objects is identical to the serialized representation. This approach tends to backfire in a number of ways, such as format incompatibility between software versions, or hardware architecture differences, so it is always better to assume that your serialized representation will be different from in-memory representation.