-
Notifications
You must be signed in to change notification settings - Fork 30
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
Q: ape seems to be (at least currently) mono world? #33
Comments
Component and Entity types are currently world specific for optimization reasons, but it wouldn't affect the API to change it (WorldEntity might need to change the TypeScript definition a bit). I'm certainly open to making it easier to use entities and components in more than one world. What use-case do you have in mind? |
A couple of current use cases I have in mind:
Speaking of spatial sharding, what's your take on an index for collision detection? |
That makes a lot of sense. I'll make it a priority. I think I can do it without a 2.0, but it might need to be API breaking. We'll see! I'll keep you in the loop. |
Components can now be registered to multiple worlds in the portability branch. |
Fantastic, for an update on where I'm at, am currently pursuing "what if I just used DOM elements literally as an ECS, what with data attributes, CSS variables, quereySelectorAll, and such"; you can see a working demo here: https://jspit.vercel.app/domgeon.html fwiw, my approach to FOV / lighting does provide a potential use case for copy/moving between between worlds:
Now, currently for domgeon, this is all just so much And a parting thought: copying between ECSes seems to me just a lighter weight version of (de)serialzing, which ECSes are supposed to afford quite well in general; not sure what ape-ecs's current story is around loading/saving tho? |
You can run getObject on a world, entity, or component. The results can be used as the definition in createEntity/createEntities. |
Due to things like
World.prototype.registerComponent
mutating the givenklass.prototype
, makes it not appealing to work with multiple worlds.What's your thoughts on how to do that sort of multi-world/shard/chunk thing?
The text was updated successfully, but these errors were encountered: