Technical solution to eliminate desync in single-player sessions

"
Rhys wrote:
"
Yimi wrote:
Why does desync seem so prevalent in Path of Exile while it seems to be much less of an issue in Diablo 3?

Technically off-topic, so I'll reply in spoiler tags...
Spoiler
Diablo 3 has several tricks that alleviate desync (last I checked):
-You can't miss with melee attacks
-You can't move out of the way of melee attacks

These things allow the client to more reliably predict the server calculations, but make combat more shallow.

They also don't really have narrow corridors or doorways to the extent we do, which also helps a lot, though you lose the feeling of claustrophobia such level features create.

In other words, there are pro's and con's.

Diablo 3's combat feels smoother, I think, for three reasons:
1) Cut combat animations
Many combat animations (weapon swings, attacks, spells) don't naturally blend from the idle/run animations. They deliberately *cut* to a keyframe in a dramatic pose, which then flows into the rest of the attack. Path of Exile's combat animations transition smoothly from idle to attack to idle.

2) Skipping utility animations
Some animations only play if the player is standing still. For example, casting buffs or curses. If the player is running or attack at the time, the spell goes off with NO animation at all. It doesn't interrupt the existing combat. In contrast, in Path of Exile, you have to stop moving and wait while you Enduring Cry/Curse/etc.

3) Input queuing
Diablo 3 has a deceptively clever input queuing system. Suppose you are spamming right-click a lot to keep doing one action, then press a key to do another, then go back to spamming right-click. You can't just queue every key-press, otherwise you'd be stuck performing the right-click action a million times. But even if that solitary key-press was made at a "bad time" i.e. during another action (at a time when you couldn't immediately do anything new) you do want to queue up this new action once before going back the spam. In Path of Exile, this extra action frequently gets lost in the spam, making you feel like the skill didn't work for some reason.


Animation cancelling is pretty fun though. It makes the game more smooth and adds (a slightly unintuitive) another level of depth to the game.

Its useful in Diablo 2, 3 league of legends pretty much everywhere.

Do it Rhys, put in animation cancelling!
Do you know how much effort League of legends puts into animation cancelling and improving animation responsiveness?
Last edited by xXx_EliteHardcorePro_xXx on Nov 19, 2013, 12:33:23 AM
"
Rhys wrote:
"
Yimi wrote:
Why does desync seem so prevalent in Path of Exile while it seems to be much less of an issue in Diablo 3?

Technically off-topic, so I'll reply in spoiler tags...
Spoiler
Diablo 3 has several tricks that alleviate desync (last I checked):
-You can't miss with melee attacks
-You can't move out of the way of melee attacks

These things allow the client to more reliably predict the server calculations, but make combat more shallow.

They also don't really have narrow corridors or doorways to the extent we do, which also helps a lot, though you lose the feeling of claustrophobia such level features create.

In other words, there are pro's and con's.

Diablo 3's combat feels smoother, I think, for three reasons:
1) Cut combat animations
Many combat animations (weapon swings, attacks, spells) don't naturally blend from the idle/run animations. They deliberately *cut* to a keyframe in a dramatic pose, which then flows into the rest of the attack. Path of Exile's combat animations transition smoothly from idle to attack to idle.

2) Skipping utility animations
Some animations only play if the player is standing still. For example, casting buffs or curses. If the player is running or attack at the time, the spell goes off with NO animation at all. It doesn't interrupt the existing combat. In contrast, in Path of Exile, you have to stop moving and wait while you Enduring Cry/Curse/etc.

3) Input queuing
Diablo 3 has a deceptively clever input queuing system. Suppose you are spamming right-click a lot to keep doing one action, then press a key to do another, then go back to spamming right-click. You can't just queue every key-press, otherwise you'd be stuck performing the right-click action a million times. But even if that solitary key-press was made at a "bad time" i.e. during another action (at a time when you couldn't immediately do anything new) you do want to queue up this new action once before going back the spam. In Path of Exile, this extra action frequently gets lost in the spam, making you feel like the skill didn't work for some reason.


PoE is more similar to D2 in that regard. Anyone that played D2 online will surely remember the black wall of death, which was the client becoming out of sync with the server if I'm not mistaken.
Last edited by Malero on Nov 19, 2013, 12:34:15 AM
"
Rhys wrote:
As the programmer responsible for maintaining the client/server synchronization of the random level generation, I can tell you that this sounds like a nightmare, for a few reasons.

1) The server must validate the snapshots in real-time, not once the client leaves the instance. This is because the client can potentially muck around in one instance for huge lengths of time. Hours, days, weeks even, if the realm stays up. Processing so much all at once would lag the instance to hell and back, and changing areas has to wait on this task. Also, you will still need the ability to resync players to a recent state, when desync inevitably occurs (see next point). Also also, you need to be able to save the player's data at a moment's notice to prevent item dupes with trading.

