Hello all, I’m currently in the process of writing a networked FPS. I’ve got the very basics set up, ie. walking around and client-server syncing with an authorative server, position interpolation and lag compensation. I’ve read the Source articles etc… I’m using physics on both the client and server, and the client performs the actions immediately as well as sending the inputs to the server. My problem is how to adjust the client’s position when it is invariably slightly different to what the server says it should be. Both sides use the BetterCharacterControl. I originally used warp() on the client side, but this can introduce problems like moving the player through a wall, and also made the client jittery.
Adjusting the BetterCharacterControl by setting the walkDirection seemed ideal, since I theoretically can set it to the difference between the client and server positions (or a fraction of it). However, this is not an exact science (that I can see). For example, if the difference between the client and server is Vector3f(1, 0, 0), just adding this to the walkDirection doesn’t properly correct the clients position as it often overshoots or something. I think this is a due to walkDirection implementing its own acceleration, among other things.
So, in a nutshell can anyone please help and tell me the best way to sync a client’s BetterCharacterControl position against a server’s BetterCharacterControl? Thanks a lot in advance.