What is Desync? (A thorough explanation)

Let me give a more full picture of desync. As a disclaimer, I only know roughly how GGG's server architecture is set up so I don't know specifics but there just seems to be a ton of misinformation going around about what desync actually is and how it affects the online games that we play. Hopefully this will give people a better understanding of the challenges inherent to making an online and I touch briefly on some of the techniques used to overcome those challenges.

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. If GGG tried to synchronize the client and server even just once every second across all the clients currently playing it would overwhelm their available bandwidth by orders of magnitude. There is no game that was ever made that can afford to do this. So you need to compromise. How much data can your bandwidth and server support? What's the bare minimum of data transfer that you need to keep the game playable? The solution that every online game uses is for the client and server to only send each other data when something in either state changes. For example, when you tell your character to move your character immediately starts moving on your screen and that data is sent to the server. The server receives that information a fraction of a second later but the character on your screen and the character on the server are now in two slightly different positions because for that fraction of second the server was continuing to operate under old information which said your character was moving in a different direction. Normally, this wouldn't be an issue and the desync would sort itself out but if you have a dozen mobs chasing you suddenly this tiny desync can ripple through the entire game state. The information about your character movement change to the server doesn't say anything about the mobs that are chasing you. Their current state of chasing you is still exactly the same as it was before so sending all that information would be very expensive for no real gain. When you move, the monster pathing on your client updates immediately for them to continue chasing you in the new direction. Since the server calculates the new monster pathing separately for it's own simulation of the game state and since your character is in a slightly different spot on the server, the monster pathing on the server is now slightly different. When the monsters are grouped together in a big pack and they're all trying to fit through a small doorway and they're all trying to simultaneously find an optimal pathing solution around each other and through the doorway. Suddenly, this is a situation where a monster being a slightly different position can have a significant impact on the group pathing. On the client, the monsters go through doorway in one order while the server calculates them to go through the doorway in another order. Meanwhile, you continue to move your character around and attack. Maybe you go and attack the first monster that comes out of the doorway and on the client simulation that's perfectly fine but when the server receives your attack information it says "wait a minute, that monster is still in the other room and you can't get there because the doorway is full of other monsters so that attack is infeasible". This is a serious desync and when the server notices that something like this has happened it forces a complete synchronization with the client and suddenly many of the monsters (and maybe even your character in particularly bad situations) instantly teleport to where the server says they should be. This is what's commonly called rubberbanding.

Desyncs are much more likely to occur in situations where many things are going on at once, when there are many monsters are screen, if they're moving quickly, if they're in a confined space, when you use skills that cause you to move and attack very quickly (whirling blades for example).

So what can be done to help alleviate desync? As I already said, synchronizing the entire game state regularly is too expensive no matter how big the game or rich the company. It's also unnecessary. Desync is perfectly fine as long as it doesn't affect the gameplay. For example, if you're attacking a zombie that's standing to the right of your character but on the server that zombie is actually to the left of your character, what does it really matter as long as your attacks are connecting and dealing damage and the zombie will be dead in another second anyway. The vast majority of desyncs between the client and the server are of this sort. They have absolutely no impact on the gameplay and the player never even knows about them.

A solution that's rarely used is have the client serve as the master game state. In this case the client generates all the important data like if your attack hits and how much damage it deals and sends this information to the server. The benefit is that what the player sees on their screen is always correct, but this has very significant issues when other players are occupying the same instance. There can only be one master version which dictates the definitive version of the game state (that's the whole point of having a server after all, otherwise you can just have individual clients host as servers like many FPS games do because they need to transfer tons of information). This also opens up the game to all sorts of nasty hacking like D2.

You can make the game slower and more accommodating to desyncs. A good example is older MMOs like WoW. In these games your attacks always visually hit the target and the only way you know if you hit and how much damage you dealt is form the floating combat text. Your target often doesn't even react to getting hit. In these games positioning doesn't matter at all. The boss typically stands in one spot and there are no area of effect spells. Often you can even walk through other players. The environments are typically very open with few or no obstructions that would block movement. At the time, these compromises were made because it was impossible to try to synchronize a few hundred clients at once. The amount of bandwidth necessary was well beyond what the server hardware could handle. In the past few years you've seen MMOs begin to introduce some of these features back into their games like the ability to dodge projectiles or area of effect attacks because server hardware has improved to the point where it's possible to process that much data for all those clients at once.

In Diablo 3, for example, you have a less extreme version of this method. Enemies can overlap and move through each other which makes pathing about a billion times easier. Your attacks are big enough that where the enemy is on the server doesn't really matter because he'll get hit regardless. The areas are rather large with plenty of room to move and few obstructions (even the narrow corridors really aren't very narrow). Your character's positioning simply doesn't matter a whole lot in general. Even in Diablo 3 you can desync and rubberband. Often, there's so much going on on screen that you don't notice or it doesn't matter because you always hit everything anyway.

GGG wanted to make a much more tactical game where the environment could be used to your advantage. A game where funneling enemies through doorways was a viable tactic and where getting surrounded and trapped in a corner become a scary proposition. Where tactical positioning was just as important as the gear on your character. To accomplish this, GGG can't rely on many of the things that I just pointed out that D3 relies to hide desync. As an unfortunate result, PoE is more susceptible to desync and when it does happen it has more significant impact on the player's gameplay.

This is quite a post. I didn't intend for it to be this long but I hope it cleared up some misconceptions about what desync is how different game try to accommodate it.
Forum Sheriff
Last edited by Foreverhappychan#4626 on Feb 20, 2013, 11:27:49 PM
Wall of Text crits Zalm for 9999.

Zalm has fainted.
'It is good to contact a moderator if you feel someone is being a twat' Charan, Forum Moderator

Sometimes, we have to cross a ditch.
Sometimes, we have to cross an ocean.-Rhys, GGG
This wall of text caused a forum desync. Please fix.

EDIT: Great read, thanks for the insight.
GGG banning all political discussion shortly after getting acquired by China is a weird coincidence.
Last edited by Xavderion#3432 on Feb 20, 2013, 9:24:44 PM
gggdrone wall of text the post
Desync is something HC players use as an excuse when they die
"
tpapp157 wrote:
GGG wanted to make a much more tactical game where the environment could be used to your advantage. A game where funneling enemies through doorways was a viable tactic and where getting surrounded and trapped in a corner become a scary proposition. Where tactical positioning was just as important as the gear on your character. To accomplish this, GGG can't really on many of the things that I just pointed out that D3 relies to hide desync. As an unfortunate result, PoE is more susceptible to desync and when it does happen it has more significant impact on the player's gameplay.


Took me a while to read, but It should....SHOULD help the community understand....if they took the time to read it as I have. But that part? Comparing D3 to PoE desync? Spot on TP. Freaking phenomenal.
'It is good to contact a moderator if you feel someone is being a twat' Charan, Forum Moderator

Sometimes, we have to cross a ditch.
Sometimes, we have to cross an ocean.-Rhys, GGG
No TL;DR? Screw this thread!

/flips the table and storms out
"
Ikagawa wrote:
No TL;DR? Screw this thread!

/flips the table and storms out


(╯°□°)╯︵ ┻━┻
'It is good to contact a moderator if you feel someone is being a twat' Charan, Forum Moderator

Sometimes, we have to cross a ditch.
Sometimes, we have to cross an ocean.-Rhys, GGG
Last edited by Zalm#4445 on Feb 20, 2013, 9:44:16 PM
Hmph. Vaguely on-topic post trying to dethrone me as a reigning Champion of Circumlocutious Grandiloquence.

...:)

If only the people who need to read this, would. If only.

https://linktr.ee/wjameschan -- everything I've ever done worth talking about, and even that is debatable.

Huh. My mace dude is now an actual cultist of Chayula. That's kinda wild.
"
Charan wrote:
Hmph. Vaguely on-topic post trying to dethrone me as a reigning Champion of Circumlocutious Grandiloquence.

...:)

If only the people who need to read this, would. If only.



That's the problem, the people that need to read this are either too stupid to read it and comprehend it, or too busy screeching like howler monkeys and flinging their own poo around the forums. In either event, I fully support the mods/GGG in any and all applications of large banhammers to their nether regions. :-P
Please familiarize yourself with the Greater Internet Fuckwad Theory (GIFT) - http://www.penny-arcade.com/comic/2004/03/19

Realize that the only part of the equation you can affect in the GIFT is the audience. Remove the audience and the trolls merely rant at the air.

Report Forum Post

Report Account:

Report Type

Additional Info