2) Floating-point calculations will still cause desync. Suppose the client needs to perform a mathematical calculation, such as 37 / 13. The client determines the result to be 2.84615384. But when the server performs the same calculation, with the same values, the exact same bit-patterns inputs, it might instead return 2.84615385. The numbers are slightly different. Why would it do this? There are several reasons: Windows client vs. Linux servers. Different CPU architectures. Different optimizations compiling the servers vs. client. Different system drivers. Whatever the cause, you now have a divergence point, where the simulation may or may not diverge, depending on how those values are used and rounded. In that example, rounding to an integer afterwards isn't a problem, but what if the two values were 7.499999 and 7.500001? One will round to 7 and the other will round to 8. Suddenly the tiny difference isn't so tiny, and so even legit players can end up desynced.

3) The client would effectively have the ability to see into the future. A hacked client could predict when hits, crits, evades, and dodges will occur, so a player could alternately attack minions/bosses, or even just pause a certain number of milliseconds, to ensure they are almost never hit by strong attacks and almost always crit against the boss. In both of these cases, the final simulation is perfectly legitimate, so the server cannot know the client is cheating, unless you want some statistical system that punishes players for being "too lucky", which will harm legit players who get an actual lucky streak.

If item creation and currency use is done from the server, then you have monsters only dropping items 2-3 seconds after they die, and waiting 2-3 seconds for every currency item to take effect, since you have to wait for the next snapshot to be verified (and on a turbulent connection, that could be a while). Using (say) 1000 Fusings to try for a 6-link would take forever (you couldn't spam shift+right-click).

4) How do you detect death? You can't rely on the client sending the "Oops I died" packet. Otherwise hacked clients would never die. The server must be able to continue the simulation without the client, and determine when a player dies. This means that the server must keep simulating "the future", and client commands occur in "the past", which then changes the simulated future (like what Valve's Source Engine does). Now, you suddenly need the ability to effectively "rewind time" as far as the simulation is concerned. This is not a trivial task, at all.

5) This entire system breaks down completely as soon as you have more than one player. Anytime one player moves or hurts a monster, everyone else is automatically desynced and must be jolted back to the last verified snapshot. This is because you cannot recover from small amounts of desync, since even tiny differences completely change the RNG and state hash.

The "rewinding time" mechanic would somewhat solve this, but you would STILL get desync (just like in Team Fortress 2 and other Source Engine games). The classic example is being headshotted through a wall, because even though you successfully took cover on your screen, you didn't on the sniper's.

Also, what happens when the level geometry is different for different players? For example, if one player has destroyed the Undying Blockage in the Sewers, then the corridor is clear for them, but another player who hasn't done that will have the corridor blocked. The simulations for projectiles and movement will be VERY different on each client, so which one does the server think is correct?

6) Maphack would be even easier, and better, because it could show all the monsters and chests and items on the map, too.

Just my 2c.


Long and informative. You gave source engine as example. How about D3? I did not get desync as Poe in that game.

Secondly, I had less desync before release. So don't you think problem is your servers? Maybe your servers can't sync as often as it used to be?

Third, I play at prime time. I am in Europe and my instances keep opening at USA even though I log in to game from Europe gateway. If you add additional server, my instances can be opened at Europe and I can have less desync, can't I?

As side note, there should be other ways to prevent cheating than your way. I am disagree with yours. It just kills experience of legit players.
Last edited by necrocavus on Nov 19, 2013, 1:47:53 AM
Wow, I left this topic at about level 20 I think when I went home.

Now we have 40 pages and solid replies from everyone. This is awesome.

I do feel like I have to remind people that the posts by Qwave ONLY relate to making single player a better experience.
this thread turned out to be a treasure trove of information.
and a great read at that.

