Why constraint physics aren't lerped?

Roblox, even before filtering enabled, has always optimized physics objects by sending only after every so many frames the basic state of physics bodies. It is highly optimized, and exceeds anything we can do in Lua. A pile of bricks explode? No problem, the client interpolates keyframes of unowned bodies with ease.

But constraint physics, ragdolls especially, show that if you aren’t the owner, the constraints are jagged, snapping in place every so many frames I’d say at 10hz and there is not much we can do about it as far as I know.

I am thinking of some hackyness to make ragdolls drawn locally for all users. Though Roblox physics are not deterministic, the acute position of a dead characters limbs are not of the greatest importance. Maybe I can get away with this?

Suggestions?

2 Likes

If the main focus is smoothness, and you don’t need to interact with the dead character, I would do it all on the client.

You could make sure that the root of the character remains fairly consistent across clients by compensating and tweening to the correct position before the ragdoll has landed, but individual limbs and the absolute final position are beyond your control if smoothness is number 1.

2 Likes

Player1 presses E to ragdoll, server tells everyone to ragdoll their copy of Player1’s character.

But what about Player1? If he ragdolls his character it is going to replicate. Do I have to hide his character from him and add a local clone to ragdoll? One that does not replicate unintentional things?

In this case, I would probably clone the character and delete the character locally instantly, at the same time as telling the server, and then the server can inform all clients who also make clones of the character and ragdoll it. Some thought needs to go into exactly how these clients will get the character as you will need to remove it or ragdoll it on the server too so that anyone who joins the game post-ragdoll sees the ragdolled character.

It’ll be complicated for sure. One of the issues when working with a character. An extreme alternative is to create your own custom character with your own character controller and make everything happen locally for everyone, but that’s a lot of work too.

In all honesty, I would personally just let Roblox replicate it and accept the ~10Hz snapping, but I don’t know how crucial this ragdolling is to your game.

1 Like