In my online game I am using client prediction and client interpolation to give the illusion of responsiveness over a networked connection.
The client prediction works by applying inputs that haven't yet been acknowledged by the server to incoming server states. When the input does get acknowledged, the client's entity will already be in the final position.
The client interpolation works by buffering snapshots of the world and rendering all of the entities 100 ms in the past. As long as a new snapshot arrives within the next 100 ms, there will always be valid data to interpolate between.
My problem is that the responsiveness gained from client prediction is lost due to client interpolation. The client's local inputs are applied to incoming server states. However, those incoming states aren't actually rendered on the client until 100 ms later, due to the client interpolation. The result is that there is always a 100 ms lag between pressing a key and rendering the change to the screen.
How can I get the best of both worlds, where I am rendering entities in the past, but the client's inputs are rendered instantly?