Multiplayer - local Player Prediction
Posted: Tue Nov 04, 2014 9:03 am
You've probably already have this planned, so i'll keep it short.
I understand how the netcode works in this game (Sending inputs for future ticks, making everything deterministic, synchronized random generator (if any exists)). But there is an annoying side effects that can be easily fixed - delayed movement.
Basically, what you'll want to do when the local player tries to move is to instantly move the player and camera visually, before the actual tick that is played. While keeping all game logic calculations with the real position in mind (this is only a "cosmetic" thing). Every tick you'll want to compare the predicted position(of <latency setting> ticks ago) to the actual position you got from playing other player's inputs . Unless anyone built anything to block you, you should never have prediction errors. (and when a prediction error occurs, just return the player to its actual real position.)
A more advanced (but less required) approach would be to predict everything (Building/Build range, chest contents, blocking your predicted self by building something next to you).
by the way, great game you got there.
Sincerely,
Someone who gets motion sickness from delayed input.
I understand how the netcode works in this game (Sending inputs for future ticks, making everything deterministic, synchronized random generator (if any exists)). But there is an annoying side effects that can be easily fixed - delayed movement.
Basically, what you'll want to do when the local player tries to move is to instantly move the player and camera visually, before the actual tick that is played. While keeping all game logic calculations with the real position in mind (this is only a "cosmetic" thing). Every tick you'll want to compare the predicted position(of <latency setting> ticks ago) to the actual position you got from playing other player's inputs . Unless anyone built anything to block you, you should never have prediction errors. (and when a prediction error occurs, just return the player to its actual real position.)
A more advanced (but less required) approach would be to predict everything (Building/Build range, chest contents, blocking your predicted self by building something next to you).
by the way, great game you got there.
Sincerely,
Someone who gets motion sickness from delayed input.