-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Fix Zero'd DenseMoveDir not representing no input. (#380)
When GGRS sends predicted input on first frame (no prev input to use), it [zeroes PlayerInput](https://github.com/gschup/ggrs/blob/0af1a044b96465bd10398947b7fb5e0a34a75f70/src/frame_info.rs#L56) and uses that. Due to how we quantize move direction, zeroed bits did not represent no movement input, it instead was `(-1.0, -1.0)`. This sometimes caused desync on beginning of online match. Previously used 6 bit representation over range, was changed to quantize [0, 1.0] with 5 bits, and include a sign bit to map from [0, 1.0] -> [-1.0, 1.0]. Because range is symmetric and we quantize only half of it with one less bit, should still be same amount of precision. Now all zero bits represents 0 which is compatible with ggrs. Additionally added debug log (not enabled by default) in networking to dump net inputs.
- Loading branch information
1 parent
6b8d743
commit cbe537f
Showing
2 changed files
with
50 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters