-
Notifications
You must be signed in to change notification settings - Fork 41
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
Invalidated Entity's #29
Comments
You raise a valid concern. I did not think about hierarchical entities when writing this plugin. I have not tried it, but I doubt it would work. |
I will take a deeper look into this on the weekend. The more I learn about bevy, the more I am certain that this version of the bevy_ggrs plugin is a prototpye that needs a rewrite :D |
Yeah, I'll be thinking about this too. I like that this plugin isn't super complicated anyway. I did a little bit of looking at the While brainstorming I was wondering if we could have a sub-world that we do the rollback system in, which would have it's own entities, and could we somehow snapshot the entire world, including it's entities, and then have like an extract phase similar to how is used for Bevy rendering to pull the needed components into the normal Bevy world before rendering. I don't actually think that would work with the current state of Bevy, but it's food for thought. I'm still thinking... :D |
Something maybe to look into is Bevy's |
Aha! This code is key to how Bevy imports hierarchy's from scene files: for registration in type_registry.iter() {
if let Some(map_entities_reflect) = registration.data::<ReflectMapEntities>() {
map_entities_reflect
.map_entities(world, entity_map)
.unwrap();
}
} It uses I'm still fitting this together in my head, but I think we can make this work with that. |
I just found that invalidating entities is still an issue, but luckily I also discovered the fix we need in the For now, in my game I've just patched Bevy with the PR linked in the issue above to fix it. |
Originally posted by @gschup in #11 (comment)
I started a new thread to avoid cluttering the other one.
So, if the entities in an inventory component could end up invalidated by the rollback, does that mean Bevy's hierarchy could get corrupted too?
Because the hierarchy works by having
Parent
andChildren
components whereEntity
s are used for references, similar to an inventory.The text was updated successfully, but these errors were encountered: