Persistent animation replication on multiplayer

Hello everyone, i’m struggling to understand how to replicate an animation in order to mantain it persistent.
I’ll explain my self better. I have an actor in scene that plays a 30s animation, I understood how to replicate it to everyone. My problem begin when a player join the session after the animation started, how can I replicate the animation in order to keep it persistant, so even if a player rejoin or join later the session will see the animation in sync with the other players?

Clients will never fully sync up do to ping, loss, jitter, processing delays, hard/software performance differences and so forth.

The best you can do is pass a time position to the late joiner.

For example, when the actor that plays the animation is fully loaded it needs to request the current play time of the servers animation. On receive you need to calculate the delay that was inherited and add that to the play time value.

So say you have a 56ms ping. Packet sent from the server to you will take roughly 28ms. Then there’s processing delays. Packets are not processed in the same tick they are received. They only process at “start” of tick.

Pass the servers game time and anim current play time back to the client. Using the servers game time you can compare to your game time and get the difference. Add that to play time.

From there its simply playing the animation at a specific start point.

Even doing this with a more accurate network clock you’ll still be out of sync by varying margins between clients and server.

Thanks!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.