Skip to content
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

Introduce method for moving entities between worlds #248

Merged
merged 1 commit into from
Jan 31, 2022
Merged

Introduce method for moving entities between worlds #248

merged 1 commit into from
Jan 31, 2022

Conversation

Ralith
Copy link
Owner

@Ralith Ralith commented Jan 29, 2022

No description provided.

Copy link
Collaborator

@adamreichold adamreichold left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having this infrastructure available, I wonder whether replacing some of the manual memory management of the CommandBuffer by just using a World in its implementation would be useful? Mostly to make it easier to implement more features on CommandBuffer. (I am thinking of things like encoding the operation using private component in that stash world and then querying for them when the buffer is applied.)

src/take.rs Outdated Show resolved Hide resolved
src/world.rs Outdated Show resolved Hide resolved
src/archetype.rs Show resolved Hide resolved
@Ralith
Copy link
Owner Author

Ralith commented Jan 29, 2022

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
Copy link
Owner Author

Ralith commented Jan 31, 2022

Thanks for the great review and discussion, @adamreichold!

@Ralith Ralith merged commit 666fee1 into master Jan 31, 2022
@Ralith Ralith deleted the take branch January 31, 2022 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants