Timo Küfner
Timo Küfner

Reputation: 85

Multiplayer-Game Network Protocol

I am responsible of the network part of a multiplayergame. I hope anybody of you got some eperience with that. My questions are:

  1. Should I create an Object which contains all information (Coordinates, Stats, Chat) or is it better to send an own Object for each of them?

  2. And how can i avoid the Object/s beeing cached at the client so i can update the Object and send it again? (i tried ObjectInputStream.reset() but it still received the same)

(Sorry for my bad english ;))

Upvotes: 2

Views: 1037

Answers (2)

llj098
llj098

Reputation: 1412

1.in the logic layer, you can split the objects, and in transmission layer you send what you want, of course you can combine them and send.

2.you can maintain a version for each user and the client also have the version number, when things change, update the corresponding version in the server and then send the updates to all the clients, then the client should update version. it should be a subcribe mode.

Upvotes: 1

Erdinç Taşkın
Erdinç Taşkın

Reputation: 1578

  1. For every time send all data is not good solution, just diff of previous values can be better. Sometimes(eg 1 time for every 10 or maybe 100 update) send all values to sync.

Upvotes: 2

Related Questions