Currently I'm participating in a multiplayer game project as a network developer. Unfortunately, however, I'm facing an interpolation problem which makes game objects look like they are 'jumping/teleporting' sometimes. Images don't look smooth compared to the server even if the client runs at 60 frames per second.
Things about the architecture:
- Based on client/server model. server sends regular transform updates at every 33 milliseconds (30fps).
- Client receives and stores position updates in a queue. then, plays them from 1 second behind using interpolation between each update.
- Before processing the next packet, client calculates the sent time between current and next packet to find out how many milliseconds this interpolation should take. at every frame, it deducts the delta time from the interpolation time. so, if interpolation time reaches a number equal or less than zero, it iterates to the next packet (if the value is less than zero, it means that there is a time fragment. so the client also considers that time fragment for interpolation of the jumped packet at the same frame.)
- Client doesn't deal with rigidbody; only position and rotation.
I'm using Unity3D's LERP method from the Vector3 class. Using SLERP didn't solve the problem.
Any ideas? Everything looks great on paper.