-
-
Notifications
You must be signed in to change notification settings - Fork 60
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
Move PredictionHistory to the Confirmed entity? #793
Comments
I agree, also because prediction_despawn only remove the components which are replicated (registered), not the clients only ones such as sprites.. which you have to manually remove |
Oh.. but in the proposed option where the predicted entity just uses the normal Or maybe we can assume that users have a system/trigger on newly-added predicted to add those extra components? |
I would like to think more about this change.
It would be nice to have an example with animation/sounds to show how it would work |
I think we can assume that user will have system that trigger on added predicted entities to add their non-protocol components. This is what you do in most examples and sound like the easier/cleanest pattern. This work for all cases (actual new predicted or predicted added during rollback). Having to react on removed protocol-only components to also remove non-protocol sounds pretty bad and hard to maintain. Concerning point 3, while this can be true for critical events I'm not sure we always want to react on confirmed entity despawn, as this could add quite a lot of delay. |
Let's say you have a Confirmed entity with a Predicted entity.
The Predicted entity gets despawned on the Client, however we still want to keep the entity around and the PredictionHistory so that we can restore it in case of a rollback.
Current solution: use the
prediction_despawn
function that just caches the components and then re-adds them. That's annoying because users of the library have to remember to use this special despawn.New solution: put the
PredictionHistory
on the confirmed entity. The predicted entity can get deleted; if it gets re-spawned via rollback we just need to copy over the components, we still have access to the historyThe text was updated successfully, but these errors were encountered: