multiplayer - Simple network gaming, client-server architecture planning -


I'm coding a simple game, which I plan to make as a multiplayer (on the network) as my university project I am here. I'm thinking of two scenarios for client-server communication:

Physics (they are trivial! I should really say this "collision testing" :)) Only processed on server machines Are there. Therefore, communication resembles

  Client1-> Server: Pressed "UP" server-> Customers: Here you are going, Client 1 status now [X, Y] Client 2- & Gt; Server: Pressed "fire" server-> Clients: Client 1 hit client 2, Client 2 disappeared!  

Receives the event to the server and transmits it to all other clients.

  Client1-> Server: Pressed "UP" server- & gt; Client: Client 1 pressed "UP", re-calculating its status !! [Client 1 also receives this form!]  

Which is better? Or none of them?

General information is to send this information:

  • That's where the player is
  • That's right (by using the internal concept of time game, not necessarily real time)
  • Player movement vector (direction) And speed)
  • Then the client can use the dead to estimate where the other players are, so that network latency reduces the game. Updates are required to be sent only when the player changes his direction or speed (which other clients can not predict), even if the network will save bandwidth.

    Here are some links on dead calculations. Similar web sites may contain more articles about it.


    Comments