I’m not looking for any code here just some high level discussion. Unless you happen to have a link to an example already.
I’ve taken a look at the shooter game example, which I believe does not do lag compensation on the server when computing shots.
I’ve seen some examples of network movement with client side prediction using UCharacterMovementComponent.
Usually to do lag compensation the server needs to keep a series of snapshot locations. Plus its useful if the server computes the same interpolation between snapshots that the client would use, and rewind to that interpolated state when detecting a shot.
Just using UCharacterMovement only covers the movement with client prediction and reconciliation. We could make the server also record snapshots. However the tricky part is knowing how to properly rewind to snapshots on the server. This is becuase all the movement of other players in the GS.e is hidden behind an abstraction and we don’t really know how the interpolation is done on the client side. I assume it’s using entity interpolation and not ded reckoning.
I was wondering if some light could be shed on this. We would need to provide a timestamp when the shot was fired to the server and know how to properly map that back to a snapshot which matched the client’s state/interpolation when the shot was fired.
I’ve been able to implement this from scratch on unity (I implemented the prediction, reconciliation, interpolation and lag compensation), which we could do here as well. But I was wondering if it would be possible to still leverage the built in networking tools like UCharacterMovement and also have lag compensation shooting.