Slower games like real time strategy tends to go the first route, faster games go the second route.
![ephinea dsync between players multiplayer ephinea dsync between players multiplayer](https://3.bp.blogspot.com/-DgVmsapkJLw/UGNItvFQokI/AAAAAAAAasg/tIaivhVwyqE/s1600/gamebotturing.png)
Therefore, your choices are to either model everything accurately with latency that may differ from viewer to viewer (which is what you have currently), or model them inaccurately without latency and broadly synchronised across viewers (which is where prediction/dead reckoning/extrapolation come in). If the sun exploded now, how could you guarantee that observers on Alpha Centauri see the supernova at the same time as we would on Earth? Information takes time to travel. There will never be a way to guarantee perfect synchronisation across multiple viewpoints in real time - the laws of physics make it impossible.
Ephinea dsync between players multiplayer update#
Perhaps my whole design of how the multiplayer system works is flawed, in the sense that a client's game instance shouldn't update unless notion is received from the server? Right now the clients just update themselves in their game loop assuming that any states haven't changed. So I'm looking for papers discussion the subjects or algorithms that solves it. The problem with this method is that in those n seconds lag the game would have had continued on the client side, and thus the client would have to rollback in time to update for the state change which definitely would get messy. That way when a client received a state change, it would know exactly in which period of the game the changed happened, and would in turn be able to correlate for the lag. The ideas I've been having, however, is to keep some kind of time system, so each state change would be connected to a specific timestamp in the game. I'm new to network programming, and not so naive to think that I can invent a working system myself without dedicating a severe amount of time to it.
![ephinea dsync between players multiplayer ephinea dsync between players multiplayer](https://www.destructoid.com/ul/542543-smitedammit.jpg)
I've been searching for various ways to implement a synchronization system between the clients but haven't found much so far. If there happened to be a 5 second lag between the server and a particular client then he would receive the state change 5 seconds after the rest of the clients thus leaving him with game state out of sync. This works rather well, but the system does not maintain synchronization between the client instances of the game as of now. I've a server/client architecture implemented, where all state changes are sent to the function, validated and broadcasted to all clients connected.