History-Based Interpolation for 3D

#5 Open
Repository
rodolphito
Branch
5.3
Repository
Unity-Technologies
Branch
5.3

Bitbucket cannot automatically merge this request.

The commits that make up this pull request have been removed.

Bitbucket cannot automatically merge this request due to conflicts.

Review the conflicts on the Overview tab. You can then either decline the request or merge it manually on your local system using the following commands:

hg update 5.3
hg pull -r 5.3 https://bitbucket.org/rodolphito/networking
hg merge 198e4bc8a975
hg commit -m 'Merged in rodolphito/networking (pull request #5)'
Author
  1. Rodol Phito
Reviewers
Description

Fixes https://feedback.unity3d.com/suggestions/smooth-networktransform-movement-historical-interpolation-slash-extrapolation

New interpolation works way better on lower send rates than the current one. It does not use Interpolate Movement Factor or Interpolate Rotation Factor, because they were not necessary. I only made on for 3D because that is what I am using, making equivalent code for 2D should be relatively trivial. (If it is not, tell me and I will try my hand at it)

This interpolation uses a quadratic bezier curve to try to keep the velocity continuous.

Comments (3)

  1. Rodol Phito author

    Thinking back on this, this should probably be an option as the suggestion thread requests - maybe have 2 Transform Sync Modes: History Sync Rigidbody 3D and Lerp Sync Rigidbody 3D

  2. Rodol Phito author

    Further experimentation shows that with packet loss cranked up this interpolation deteriorates, compared to default unity interpolation. This is most likely due to the fact that it relies on packets being evenly spaced out as time passes, and missing packets cause an empty gap in the movement, causing choppiness. Extrapolation could fix this (using LerpUnclamped) but the major problem with this is that position and rotation packets stop being sent when the rigidbody stops moving, ideally 1 more packet should be sent when it stops moving so that the history is cleared out and it does not extrapolate to infinity, or until it moves again. Maybe a combination of this and unity's default interpolation could fix the packet loss problem.