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.

Discussion Which is better? Client Tick ahead of Server or Server ahead of Client?

Discussion in 'Multiplayer' started by MrBigly, Jan 18, 2023.

  1. MrBigly

    MrBigly

    Joined:
    Oct 30, 2017
    Posts:
    89
    I was reading up on Fusion and it states that the Client runs ahead of the Server with enough margin of time that the Player's input events will get to the Server prior to the Server running the simulation Tick for that event. The Client would have to roll back its simulation as it receives authoritative state from the Server and catch back up to where it thinks it is at.

    I was planning on having my Client process the latest simulation Tick that it receives from the Server so long as it isn't taking a step backward (due to out of order packets), then notify the Server during that same simulation Tick what the local Player did. In this case, the Server would roll back to apply the input event and rerun the simulations up to the current Tick.

    I wonder which is a better application of netcode for FPS MP or what gotchas either approach may have to be considered?

    Thoughts are welcomed...