Sending/receiving objects C#,
Members - Reputation: 115
Posted 04 December 2012 - 01:53 AM
My game is set up (as I assume most games are) as a list of entities. Each entity has data like position, current frame, etc. that are important to drawing them to the client screens. Here are my options transferring data from server to client, unless there's a (hopefully) easier way:
1) Traverse the entity list on the server, write only data important to the client to the message, and then upon receiving the data, the client traverses the list and backwards engineers the level before drawing it.
2) For each client, draw the level on the server and somehow send the pixel data so the client can draw it (I have no idea how to do this)
3) Maybe there is a way to send whole objects in messages.
Please tell me if I'm on the right track and thank you in advance!
Moderators - Reputation: 10320
Posted 04 December 2012 - 12:07 PM
You *can* do 3 (with "object serialization") but that's typically only used for enterprise applications, as the serialization tends to be highly inefficient for games.