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

Fix extra rollbacks on pre-spawned entities #815

Merged
merged 2 commits into from
Jan 13, 2025

Conversation

cBournhonesque
Copy link
Owner

@cBournhonesque cBournhonesque commented Jan 13, 2025

I noticed several issues that were causing rollbacks:

  • I was adding an initial value in the History when I create it in the SpawnHistory set, and then I would add the same value again in the UpdateHistory set. This wasn't an issue when we used heaps for the history component, but now that we switched to linked-lists this was causing issues
  • SpawnHistory had no ordering with the avian sets, so it was possible that the spawn_prespawned_history system was running before the physics systems. That means that some components (LinearVelocity, etc.) that are added by avian would only have a history from the following tick, which was causing extra rollbacks.
  • I noticed an issue where sometimes we try to add a value to the history even though it already has a value for this tick. I don't know why this can happen, but it needs to be investigated.

With this PR, I notice almost no rollbacks when launching bullets in the spaceships example!

@cBournhonesque cBournhonesque merged commit 06423de into main Jan 13, 2025
2 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant