Giter Site home page Giter Site logo

Invalidated Entity's about bevy_ggrs HOT 6 CLOSED

zicklag avatar zicklag commented on July 18, 2024
Invalidated Entity's

from bevy_ggrs.

Comments (6)

gschup avatar gschup commented on July 18, 2024

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.

from bevy_ggrs.

gschup avatar gschup commented on July 18, 2024

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

from bevy_ggrs.

zicklag avatar zicklag commented on July 18, 2024

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 ggrs crate API and it's pretty simple, too. Good job.


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

from bevy_ggrs.

zicklag avatar zicklag commented on July 18, 2024

Something maybe to look into is Bevy's DynamicScene and also the EntityMap used to write DynamicScenes to the world.

from bevy_ggrs.

zicklag avatar zicklag commented on July 18, 2024

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 ReflectMapEntities to update all the Parent and Children components with the mapped entities.

I'm still fitting this together in my head, but I think we can make this work with that.

from bevy_ggrs.

zicklag avatar zicklag commented on July 18, 2024

I just found that invalidating entities is still an issue, but luckily I also discovered the fix we need in the bevy_hierarchy crate. Just posting here for a heads-up in case anybody runs into it:

bevyengine/bevy#6790

For now, in my game I've just patched Bevy with the PR linked in the issue above to fix it.

from bevy_ggrs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.