Replication delay when ragdoll knockback

I’ve been struggling since yesterday with my M1 and ragdoll system. Everything works perfectly overall, but I can’t seem to find a solution to a small delay that occurs when the attacked player is knocked back.

The attacked player gets hit and launched smoothly as intended, but the attacker sees a delayed version of this knockback. I understand this happens because the server is handling the physics, and I know it can be configured using NetworkOwnership. However, I haven’t been able to find the exact or similar method used by smooth combat games like The Strongest Battlegrounds to achieve responsive knockback with good performance on both clients.
Any help is appreciated!!

I’m not sure if you still need help with this, but I think what you want is something called “rollback netcode”.

What this is is pretty much you put your ragdoll and knockback system on the client and the server. Then, you run them both simultaneously, and the client will tell the server client info like inputs. But because of network latency, the client will always be slightly ahead of the server. This is called the a prediction.
Like I said earlier, the client will send any client sided data (like inputs) over to the server, and the server will process these values, just the same as the client.
Finally, the server tells the client where it was supposed to be in that frame, which is a few frames ago on the client, and the client then compares where it was on that frame on the client to where it is supposed to be (what the server says), and if the client is off (maybe the position on the server is off from the position on the client), then the client “rewinds” back to that frame, but with the new server approved positions and values.
Then the whole system runs forward from there, correcting it’s self when off with server approved actions, but still feeling responsive with client predictions.

This is a very rough idea of “rollback netcode”, and also I just learned this like a week ago for a game I’m making, so I would recommend looking into this yourself either on the devforum, or just online, since there are probably better explanation out there than this one.
But hopefully this gives you an idea on how to fix the delay with your game. I’m pretty sure this is how many big games deal with keeping things server approved, but still feeling responsive.
If I didn’t explain something well, or have any questions, just ask, and I’ll try my best to help, but I hope this could solve your problem!

Also, there’s a setting in studio settings called “replication delay” or something similar to that, that allows you to adjust your network latency, and can be really helpful for testing. So I recommend using that when your testing stuff related to replication.

Yo
still struggling with this but your method caught my attention, ill have in mind as a possible fix. I don’t wanna sound lazy but im pretty sure there has to be an easier fix, I at least want to achieve something similar to jujutsu shenanigans ragdolls


not the smoothest and in fact quite snappy but pretty responsive, more than what I have.

This serves as a little update, I had seen it on other posts with my similar issue and some suggested solution were simulating the knockback instantly from the attacker’s client, so I came up with this.

local RS = game:GetService("ReplicatedStorage")
local FakeRagdollRemote = RS:FindFirstChild("FakeRagdollRemote")
local RunService = game:GetService("RunService")

FakeRagdollRemote.OnClientEvent:Connect(function(model, dir)
	
	local root = model:FindFirstChild("HumanoidRootPart")
	if not root then return end

	local startCF = root.CFrame
	local targetCF = startCF + (dir * 4) + Vector3.new(0, 0.5, 0)

	local duration = 0.15
	local elapsed = 0
	

	local conn
	conn = RunService.RenderStepped:Connect(function(dt)
		elapsed += dt
		local alpha = math.clamp(elapsed / duration, 0, 1)

		root.CFrame = startCF:Lerp(targetCF, alpha)

		if alpha >= 1 then
			conn:Disconnect()
		end
	end)
end)

the code speaks for itself
so the plan was to, before applying the ragdoll execute this and that would somewhat hide the delay, I got this.


yeah not really sure if to call it an improvement.

Your idea I think could definitely work, but I see just one problem with your code that sort of defeats it purpose.
For the event you receive, you use .OnClientEvent, which I’m guessing means you receive an event from the server. But the thing is, when the server sends events, there is still network latency, which is what you are trying to get rid of now.
There is a simple fix though, all you have to do is change the RemoteEvent to a BindableEvent, then instead have something on the client fire it, so there is no network latency. I would probably put it near where ever you tell the server that you punch, and hopefully that can help.
I’m not fully sure that this will help, but maybe it will.

But don’t feel lazy for not doing it the way I said, I struggled to explain it, so it probably isn’t any easier to implement it.

So, maybe try my change, and hopefully it helps!

Could you tell me what exactly your current method is? Are you just applying the knockback on server? And what instance are you using? BodyVelocity? LinearAssembly?