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

Moving average quaternions flip unintentionally #1341

Open
ButterscotchV opened this issue Mar 10, 2025 · 1 comment
Open

Moving average quaternions flip unintentionally #1341

ButterscotchV opened this issue Mar 10, 2025 · 1 comment
Assignees
Labels
Area: Server Related to the server Priority: Low Less important right now Type: Bug Something isn't working

Comments

@ButterscotchV
Copy link
Member

Moved from Discord: https://discord.com/channels/817184208525983775/948579740225261598/1333736861293744138

It seems like in QuaternionMovingAverage, there's addQuaternion which happens every dataTick and then update that happens every tick, I think the desync between dataTick and tick could be causing the tracker's rotation to be inverted when big server slowdowns happen.

I'm not exactly sure that's what's happening as I can't actually recreate it myself, but I think that's a fairly plausible explanation, as the tracker's rotation only needs to change by 90 degrees in that time, which if you're stuttering badly, I could see easily happen when turning around or something. This is worsened when using smoothing or prediction, as it also adds the latency of smoothing or latency/overshoot from prediction into the 90 degree change required.

I propose that the tracker's positive/negative rotation should be tracked in dataTick, then non-tracked interpolation can be done from that on tick for smoothing/prediction. The range for swapping positive/negative could also be reduced, making it something more like a 100-135 degree angle required so that it's less likely to happen. Ideally we'd just track this on the tracker itself, but if we really need to track it in the server, then so-be-it.

We could probably also try to be smart and assume 180 degree bends in the body probably aren't quite right and correct for it, but idk about that.

This is still a big issue, we now have a minor workaround for waist interpolation, so we can handle inversion for it (though it still happens), but this code is now what's preventing foot plant and toe snap from functioning properly. This may also be related to full/yaw reset? Will need to be looked into further.

@ButterscotchV ButterscotchV added Area: Server Related to the server Priority: High Important feature or blocks something important Type: Bug Something isn't working labels Mar 10, 2025
@ButterscotchV ButterscotchV self-assigned this Mar 10, 2025
@ButterscotchV
Copy link
Member Author

ButterscotchV commented Mar 15, 2025

I've fixed the desync issue in #1351, it turns out there's a lot more of a problem to this. We may need to track the polarity after tracker resets have been applied rather than on the raw rotation.

Marked this as low priority, since this doesn't actually break current functionality.

@ButterscotchV ButterscotchV added Priority: Low Less important right now and removed Priority: High Important feature or blocks something important labels Mar 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Server Related to the server Priority: Low Less important right now Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant