Custom pawn movement replication

I have “Cursor” pawns, derived directly from APawn, one per player, that can hover the play area. I’m trying to come up with the most efficient replication scheme for the movement.

Client-side prediction is essential for snappiness. Furthermore, there is no reason for the server to ever invalidate the position chosen by the client, the reason they are replicated is only to show other players what you’re doing, but they can’t collide.

So, what I have so far is a server UFunction that receives updates from the client and moves the server Pawn. I enabled “Replicate Movement” so that other clients also see the update.

The issue is with network lag. Since the client who sent the location update will eventually get an authoritative location update from the server, if the lag is important, it will reset the current location to an older one. So how can I, from the server, choose not to send an update to one client in particular?

There might be a better solution to this.

I don’t currently have anything useful to add (working on replication issues myself), but I’d like to hear the result if you come up with a good solution.

Well, I turned off the automatic location replication option, and am doing it manually. Whenever I get an update from the server, I check to see if the given controller is locally controlled ( GetController() && GetController()->IsLocalPlayerController() ). In that specific case, I ignore the incoming data.

This means I’m wasting some bandwidth.