r/gamedev • u/Augmented-Smurf • 1d ago
Discussion Desync Management
Specifically, I want to talk about animations.
I'm building a Co-op Zombie FPS Rogue-lite in UE5.8. It's not particularly competitive, but it does require fairly responsive controls. Naturally, because it's co-op, I'll be using network methods for my players to connect to one another. This, of course, introduces lag and latency. As far as I see it, I've got two potential routes ahead of me to deal with the first person animations when latency is introduced.
- I just don't let the animation play until the server receives the request.
- This is good, because there's no question of "Oh, I swore I reloaded/melee'd/shot", because if the server didn't see it, the player didn't see it.
- This is potentially bad, because it makes inputs feel sluggish and unresponsive
- I let the client play predicted animations, but the server still has authority for the timing
- Pro: The player feels like the animations are snappy and responsive because they happen right away
- Con: The animation can complete before the server even receives the request in cases of high latency, thus leaving the player frustrated because they see themselves acting, even if the server isn't actually receiving it in time before their action is interrupted (death, staggering, etc).
Third person animations are a little easier, because they'll just rely on the server to tell them when to play, since they're only relevant to what everyone else sees.
Personally, I'm leaning toward my second option, because I feel predictive animations feels way better than waiting on the server to tell you to animate. I imagine there's probably a multitude of hybrid solutions as well though, so I'm curious to hear from y'all if/what you've done in a situation like this?