MDFramework icon indicating copy to clipboard operation
MDFramework copied to clipboard

Feature: Add prediction to MDCRMInterpolatedValue

Open Beider opened this issue 5 years ago • 1 comments

The GameClock interpolated Vector2 does not currently support prediciton. Adding prediction would be fairly simple, simply calculate the velocity based on the last two updates every time we update the vector and if we stop recieving updates we can simply apply the same velocity every tick.

One thing that may be needed is a state for the MDCRMInterpolatedVector2 so we know if we are in initial update mode, interpolation mode or prediction mode.

Question is how long should prediction apply? I would suggest not allowing prediction to last more than 1-2 seconds as after this it is likely that the player is disconnected. It is probably best to stop the player so they don't activate triggers far off in the distance if they keep sliding in the same direction.

Beider avatar Jul 01 '20 22:07 Beider

Question is how long should prediction apply?

Depending on the prediction algorithm, this might not matter. We could just predict what the value will be when the next update is expected and not go beyond that.

DoubleDeez avatar Jul 02 '20 00:07 DoubleDeez