Implementing Multiplayer: entire world ticks or just changes?

by Barnack   Last Updated May 17, 2018 00:13 AM

i'm working an a very simple multiplayer experience (for now node.js, later will probably remake all in c++, but my question is more about theory).

All guides and tutorial i saw about making something multiplayer Always speak about sending all the "world" information, once per tick, deciding optimal tickrate, making smooth movements on client side with interpolation or stuff like that.

Honestly i thought of another way, and i really cant see why its never mentioned. My idea would be the following:

  • Client sends to server when input happens; eg if you move with arrows, you send to the server a message only when your moving status changed. If you was moving right and then start moving upright, then you send a message about you changing your movement.
  • Server recives the messages, sets variable on player object for its movement, and sends to all other clients information about the change. Also sends current time and current position in the server at the moment of movement change.
  • Clients recive a movement status update, place the player object in recived coordinates moved by the new movement * ping delay. That way position in all clients should Always be up to date with the server.

Why should i send hundreds of positions to each client per each player every x milliseconds when i can just send the changes?

I feel like its about polling vs interrupt... (yeah i know its not polling anyway, but the concept is sending the change vs keep sending everything)



Related Questions




Delayed linear interpolation for networking

Updated June 13, 2017 23:13 PM

Creating a server for an existing game

Updated May 01, 2015 21:05 PM