Multiplayer-focused arena third-person shooter (TPS) game

Hi Yonnji,

Can you elaborate on how you got the client side prediction working? When you run the physics in the future is that run on the server and then the characters position is interpolated on the client side? Sorry I never quire understood client side prediction.

The physics are running on both client and server with the same step. It’s 16 steps/ticks per second at this moment. I’m testing on a fewer number of steps, so I could increase tick-rate later to 32Hz and then up to 128Hz.

The client’s rendering frame rate is higher that tick rate. No one really want’s to play a game in 16 FPS, so I just interpolate the character’s position without running the physics engine to already known position in the future.

I also recently made a custom animation system. With this system I can calculate the animation’s frame for the next tick on both client and server. So I can sync animation’s frame from server to client and then interpolate it on client.

So are the client and server physics always in sync?
And how do you know what the future position of the character is?

Yes.

Bullet physics engine are telling me the character’s position for the next tick.
Something like: position += velocity * dt
dt (delta time) is constant, it’s 0.0625 seconds at 16Hz tick-rate.

Game development progress visualization, 4+ years in 6+ minutes - https://www.youtube.com/watch?v=zcOkB3xLNEg

1 Like