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

The transform_to_position Sync seems to cause numerical inconsistencies. #634

Open
cBournhonesque opened this issue Jan 19, 2025 · 0 comments

Comments

@cBournhonesque
Copy link
Contributor

cBournhonesque commented Jan 19, 2025

I am trying to achieve deterministic networking with avian to avoid having any rollbacks.

I noticed that things work correctly when I replicate Position/Rotation and then sync them to transform (although this comes with its own sets of caveats) but that adding transform_to_position sync modifies the values very slightly and prevents determinism.

I'm not sure exactly what could be the cause:

  1. Interpolation of Transform causes GlobalTransform changes in PostUpdate which might then get synced back to Position!
    In PreUpdate I restore the non-interpolated value of Transform, but it looks like avian uses GlobalTransform for its transform_to_position sync so I might have to run another PropagateTransform system in PreUpdate!

  2. Maybe there is a loss of precision in the propagate_transform set around hierarchies or in the Transform -> GlobalTransform -> Position + Rotation -> Transform chain. In particular the switch between Quat -> Mat3 -> Quat

I need to do more testing the cause is probably option 1)

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