ragdoll physics over the network

Any idea how to implement this? Put a NetworkView on each body part perhaps?

No, don’t bother, this is overkill.

If you have a ragdoll physics added to a character, just send character state across the network, it doesn’t matter if I see the arm in the same place you see the arm, it only matters I see the character falling down or what ever.

It is like an animation sequence, as an example, I have 10 animations applied to a character, all I send across the network is the id of the animation sequence, the player that receives the sequence then uses that sequence to trigger that animation.

Same concept for the ragdoll, let the recipients computer deal with the physics, just send a message to the recipients telling them what you are wanting to do or have done. This is as simple as stating NPC.Ragdoll = true, vs NPC.Ragdoll = false.

Its not overkill.

The problem is synchronization. If the clients determine the body parts’ positions by themselves they will likely be different from each other.

If in one client the ragdoll lands on its backside and on another client it lands on its front, then the ragdoll position isn’t synchronized.

I suppose I should at least synchronize the transform.position and/or the spine rigidbody but let the limbs’ positions flail unsynchronized among the clients.

Keeping it simple as you have stated will reduce the amount of data that has to be kept in sync and will keep the ragdolls at least facing the same way. Unless the players are in the same room, I wouldn’t think it would matter imho, only thing I would imagine you would really care about is the transform position so that the ragdoll at least is in the same xyz spot. I don’t know what you are making so I do not know how much detail you want each person to see and be in sync with.

Just activate the ragdolls at the same time on each client and hope the physics are consistant instead of random. =P

It will be random

1 Like

The question is, how important is the synchronization of ragdoll physics to your game?

For instance, in Halo, ragdoll death physics are calculated by the individual clients, so no two people see the same random physics… But does it really have any impact on the gameplay?