I am currently implementing the network layer for my game. I am going to be using Serialization when a client joins the server so that it can get the updated “game state”, ie. a snapshot.
Once a client has the snapshot, they will receieve a constant stream of delta packets, ie. updates containing actions (eg. Player 1 does action X).
I am really loving Serialization, it is quite a powerful tool and one I have not played with before. My question is - is it suitable for the frequent update packets? I guess what I am really asking is - is there much overhead?
The other solution obviously is to encode->send->decode the data using some other protocol (most likely self-defined) but that’s an extra step which Serialization can take out - everything can simply be placed in a ‘Packet’ object and it comes out at the other end. From a coding point of view Serialization would be easiest but is it wasteful of resources?
I am definitally using Serialization to download the snapshot - no doubt about that as the overhead impact is minimal in that case because it happens very infrequentally.
TCP will be what I use for all Server->Client communication, Client to Server actions could be UDP but until I see a real need for it they will be TCP as well. I am following the TCP vs UDP thread with interest.
Cheers,
Will.