Advertisement Jump to content
Sign in to follow this  
garyfletcher

object serialization

This topic is 4925 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all. I am just wondering about something. Object serialization seems to be used primarily to save/load game/object states but I was wondering if I could apply the same concept, and even the same abstract interface to somehow reduce objects into a common "format" for sending data packets across a socket connection? Has anyone tried anything like this or does anyone know any good articles about these subjects..serialization and data packets? I have tried google but it doesn't come up with much. Thanks in advance.

Share this post


Link to post
Share on other sites
Advertisement
We used serialization for networking, savegames, replays and consistency checks (by computing a checksum of resulting state).
It's quite a useful feature to have in your engine actually..

Share this post


Link to post
Share on other sites
Quote:
Original post by garyfletcher
So what would be the best format for the serialization, a string or a stream, or something else?
It depends really, but I suggest using a binary format rather than a text-based one if you're going to use it for networking.
Is portability an issue? If it isn't then you can probably get away with writing a raw structure.
Otherwise I suggest writing a binary stream class capable of handling byteorder and type size issues automatically.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!