-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Add an API to manually set change ticks for advanced users #5633
Comments
For context, any plugins (not just multiplayer) that want to cleanly reset some/all of the data in a Also, this is not something blocking me today, I'm not even that far lol. Another alternative would be attaching your own versions of system and component ticks as |
Right; we'll need the ability to muck with system change ticks too. IMO that should be a seperate PR, and be done after the bulk of stageless. |
…evyengine#5635) # Objective - Our existing change detection API is not flexible enough for advanced users: particularly those attempting to do rollback networking. - This is an important use case, and with adequate warnings we can make mucking about with change ticks scary enough that users generally won't do it. - Fixes bevyengine#5633. - Closes bevyengine#2363. ## Changelog - added `ChangeDetection::set_last_changed` to manually mutate the `last_change_ticks` field" - the `ChangeDetection` trait now requires an `Inner` associated type, which contains the value being wrapped. - added `ChangeDetection::bypass_change_detection`, which hands out a raw `&mut Inner` ## Migration Guide Add the `Inner` associated type and new methods to any type that you've implemented `DetectChanges` for.
…evyengine#5635) # Objective - Our existing change detection API is not flexible enough for advanced users: particularly those attempting to do rollback networking. - This is an important use case, and with adequate warnings we can make mucking about with change ticks scary enough that users generally won't do it. - Fixes bevyengine#5633. - Closes bevyengine#2363. ## Changelog - added `ChangeDetection::set_last_changed` to manually mutate the `last_change_ticks` field" - the `ChangeDetection` trait now requires an `Inner` associated type, which contains the value being wrapped. - added `ChangeDetection::bypass_change_detection`, which hands out a raw `&mut Inner` ## Migration Guide Add the `Inner` associated type and new methods to any type that you've implemented `DetectChanges` for.
…evyengine#5635) # Objective - Our existing change detection API is not flexible enough for advanced users: particularly those attempting to do rollback networking. - This is an important use case, and with adequate warnings we can make mucking about with change ticks scary enough that users generally won't do it. - Fixes bevyengine#5633. - Closes bevyengine#2363. ## Changelog - added `ChangeDetection::set_last_changed` to manually mutate the `last_change_ticks` field" - the `ChangeDetection` trait now requires an `Inner` associated type, which contains the value being wrapped. - added `ChangeDetection::bypass_change_detection`, which hands out a raw `&mut Inner` ## Migration Guide Add the `Inner` associated type and new methods to any type that you've implemented `DetectChanges` for.
What problem does this solve or what need does it fill?
This API is essential to ensure the reliability of change detection with rollback networking.
From @maniwani.
What solution would you like?
Add a
set_last_changed
method toDetectChanges
. This should come with warnings in the docs about the need to carefully think through exactly what you're doing.What alternative(s) have you considered?
Never use change detection in games with rollback networking?
Use a different networking strategy?
Additional context
If we're adding this, we should similarly add a change-detection bypass to avoid users cobbling together an approach to do this by manually setting the change ticks.
This was previously done in #2363, but IMO should be unconditionally enabled instead.
The text was updated successfully, but these errors were encountered: