Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Desync detection appears to compare the checksum of predicted frames to confirmed frames #71

Closed
nezuo opened this issue Oct 16, 2023 · 8 comments
Labels
bug Something isn't working

Comments

@nezuo
Copy link
Contributor

nezuo commented Oct 16, 2023

Describe the bug
Desyncs are reported because predicated checksums and confirmed checksums are being compared.

To Reproduce
My repro can be found here on the desync-detection-issue branch: https://github.com/gschup/bevy_ggrs/compare/main...nezuo:bevy_ggrs:desync-detection-issue?expand=1

I used clumsy so that it predicts inputs/rollbacks.

Expected behavior
Only the checksums of confirmed frames should be compared.

Screenshots
Frame 18s for player 1 (in order):
image
image

Frame 18 for player 2:
image

The second frame 18 for player 1 is the same as player 2's frame 18. However, it's comparing the first frame 18 with player 2's frame 18.

@nezuo nezuo added the bug Something isn't working label Oct 16, 2023
@PraxTube
Copy link

PraxTube commented Oct 18, 2023

Yeah, checksums as they are right now only work when there is no ping (or the ping is lower then the input delay), which is almost only the case when testing locally. However, when testing with high ping you get desyncs non-stop because the receiving client is constantly mispredicting and we have to rollback a bunch.

Comparing the checksum of only confirmed frames would fix this?

@gschup
Copy link
Owner

gschup commented Oct 18, 2023

Oh wow, thanks for catching and reporting this. What an oversight!

Comparing only confirmed frames is indeed the answer here.

@johanhelsing
Copy link
Collaborator

johanhelsing commented Oct 18, 2023

Thanks for taking the time looking into this! It does indeed not happen if input delay is higher than ping.

I didn't catch this earlier, since my game breaks on rollbacks due to the regression #63

@johanhelsing
Copy link
Collaborator

johanhelsing commented Oct 20, 2023

This is bug in ggrs. I created a bug and a fix for it there (see referenced issues above).

...in other words, we should probably keep this issue open until we've updated to a fixed version of ggrs

@gschup
Copy link
Owner

gschup commented Oct 23, 2023

The fix is now merged in the ggrs repo, so the issue can be closed here, as well! (unless I am missing something)

@gschup gschup closed this as completed Oct 23, 2023
@johanhelsing
Copy link
Collaborator

Just wondering if it's good to keep it open until at least the main branch of this repo depends on a ggrs version that works (just for visibility in case this is tripping people up)

@gschup gschup reopened this Oct 23, 2023
@gschup
Copy link
Owner

gschup commented Oct 23, 2023

You are right. I was under the impression that the main branch of this repo depends on the main branch of ggrs. At least that was my original intention in the past. It must have slipped through my fingers that we don't do that currently.

@gschup
Copy link
Owner

gschup commented Oct 26, 2023

this repo now depends on ggrs main, which should fix this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants