Playing animation seamless on server

  1. What do you want to achieve? Keep it simple and clear!

I am developing a bowling game with realistic pinsetters w/ realistic motion. To achieve this motion I have turned to rigging them and animating them with 2 seperate animation tracks, the Sweeper, and the pin setting deck. I am wanting to achieve seamless/synced motion across all clients while still being able to utilize the animation events that trigger server events, ex:

Sweep animation reaches point to drop pin setting deck → play setting deck animation
Setting deck animation event tells lane controller to set new pins .

  1. What is the issue? Include screenshots / videos if possible!

In larger servers, or when the pinsetter may not be in any players viewport, the animations seem to ‘get lazy’ and play off sync, EX: Pin Setting Deck animation starts a second or two after the sweep animation event fires. I am unsure if this is the animation not being loaded in time, or the animation event not firing in time.

  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

I have searched devfourm and countless other sources and have come to no solution due to the sheer uniqueness of my situation.

Hi, you can use :GetMarkerReachedSignal(). You could do anything you would like at any given point in an animation so you don’t have to worry about getting offsync.

For a complex animation such as this, it is not feasible to handle it on the server (especially on Roblox) as the server does not have perfect connection to its clients, and latency can differ in between frames.

You should instead be sending events to clients that then manage the playback of the animations themself. This also allows you to optimize a bit (for low end devices or a low graphics mode, etc) since you now have control over where the animation is played on the client.

Unfortunately due to the nature of animations and Client playback, it may act rather finicky without the client that is replicating it having Network ownership over the rigged model, which can very quickly cause issues.

1 Like

I get what you are saying, but these animation events need to precisely be fired, as they handle crucial things such as the setting of pins. Is there any way to ENSURE that the server is able to handle the event on time while also perfectly syncing across all clients? If you’d like to learn more on what I’m looking to achieve check out Bowling Paradise on Roblox, as they are achieving what I am trying to using animations.

I believe there is no way to perfectly sync animations across all clients, there will always be somewhat of a delay. You should play all the animations on the client so the animations don’t play offsync.

The server can handle the time if you use a tick or os.time() value to relay timestate to the clients, but, the issue with sync is that it may require sending the time value several times the realtime expectancy of the system out of sync, basically, you send when to play said animation, synced for all clients, via prediction, and send it give or take 10 seconds early to compensate for latency, then the client simply replicates the animation to itself.

Realistically, on Roblox especially (due to the inability to optimize the netcode of your game server to fit your needs), you cannot expect to get a good server handled animation.

Animations are also far more expensive than you think for a server to be running. They are already splitting up millions of Roblox servers on their datacenters, and resources can grow limited very fast in that type of environment.

I’m just curious as to how Bowling paradise did it almost so seamlessly! Just take a look at that game and you’ll see, those pinsetters are so smooth!