Search Unity

Rollback Strategy

Discussion in 'FPS.Sample Game' started by Spy-Shifty, Nov 25, 2018.

  1. Spy-Shifty

    Spy-Shifty

    Joined:
    May 5, 2011
    Posts:
    546
    I've a question for the rollback strategy in the fps sample.

    Why are you replaying the inputs over and over and over, instead of going forward without rollback every time and only make a rollback if a new snapshot arrives!

    Why so complicated? Do I miss something?

    Ref:
     
  2. Mogens_H

    Mogens_H

    Unity Technologies

    Joined:
    Mar 7, 2017
    Posts:
    20
    We wanted to exercise the rollback code so it was easier to detect prediction bugs and performance wise it is a constant cost you would have to have room for anyways to avoid spikes

    But you are right, it would be an option to only rollback when new data arrives. However you would still have to do a "small" rollback ever frame to last completed full tick and then perform new ticks on top of that (as we always update by tick and don´t support "additive" update of same tick)
     
  3. Spy-Shifty

    Spy-Shifty

    Joined:
    May 5, 2011
    Posts:
    546
    Thank you! That answers my question!

    At first I thought that there could be more, that I haven't thought about it yet ...