Client-side input prediction for responsive multiplayer.
Applies inputs locally immediately, then corrects when server confirms.
Usage:
constprediction = newInputPrediction(); // On local input: prediction.addInput({ seq:frameNum, input: { moveX:1 }, predictedState:currentState }); // On server confirmation: prediction.confirmInput(serverSeq, serverState); // Get correction if needed: constcorrection = prediction.getCorrection();
Client-side input prediction for responsive multiplayer. Applies inputs locally immediately, then corrects when server confirms.
Usage: