-
Notifications
You must be signed in to change notification settings - Fork 2
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
Float might cause desync over time. #5
Comments
Hey there, I suggest reading my last comment on your PR, it explains the situation well. |
Okay, now i read it. |
Oh that's right, now i'm reading it, you're talking about RemotEstateMismatch, thank you for you patience, |
Yes exactly, now the logic need to be determined, if we discover a mismatch we need a strong logic to determine which one is right |
Maybe just say "if it's the client then your state is wrong and you must resimulate" then? |
Yes but as this is 100% p2p their is no clear server, but well most of the game will implement a "group/game master" guy, so it should not be a problem 🙂 |
As long as everyone end up in the same state, that's all we want 😅 |
Yeah, that sounds very good, |
Just leaving this here, there's a problem with sending the world state: if the player changed input and the server sends them the state before the input gets rolled back without the input, that could cause a desync, the "strong logic" you talked about really matters. |
Floating points are very infamous for not being calculated properly and causing a lot of issues, including the possibility that they give different results on different machines.
The "solutions" i know (honestly they are pretty risky, there might be something else that's better):
Correct floats with some calculation related to scale. (might not solve the issue tbh, for example: the difference between the resulting move_and_collide or just changing the position could theoretically be more than the scale, causing a bigger desync than if it didn't have this calculation)
Make the server send the entire world state every X seconds and resimulate. (might be too much for UDP, and it might take a lot of work, but it's the safer option. If you try this let me know how i can help you, i'm very bad at this stuff but i can try)
The text was updated successfully, but these errors were encountered: