1 (edited by Starcutter 2022-08-07 17:43:30)

Topic: Switching to Delay-based netcode on desync

I had an idea, I'm currently trying to implement this myself but I thought I'd share it here too.

Sometimes my game likes to desync. It doesn't happen every game, and most of the games go by without a desync. That said, it's very annoying when it happens. After much thought, I figure this might be a good failsafe rather than just flat out disconnecting.

Ideally, it'll just turn off rollback for the rest of the round and then resume at the start of the next round. If anyone has an idea about how to go about doing it, I'm all ears! Currently trying to figure this out on my own for now though.

I imagine the code for this is in Flux Capacitor, I'll take a jab at it.

Share

Thumbs up Thumbs down

Re: Switching to Delay-based netcode on desync

Unfortunately there is no direct way to "re-sync" the game on the fly. That is because when it happens, a domino effect of other events will happen with it, even the rounds.

You could however try detecting when the round ends on both ends (when they happen independently) and force the round to restart using a combination of OnRoundEnds event and photon events. Once its detected on both builds, you can try toggling "UFE.config.networkOptions.allowRollBacks" to disable rollback.
If you want a more precise detection you can try enabling the desync handling tool and looking under FluxCapacitor.SynchronizationCheck for how it works and what to do when it happens. By default, both builds freeze and a recording tool shows up for debugging purpose.

Desync is probably one of the hardest things to debug on UFE for the code complexity alone. Ideally you want to have some kind of version control and be on the look out for changes that can potentially cause network desync and revert when necessary.

Like UFE? Please rate and review us on the Asset Store!
Questions about the Forum? Check out our Karma FAQ.
Don't forget to check our discord channel.