I’m in the works of creating a ragdoll system on the client however I have an issue, wondering if anyone knows the best way to solve it,
My ragdoll system is on the client, essentially I clone the character of a player I want to ragdoll and ragdoll that clone for instant response time, the problem is, on the client the actual player is still there and hasn’t been killed yet due to delay, How do games like MM2 handle this?
It would be best to actually make the ragdoll on the server, if youre cloning it then other clients wouldnt be able to see it. I have a ragdoll script if you need it, i clone it on the server when someone dies, making the clone and shortly following of the deletion of the character and it works smoothly.
I figured on the client is more optimized right? also I am currently replicating to all clients so other clients will be able to see it, and on the server there would be a delay
just recreate a rig on the client that looks like the avatar on the server instead of cloning it, else you can just create it on server but set the network owner to the client who originally send the request
If you’re creating it on the client, triggered by death, why not just delete the character on client when you’re creating the ragdoll? It’s going to be destroyed anyway.
Good point, thats a possibility but there are rare exceptions when the server disallows a kill, maybe due to ping/sanity checks, so destroying the character could cause some issues on that client if the server fails to register the kill?
This would only be an issue if you’re predicting the death on the client before it actually happens on the server. When it’s something that important, it should never be predicted.
You should be firing a remote from the server, to tell the clients someone has died and to create the ragdoll to ensure that it doesn’t happen.
Every game has this delay, it is impossible to get rid of it. They just use clever tricks to hide it from the player.
For example, say I had a gun and my ping is 80ms (0.08 seconds). If I shot someone and they died, if I see a short delay before they ragdolled, it might not feel responsive. But, if I add a 0.1 second impact particle with a hit marker and thud sound instantly on the client, the impact felt impactful and responsive and I don’t even notice the 0.08 second delay before the enemy ragdolled.
The goal is to hide the delay, not to get rid of it (since it’s impossible.)
Yep, but the impact effects are what makes it feel responsive, so make sure to utilize them. Heres a little example of no impact effects vs impact effects. This is knockback, not ragdoll but the general idea is the same.