Code Monkey home page Code Monkey logo

Comments (2)

abraini-Nascent avatar abraini-Nascent commented on June 30, 2024

I'm having a similar issue, it seems to be a race condition with removing and reindexing:
When removing an entity from the world, some onRemoved subscribers will try to do some cleanup and run a world.removeComponent. This will reindex the removed component, adding it back to any buckets it was just removed from. Then world.remove will finish and the entity will no longer be in the world bucket. so each loop of a system, when I pull something out of a query I have to check if the entity is still in the world and if not I remove it from the bucket.

There should be a way to skip reindexing entities that are being removed from the root world bucket

Otherwise the library has been very helpful =D

from miniplex.

hmans avatar hmans commented on June 30, 2024

I'm assuming these are two separate (even if similar sounding) issues -- would you be willing to provide a (failing) test case? I'd be happy to fix and improve these situations, but I need to better understand what's going on.

In the meantime, it sounds like a potential workaround for these issues would be to queue the follow-up work (like removing the second component) using queueMicrotask.

from miniplex.

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.