I am writing a simple game that I plan to make multiuser (over the network) as my university project. I consider two client-server interaction scenarios:
Physics (they are trivial! Actually, I would call it "collision tests") are processed only on the server. Therefore, communication looks like this
Client1->Server: Pressed "UP"
Server->Clients: here you go, Client1 position is now [X,Y]
Client2->Server: Pressed "fire"
Server->Clients: Client1 hit Client2, make Client2 disappear!
The server receives the event and passes it to all other clients.
Client1->Server: Pressed "UP"
Server->Clients: Client1 pressed "UP", recalculate his position!!
[Client1 receives this one as well!]
Which one is better? Or maybe none of them?
source
share