Mirror upstream PR #9: deterministic prediction + ack replay#7
Mirror upstream PR #9: deterministic prediction + ack replay#7web3dev1337 wants to merge 5 commits intomasterfrom
Conversation
Made-with: Cursor
- Introduced new collision detection logic in the Camera class to improve camera behavior during gameplay. - Added methods for sampling game camera collision distance and determining when to sample based on movement and direction. - Updated EntityManager to include vertical velocity estimation and refined movement direction tracking for better local prediction accuracy. - Adjusted local prediction parameters for horizontal and vertical movement to enhance responsiveness and stability.
- Added new properties to LocalPredictionState for pre-acknowledgment reconciliation and acknowledgment support detection. - Updated initialization and reset logic to incorporate new state properties. - Improved command buffering behavior based on acknowledgment support and pre-acknowledgment grace period. - Refined reconciliation logic to handle pending commands and ensure smoother movement transitions.
- Introduced a new property in LocalPredictionState to track pending speed calibration acknowledgment. - Updated logic to manage speed calibration input sequence numbers during movement command acknowledgment. - Refined speed estimation methods to utilize the new calibration acknowledgment for improved accuracy in movement predictions.
…ion logic - Introduced a new system for handling sequenced movement inputs in the Player class, allowing for better input management and simulation. - Added methods to enqueue and apply queued movement commands, enhancing responsiveness during gameplay. - Updated the Camera class to differentiate collision raycast intervals for mobile and desktop platforms, improving camera behavior based on device type. - Refined movement direction calculations in the DefaultPlayerEntityController to utilize a new deterministic movement resolution method, ensuring smoother character control.
Review notes (mirrored from upstream PR #9)Overall: direction looks solid — deterministic movement parity + ack-aware replay + tick-aligned server input application should noticeably reduce “tug” and jitter. 🚨 Potential correctness issue (camera yaw/pitch can get dropped)On the server, sequenced movement packets are queued, but
Because the client only includes
That can leave the server’s camera orientation stale (movement direction resolution becomes wrong) under jitter / packet bunching. Suggested fix: when consuming a batch, scan the queued commands (from the end) for the most recent defined Compatibility / “old games” risk areas
Performance notes
Suggested manual test matrix
|
This PR mirrors upstream PR hytopiagg#9 onto this fork’s
masterso we can review/test it here.review/mirror-upstream-pr-9No additional changes beyond cherry-picking the upstream commits.