Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Voting for the Unity Awards are OPEN! We’re looking to celebrate creators across games, industry, film, and many more categories. Cast your vote now for all categories
    Dismiss Notice
  3. Dismiss Notice

Modest pings result in overly large interpolation buffer

Discussion in 'Multiplayer' started by TheLastVertex, Feb 1, 2018.

  1. TheLastVertex

    TheLastVertex

    Joined:
    Sep 30, 2015
    Posts:
    126
    I'm having trouble managing the size and thus view delay of my interpolation buffer. It appears that for even modest ping times of say 100ms that the interpolation delay ends up ballooning in size.

    The server is sending out position updates 10 times a second. On the client I buffer these in an interpolation buffer so the entities can be smoothly interpolated between at least two received positions without lag causing jitter.

    Position updates: 10 updates a second / every 0.1 seconds / every 100ms
    Interpolation buffer: 300ms / 3 position updates worth

    Is this normal?

    From my understanding mobile network ping times for 3G can average anywhere from 100-500ms pings (citation needed - if anyone has stats on this I would be very interested). So doing a simulation test of 200ms ping results in a buffer size of 12 or 1.2 second delay. Which is insane. This isn't even considering packet loss.

    It doesn't end up using the full buffer all the time but it definitely hiccups every once in a awhile and gets down to 1-5 remaining updates before the next batch is received.

    I'm already sending this position via an unreliable channel to hopefully speed things up but I'm not sure that had a huge impact.

    The source engine / counter strike wiki states they use a 100ms interpolation delay. Using their criteria of 60 updates a second with a ping of 100ms I still end up with a 300ms interpolation buffer. Not sure how they get it as low as 100ms.

    Gaffer on games has this quote which appears to line up more with what i'm seeing inside unity
    I'm not sure how counter strike is getting it so low.

    Any ideas on ways to reduce this? Should I be relying on extrapolation heavily?
     
    Last edited: Feb 1, 2018
  2. TwoTen

    TwoTen

    Joined:
    May 25, 2016
    Posts:
    1,168
    Send on the unreliable state update channel, not unreliable channel UNLESS you do delta compression. Or use the Unreliable sequenced (probably prefered). Otherwise this can happend:
    Client sends pos1, client sends pos2, client sends post3. Server gets post 2, server gets pos1 (rather than dropping it, it will add it to the buffer).

    As for how Counterstrike is getting that low, they are not sending 60 updates a second. They do 20. But mobile is difficult with realtime games. I am not too read up on mobile networking. But this might atleast help you.