This is very general question, about strategies how to pack same informations about state of my game-world on server ( e.g. position/orientation of players, projectiles, etc. ) into data stream so that I can sent them over network and unpack them on the client side to draw on screen.
I know it's called serialization. But still I have many doubts.
- My game already has some structure of objects. I do not want to re-design it ( too much ) in order to use some automatic serialization. I also do not want to make dependency on an other library (such as boost::serialize ) if not necessary
- My classes/objects e.g.(class Airplane) contain some properties which should be passed over network to the client ( e.g. position and orientation ) but also some which should not ( e.g. some temporary variables relevant just for computations on server; pointers to nearest neighbor objects; array of Lift and Drag coefficient for set of angles-of-attack )
- If I pack more objects into one message/packet I will probably need some protocol and parser to unpack the objects properly on the other side. The client should know of which Class type data are and to which instance it should be assigned.
Probably by trial and error I can figure it by myself, but it would take some time, and it would be helpful to have some example solution of similar problem to start with.
background - I have some skill with physics and graphics programming (Java,C++,Frotran,GLSL,OpenCL...), but I know absolutely nothing about networking. I have done some games into which I would like multiplayer. Just simple games with only few players and moving objects (projectiles). For reference consider something like LIERO
Curently I work with SDL2 so I tried the tutorial on SDL_net which quite satisfies me from technical point of view. But I does not provide any hint to answer the questions above.