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 hashing in bullet-prespawn example #821

Merged
merged 2 commits into from
Jan 14, 2025
Merged

Conversation

cBournhonesque
Copy link
Owner

The bullet-prespawn example spawns 2 PreSpawned objects in the same tick.
These 2 bullets have the same exact hash since they have the same component list + spawn tick.

I think I added this to show that lightyear doesn't panic even with multiple prespawned entities with the same hash exist.

However this was causing a lot of rollbacks since the left bullet on the server might match with the right bullet on the client!
In general we might never want to have this behavior. Maybe it's better to panic if this happens, to let users make sure that the hashes don't collide? For now I'll still support it but issue a warning if this happens.

Fixes #178

@cBournhonesque cBournhonesque added A-Prediction C-Example A change/addition to an example labels Jan 14, 2025
@cBournhonesque cBournhonesque merged commit 6d6fd30 into main Jan 14, 2025
1 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Prediction C-Example A change/addition to an example
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The bullet_prespawn example has weird freezes.
1 participant