all I can say is, I now appreciate GGG more than before.
not every company would let it's users glimpse "under the hood" like this.

but my main complaint to GGG was and still is the design path they took, rather than technical issues, no matter how severe.
Alva: I'm sweating like a hog in heat
Shadow: That was fun
"
Malero wrote:
PoE is more similar to D2 in that regard. Anyone that played D2 online will surely remember the black wall of death, which was the client becoming out of sync with the server if I'm not mistaken.


Well, I'd be interested by the comparison with D2. Personally, I only met the black wall when I got disconnected, usually because I lost connection (I mean internet connection, not only the D2 servers). And I might be wrong, but you could also miss a hit in D2.
"
Sexygillou wrote:
"
Malero wrote:
PoE is more similar to D2 in that regard. Anyone that played D2 online will surely remember the black wall of death, which was the client becoming out of sync with the server if I'm not mistaken.


Well, I'd be interested by the comparison with D2. Personally, I only met the black wall when I got disconnected, usually because I lost connection (I mean internet connection, not only the D2 servers). And I might be wrong, but you could also miss a hit in D2.


Hmm... I remember getting them quite a bit with teleport and with a lot of run/walk speed. You may be right, though. When I was in High School, we had dial up. So that may have been the real problem.
"
johnKeys wrote:
this thread turned out to be a treasure trove of information.
and a great read at that.

all I can say is, I now appreciate GGG more than before.
not every company would let it's users glimpse "under the hood" like this.

but my main complaint to GGG was and still is the design path they took, rather than technical issues, no matter how severe.


Yes, it was interesting. Unfortunely for me, the only look "under the hood" that would really make me pleased is the probabilities that govern item drops, mod distribution and to a lesser extent the effect of whetstones and scraps on fusing and socketing.
This message was delivered by GGG defence force.
"
Malero wrote:
Hmm... I remember getting them quite a bit with teleport and with a lot of run/walk speed. You may be right, though. When I was in High School, we had dial up. So that may have been the real problem.

Thinking about it, the best example of desync in D2 was seen in pvp (but also a little in pve) using charge, or high walk speed + abuse of switch weapon. Was much better than poe anyway.
"
Rhys wrote:
"
Yimi wrote:
Why does desync seem so prevalent in Path of Exile while it seems to be much less of an issue in Diablo 3?

Technically off-topic, so I'll reply in spoiler tags...
Spoiler
Diablo 3 has several tricks that alleviate desync (last I checked):
-You can't miss with melee attacks
-You can't move out of the way of melee attacks

These things allow the client to more reliably predict the server calculations, but make combat more shallow.

They also don't really have narrow corridors or doorways to the extent we do, which also helps a lot, though you lose the feeling of claustrophobia such level features create.

In other words, there are pro's and con's.

Diablo 3's combat feels smoother, I think, for three reasons:
1) Cut combat animations
Many combat animations (weapon swings, attacks, spells) don't naturally blend from the idle/run animations. They deliberately *cut* to a keyframe in a dramatic pose, which then flows into the rest of the attack. Path of Exile's combat animations transition smoothly from idle to attack to idle.

2) Skipping utility animations
Some animations only play if the player is standing still. For example, casting buffs or curses. If the player is running or attack at the time, the spell goes off with NO animation at all. It doesn't interrupt the existing combat. In contrast, in Path of Exile, you have to stop moving and wait while you Enduring Cry/Curse/etc.

3) Input queuing
Diablo 3 has a deceptively clever input queuing system. Suppose you are spamming right-click a lot to keep doing one action, then press a key to do another, then go back to spamming right-click. You can't just queue every key-press, otherwise you'd be stuck performing the right-click action a million times. But even if that solitary key-press was made at a "bad time" i.e. during another action (at a time when you couldn't immediately do anything new) you do want to queue up this new action once before going back the spam. In Path of Exile, this extra action frequently gets lost in the spam, making you feel like the skill didn't work for some reason.


So you cant dodge enemy melee attacks by side stepping in D3? Well, here's the plot twist! NEITHER CAN YOU IN POE DUE TO DESYNC!

So... what did you achieve? I know on paper it's beautiful, but in reality it's just crap.
imho...

Report Forum Post

Report Account:

Report Type

Additional Info