4 ms·
> why don't you use, e.g. protobuf protobuf sounds attractive, but (unless I've missed something in protobuf's implementation), but out of the box you have 2 i
by the_angry_angel 10y ago
> why don't you use, e.g. protobuf
protobuf sounds attractive, but (unless I've missed something in protobuf's implementation), but out of the box you have 2 issues:
1. Protobuf doesn't/can't deal with fragmentation - so you'd have to ensure your protobufs are small enough to fit inside a UDP packet
2. Without a wrapper you couldn't put multiple small protobufs into a single UDP packet?
Both things are fixable by wrapping protobuf, but I suppose if you're trying to get something as small as possible, can you actually just do better by avoiding protobuf in the first place (I guess the answer is yes?)
- niftich 10y agoI understood it as using protobuf's interface definitions as as an integration point, not necessarily protobuf's exact wire format and everything below it that comes out-of-the-box (like TCP and below) in the default client.
- felixgallo 10y agoI meant everything up to and including protobuf's wire format, but nothing beyond that, which as you note wouldn't be super great.
- mikemarcin 10y agoProtobuf and most similar libraries don't support delta compression which is essential for game state updates.
- felixgallo 10y agoprotobuf as a structure serialization/deserialization library shouldn't have the responsibility for delta calculations in the first place. Once the application decides what the delta is, it can use protobuf or anything else to encode and transmit that.
- mikemarcin 10y agoYou want to build a full update, then for each client diff between the last ack'd full update and send only that delta. The application specific logic builds the full update. The rest can be done automatically by a good library. Building a delta compressed protobuf message for a transform (using protobuf.net) looks something like: http://codepad.org/3vjxogxZ http://codepad.org/3vjxogxZ
- felixgallo 10y agoDear lord. Why not just use optional fields?