Simple network games, planning client-server architecture

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?

+2
source share
2 answers

The usual approach is to send this information:

  • Where is the player
  • What time is he there (using the internal concept of game time, not necessarily in real time)
  • ( )

, , . , ( ), .

. -, , . http://www.gamasutra.com/view/feature/3230/dead_reckoning_latency_hiding_for_.php http://www.gamedev.net/reference/articles/article1370.asp

+6

, . .

, , . , .

+2

Source: https://habr.com/ru/post/1745668/


All Articles