Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

What are ways/methods to replicate animation to all players w/F.E using CLERP?

Asked by 8 years ago

What is an efficient way/method to do it? Not asking for the script but ideas. Please pin some ideas?

I was thinking of handling all animations locally but the question is how should it be done? Ideas?

1 answer

Log in to vote
1
Answered by 8 years ago

With FilteringEnabled, you need to consider 2 methods:

  • Replication state
  • Replication event

State

Replication state is what Roblox defaultly uses. The entire state of all (modified) properties in the game is serialized and sent over the network. This includes details such as the physics state, for physics prediction. Without FE, the client also sends back their state, including all of their input and all of their data on the physics. This is combined on the server with a little authoritative logic (Who owns what; who knows what best; who touched this; etc) to produce what you're used to: Almost seamless networking with reasonable stability, and nasty messes with some things that replicate all the time.

Events

Replication events describe details such as when the server tells a sound to play. The server tells the client to play the sound in question, but the server has no clue if the client is even playing the sound or how long the sound is - The server never actually plays the sound. If an explosion happens, the server tells the client that an explosion happened and where, and then replication state normally sorts out the physics to accompany it. Animations, particles and various other methods all (should) use the same system.

How do you go about this?

Use replication events. Tell the clients when the animation starts and ends, and use a timestamp so that the client knows when the animation started, so that it can line up the animation with the other clients. Handle the animations locally, but make sure to tell the server, and make sure that the server tells the other clients. Don't rely on replication state to tell the client how the animation looks, because it'll lag and it won't play nice with the network.

0
Ok I almost got it. Except I'm not so sure about the timestamp part. Can you elaborate on the timestamp part: why is it necessary, what would happen if we don't have it, and how should it be implemented? I just need those explanations and I'm in the clear. Thanks for responding, so can you answer that? Arithmeticity 167 — 8y
0
You can use tick() as your timestamp. Players can work out the tick() diff compared to the server to decide things User#6546 35 — 8y
0
Yes but: why is it necessary and what would happen if we don't have it? Can you answer that? Arithmeticity 167 — 8y
0
If you don't have it then the network will be out of sync. Animations will be in different places on different clients. User#6546 35 — 8y
Ad

Answer this question