Skip to content

Rollback requests ignored when max_predictions number of local inputs is saved #70

@aleksa2808

Description

@aleksa2808

Describe the bug

Take a sample situation that can occur in a P2P session in laggy conditions:

  1. A peer sends you input different than you predicted.
  2. In adjust_gamestate you schedule a rollback/LoadGameState request and modify the session's internal state in preparation for it.
  3. However, because of the laggy conditions, you already have max_predictions number of local inputs stored so you drop all created request and instead return a PredictionThreshold error from the advance_frame/add_local_input methods.
  4. On the next advance_frame call, since the session state was modified in preparation for a rollback as if the rollback was guaranteed to happen, you now think there is no need to rollback anymore.

Following these steps leads to a desync as you received a peer's input that didn't match your prediction but didn't rollback.

Expected behavior

In the described situation I would expect the next advance_frame call to remake the requests which were cancelled in the last frame, including the rollback one.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions