NetCode: need help with prediction

I’ve been trying to figure out prediction using the Netcube sample, but I’m not sure if it’s working in that project. When I try moving the cube around with any amount of delay, I can clearly see some network jitter happening. The problem is visible with a 50ms delay, but here’s with a 500ms delay to make it obvious:

Here, I only move a few meters to the side with my input. But then half a second later, the netcode makes me go back to where I started and move again. This means prediction isn’t working as expected (?) It’s as if my pos/rot received from the server just got reapplied without actually re-running the prediction frames to fast-forward to the present.

Does anyone know if this is normal and/or how to solve it?

I also kinda have a side-question to go with this: am I correct in assuming that all the physics systems (Build + Step + Export + End) should be moved to the prediction group if we have predicted character controllers that can collide with each other?

I’m thinking the issue with collision world history in this case would be that it wouldn’t be updated to reflect the new data we got from other characters since the physicsWorld snapshot was taken

This is a problem interesting but complex, need help…

@PhilSA I am not sure if this is still causing you problems but I would need to see your prediction code to know for sure. I am not seeing anything like this in my own personal project so I skeptical it’s an in-built flaw.

Regarding physics, I believe that physicshistory is recorded for any fully simulated frame and thus your prediction code is meant to request the collision world snapshot associated with the currently-predicted tick looking something like this:

collisionHistory.GetCollisionWorldFromTick(predictingTick, interpolationDelay, out CollisionWorld world);

The code for the Physics portion of the NetCode package is pretty small and relatively understandable so I’d suggest taking a look yourself. There are even some considerations in comments that are not written anywhere else. Perhaps @timjohansson can confirm.