Ralith / hecs

A handy ECS
Apache License 2.0
967 stars 82 forks source link

Introduce method for moving entities between worlds #248

Closed Ralith closed 2 years ago

Ralith commented 2 years ago

I wonder whether replacing some of the manual memory management of the CommandBuffer by just using a World in its implementation would be useful?

This is an interesting idea. Merging archetypes is also liable to be significantly more efficient than inserting components one at a type from row-major storage, in effect moving cost to CommandBuffer population time, which is comparatively easy to offload--not that this is a cost anyone has complained about yet. On the other hand, the only commands I would think to add at present are despawn and remove operations, which are straightforward to express with simpler means.

Ralith commented 2 years ago

Thanks for the great review and discussion, @adamreichold!