Simple network gaming, client-server architecture planning.
Posted
by michal
on Stack Overflow
See other posts from Stack Overflow
or by michal
Published on 2010-05-16T17:33:03Z
Indexed on
2010/05/16
17:40 UTC
Read the original article
Hit count: 235
multiplayer
|best-practices
Hi, I'm coding simple game which I plan to make multiplayer (over the network) as my university project. I'm considering two scenarios for client-server communication:
The physics (they're trivial! I should call it "collision tests" in fact :) ) are processed on server machine only. Therefore the communication looks like
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!
server receives the event and broadcasts it to all the 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? :)
© Stack Overflow or respective owner