Search Unity

Rolling Back VFX

Discussion in 'Multiplayer' started by davej256, Jan 11, 2023.

  1. davej256

    davej256

    Joined:
    Nov 11, 2022
    Posts:
    17
    I'm writing my own netcode framework and had a few quick questions that I couldn't find on the internet.

    1.) How do we roll back predicted audio? Like if you shoot your predicted gun and it plays a gunshot sound. Audio is very decoupled from the simulation, so I can't imagine it actually being "rolled back" without it sounding very glitchy. Do we just ignore new audio plays on re-simulation ticks? And not actually correct it?

    2.) How about something like a particle system?
     
  2. MrBigly

    MrBigly

    Joined:
    Oct 30, 2017
    Posts:
    221
    I also am writing my own netcode. For these cases, I am planning to just abort audio/VFX if they are denied, much like the animation of throwing a grenade where no grenade ever leaves the hand. In some cases, starting the audio or VFX late doesn't make sense, so if they play at all they have to start on time.

    watching this thread now...