Difficult is maybe not the right word, laborious is perhaps better.
In a traditional (a la doom3) snapshot implementation you serialize each entity.
The user code is simply responsible for reading and writing bits to and from the stream.
The serialization of game state is done only once.
Then the system calculates a binary diff per entity per client.
To accomplish the same thing with optional fields the "delta" calculation has to move to the user code.
The serialization of gamestate has to be done per client
Building a delta compressed protobuf message for a transform (using
protobuf.net) looks something like:
It's been a few years since I've looked into this and I was reading some documentation to refresh my memory.
Maybe I'm wrong and you can use the protobuf reflection api to move the delta calculation out of user code and into library code.
Either way what you can do with protobuf is irrelevant here.
I want to do the game representation -> FlatBuffers representation conversion only once per snapshot.
Not once per client per snapshot.
I want to do the delta calculation on the FlatBuffers representation.
Benefits from quantization.
Avoids having to convert from common base snapshot (in FlatBuffer representation) to game representation.
I want to do the do the delta calculation in generic library code agnostic of the types being serialized.
This way it only needs to be written once.
Apply snapshots to the common base should be easier.
User code shouldn't have to care about delta compression.