What's new
Roleplay UK

Join the UK's biggest roleplay community on FiveM and experience endless new roleplay opportunities!

So what is Desync ?

Redpath

Reverend woz 'ere.
Wilco said that he was going to post a forum post of what Desync actually is, and I thought I would beat him to it :) sorry @Wilco

It is a form of "Lag" which is noticeable delay between players and the server. It can also be caused by high latency, or it may also occur due to insufficient processing power from the client or server. It is near enough impossible to gain Desync issues on single player games as it is coming straight from the local machine. However in online gaming it requires it to be maintained on a central server in order to avoid smooth gameplay between each individual client. Desync can also be caused if the client does not have a good connection to the central server or if they do not have a good connection to other clients playing.

Basically Deync is not always caused by the server, and can be client side :)

 
Let me begin by saying that absolutely every game that is played online has to deal with desync. Every single game without exception. This is because that information does not travel over the internet instantaneously. Data traveling between two different machines, it could be a client and a server or even two clients directly connected to eachother, takes a typically very small amount of time. This is referred to as your ping, lag, latency, etc. That number you see is the delay between data getting sent to the server and a response getting sent back given in milliseconds. The lower the number, the better. Many people can get a ping below 100ms, most people can get below 200ms. If you live in an unlucky part of the world that's far from the servers you're trying to connect to then you can even get up to 500ms (that's half a second). Half a second may not sound like a lot but in a game like PoE where dozens of things are happening on screen at once and you need to react within a fraction of a second, a whole half second can quickly be the difference between life and death.
 
To combat desyncs, some games choose to use a game architecture that rigidly forces every game state to stay synchronized at all times. Obviously this has the benefit that the different game stats on the various different machines are never out of sync with each other. This has the downside that any action you want to take (pressing a key or clicking your mouse) has to travel to the game server and be confirmed and then that server confirmation needs to travel back to you before you're actually allowed to take that action. If you have very low latency, then you won't notice this delay between you pressing a button and the corresponding action occurring on screen. If it takes half a second between when you press a button and when your character takes an action then you're definitely going to notice. This sort of synchronization scheme works very well for slower games where not a lot is happening at once and the player doesn't need to make split second reactions (strategy games and MMOs for example).
 
In games like PoE where the action is happening very quickly and the player needs instant feedback, enforcing this rigid synchronization is impossible. The combat would be unresponsive and the game would simply be unplayable. What you need a scheme that allows the player's actions to occur instantaneous on the player's computer and then synchronization occurs after the fact behind the scenes. This is exactly what most games do to varying degrees, including games like Diablo 3. Basically any online game that requires instantaneous player feedback. The result is that these games are always at least slightly out of sync with the server but they give the player instantaneous feedback and feel very fluid. There's no way to avoid that. The goal becomes to cover it up so players don't notice it and to hopefully keep it from becoming a big issue.
 
Let's take an example. When you attack an enemy next to you with your sword your game immediately begins the swing animation. At the server, your character is still just standing still because the server doesn't know you've done anything yet. 100ms later, your character is still at the very beginning of his attack animation and the server has just gotten the data packet from you saying that your character attacked a monster. The server checks to make sure that's an allowable action and then calculates if you hit and how much damage you deal and sends that information back to the client. 100ms later the client receives the information from the server saying if you hit and how much damage dealt. If everything is timed properly, your client should receive this information just before your sword makes contact with enemy. That way the hit is occurs exactly when you see it happen on screen and the damage is dealt. Your client and the server were desynchronized for those moments but because that desync was well hidden you didn't notice at all. This is a really simple example but already you can see how this system can begin to break down. If it takes longer for the attack data to reach the server, get processed, and travel back to your computer than it does for your attack animation to play out to the point where you hit the enemy then you'll notice the desync. Your character will 'hit' the enemy but the damage won't be dealt for another fraction of a second.
 
The issue really comes up when you have dozens of these actions all occurring at once. Your character is moving and attacking, a whole bunch of enemies are moving and attacking. All of this information needs to go back and forth between the server and the client. Both the server and the client are running simultaneously game state simulations and the goal is to keep these two game states as synchronized as possible even though both game states only have a fraction of the information they need, the information they do have can be hundreds of milliseconds out of date, and the information is constantly changing. You can see how much of a challenge this can be. The only thing client or server can do if it's missing a piece of information is to continue simulating the game state using any information it may have. This is where more pronounced desyncs occur (what players typically refer to when they talk about desyncs). When one side is lacking a piece of information and continues to run it's version of the game state simulation using out of date and incorrect data.
 
Desync wouldn't be a big issue if you could synchronize the entire game state on both sides a few times per second. Bandwidth isn't free, though. In fact, it's quite expensive.
 
Last edited by a moderator:
I won't quote you Hoffer, but let's also put into consideration that Arma3 does not use a typical client-server model. It actually uses a broadcast model, which means that if some clients aren't receiving that broadcast, de-sync also occurs here.

I've had instances where a friend is driving a car that is completely invisible to me, but all my other friends could see him driving.

My client could not receive his broadcasts and so our clients were desynced.

 
@Mycaelis     I have had the same problem with the helicopters especially and if you look at the map you are staying still.

  

 
Back
Top