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

Fixed-point physics #38

Open
ngc92 opened this issue Sep 17, 2022 · 0 comments
Open

Fixed-point physics #38

ngc92 opened this issue Sep 17, 2022 · 0 comments
Assignees
Milestone

Comments

@ngc92
Copy link
Collaborator

ngc92 commented Sep 17, 2022

Switch all physics computations to use fixed-point numbers.
This will enable us to get rid of the inline assembly on x86 systems, and makes physics simulation reliably reproducible across system architectures, which is important for replays.

We probably should not roll our own implementation, but use an existing one such as
https://mikelankamp.github.io/fpm/

Changing to FP match will cause some compatibility problems:
a) replay files will be incompatible due to changed binary representation
b) replaying a replay could give slightly modified results
c) packet sending state updates from server to client will become incompatible
d) simulation on client and server might be slightly different if they use different versions

Out of these, a) could be fixed relatively easily, b) won't be fixed (would require us to keep the old physics code around), c) would require some work but should be doable if both client and server have a conversion layer that reinterprets packets from an incompatible version. Finally, d) should not be significant since we send the full game state regularly, so differences cannot accumulate (unlike in replays)

@ngc92 ngc92 self-assigned this Sep 17, 2022
@ngc92 ngc92 added this to the release 1.2 milestone Mar 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant