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

Clone-able ECS storage #3703

Closed
james7132 opened this issue Jan 16, 2022 · 2 comments
Closed

Clone-able ECS storage #3703

james7132 opened this issue Jan 16, 2022 · 2 comments
Labels
A-ECS Entities, components, systems, and events C-Feature A new feature, making something new possible

Comments

@james7132
Copy link
Member

What problem does this solve or what need does it fill?

To allow easier duplication of entities (spawning copies of a template) and copying of entire Worlds for subapps/worlds and rollback networking, having a dedicated storage for clone-able components is likely required.

What solution would you like?

Either an API that conditionally allows cloning a Table or SparseSet (iff all contained components are Clone), or a separate storage format that keeps only the Clone-able components of entities that are implement Clone and Send, and supports trivially moving/cloning/replacing this storage from World to World while maintaining entity identity.

What alternative(s) have you considered?

Manually copying individual components from World to World. May cause entity identity instability.

Additional context

The main need for something like this is to allow for creating World snapshots at a given moment in time for rollback networking, and support restoring it at a later time.

For this to be correct, entity IDs must be stable across saving and loading these snapshots, or any entity references in components recorded in each snapshot may become invalid.

@james7132 james7132 added C-Feature A new feature, making something new possible S-Needs-Triage This issue needs to be labelled labels Jan 16, 2022
@alice-i-cecile
Copy link
Member

Related to #1515.

@alice-i-cecile alice-i-cecile added A-ECS Entities, components, systems, and events and removed S-Needs-Triage This issue needs to be labelled labels Jan 16, 2022
@james7132
Copy link
Member Author

Closing this as there are workarounds that don't require archetypal Clone-safety. For rollback netcode, generic systems seem to work fine given a guaranteed Clone bound on the components or resources.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ECS Entities, components, systems, and events C-Feature A new feature, making something new possible
Projects
None yet
Development

No branches or pull requests

2 participants