Handling Socket Communication?

Subscribe to Handling Socket Communication? 2 posts

avatar for strumpetdreams strumpetdreams 12 posts
Flag Post

Hey guise,

I’m building a basic game using sockets & threads. Yeah. Really simple. _;

But I want it to be abstract.

I want the client to be able to ask about the game world (multiple maps) and get a perfect state for it at that moment, as well as to be able to push changes (e.g.: move my entity, attack a bush, whatev).

I’m stumped though on what sort of data to send through the socket. What is standard for multiplayer games? Serialized objects? A string header declaring an object followed by its attributes?

 
avatar for BobJanova BobJanova 886 posts
Flag Post

You have to send serialised objects. There isn’t a good built in serialiser so you have to write a communication protocol.

Or use something like Player.IO which deals with much of the dirty low level stuff for you.