Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Dead Reckoning?

Discussion in 'Multiplayer' started by Mohamed-Anis, Dec 4, 2016.

  1. Mohamed-Anis

    Mohamed-Anis

    Joined:
    Jun 14, 2013
    Posts:
    94
    Has Unity thought of supporting dead reckoning for NetworkTransform? Or is it something clients are expected to implement? Think it might be nicer to have it directly on the engine as data transmission can be reduced (if dead reckoning predicts the location accurately). Also could have will reducing network send rate. Noticed setting the send rate at 9 causes the object to jitter on a server authoritative client object :(. This went away at highest send rate (29).

    Thanks!
     
  2. Driiades

    Driiades

    Joined:
    Oct 27, 2015
    Posts:
    151
    There is not this.

    NetworkTransform just lerp between last known position and the new one.
    You have to implement this for the moment (and it's not easy :s )
     
  3. Mohamed-Anis

    Mohamed-Anis

    Joined:
    Jun 14, 2013
    Posts:
    94
    Thanks for the quick reply! Sad to hear :(
     
  4. LukeDawn

    LukeDawn

    Joined:
    Nov 10, 2016
    Posts:
    403
    Heh, would be great to have functionality for dead reckoning, and prediction/interpolation
     
  5. Jos-Yule

    Jos-Yule

    Joined:
    Sep 17, 2012
    Posts:
    292
    There is a great thread on this forum all about network lag and extrapolation and interpolation, can't remember what it was called, but there was a tonne of code and discussion. Might be helpful.
     
  6. Zullar

    Zullar

    Joined:
    May 21, 2013
    Posts:
    651
    For networked synced motion it seems best to code yourself since every game will likely have a different setup. For example any game where objects don't accelerate instantly not only do you need to send position & velocity, but also commanded velocity or acceleration (so physics can be calculated locally on each client in-between network updates). I did this using UNET messages, but there may be other ways. I DeadReckoned the rigidbody/collider, but then LERPED the visual portion of the object so it doesn't "look" jittery.