So I’ve managed to get a basic multiplayer ragdoll system working, but there’s a small issue and I was hoping someone could give me information and point me in the right direction.
So everything works great, except that when ragdolling, the replication stops and the physics/model goes out of sync. I’ve read that this is because replicating physics is a nightmare, but is there a way to do it? Even if I have to use very simple “gang beasts” style models?
Hey there @BenWesty90! The short answer would be “Not easily”. The long answer is slightly more complicated. It starts with the explanation that physics in Unreal aren’t deterministic, so between clients there will be massive differences. Without an incredibly skilled engineer, you won’t really be able to produce deterministic physics. The engine itself natively will not replicate physically simulated SKMs once they’ve began ragdolling. You can however handle this yourself, but it can be tough to do well.
I’ve got something setup to at least always match the location of the ragdolls. This works great for the client, with the ragdoll always being in the same location as the server (although only for location of the pelvis). However, this causes issues when the server-client ragdolls, as it’s just setting its pelvis location to its own current pelvis location.
I believe I have solved it by changing the “Run on client” events to Multicast, and then setting a Has Authority switch to only run the event if it’s false. I wonder if this then breaks something else though…
Great work! My recommendation was going to be to use the Has Authority split for clients and only handle the server requests, but it seems you worked it out. I don’t believe any major bugs should arise from doing it that way as long as you keep the actual positional calls coming from the server. Though I would definitely test it thoroughly though, just in case.