[Engine] A possible optimisation for desync recovery
Posted: Sun Nov 30, 2014 6:45 am
After playing 100+ hours with friends in multiplayer over the internet, I've experienced far too many desyncs, all of which take several minutes on larger maps due to a slow connection.
I believe there is room for a optimisation to the basic desync routine, involving some simple processing of the map prior to redistributing the map to the desynchronised player.
For those that don't quite understand how the game figures out when something goes wrong, it goes a little something like this:
-Every few ticks, the game checks if the map is the same on each players computer; This is called a CRC check.
-If the map (CRC) somehow doesn't match up, the game will pause and redownload the entire map again. This can take a rather long time when playing on slow internet connections.
-The game will unpause, and attempt to keep playing like normal, but sometimes the game will desync again due to the exact same error as last time, causing a desync loop.
In order to fix this long series of waiting for the redownload to finish, I have come up with the following idea:
When a desync does occur, it should be possible to do a quick CRC check for each 'chunk' and redistribute only the desynchronised chunks to the other players, and then rebuild the correct chunks into the existing map. Not only would this save transfer time, up to several minutes; but also bandwidth for having to send large (20MB+) maps over the internet, at the expense of some very short CPU processing time.
My basic programming knowledge indicates that this should not be too difficult to implement, but I don't know anything about the engine's existing implementation, so this may be incorrect.
I believe there is room for a optimisation to the basic desync routine, involving some simple processing of the map prior to redistributing the map to the desynchronised player.
For those that don't quite understand how the game figures out when something goes wrong, it goes a little something like this:
-Every few ticks, the game checks if the map is the same on each players computer; This is called a CRC check.
-If the map (CRC) somehow doesn't match up, the game will pause and redownload the entire map again. This can take a rather long time when playing on slow internet connections.
-The game will unpause, and attempt to keep playing like normal, but sometimes the game will desync again due to the exact same error as last time, causing a desync loop.
In order to fix this long series of waiting for the redownload to finish, I have come up with the following idea:
When a desync does occur, it should be possible to do a quick CRC check for each 'chunk' and redistribute only the desynchronised chunks to the other players, and then rebuild the correct chunks into the existing map. Not only would this save transfer time, up to several minutes; but also bandwidth for having to send large (20MB+) maps over the internet, at the expense of some very short CPU processing time.
My basic programming knowledge indicates that this should not be too difficult to implement, but I don't know anything about the engine's existing implementation, so this may be incorrect.