Entity id should become 64 bits. Use the top 32 for metadata (version id, etc), and the bottom 32 as the index.
Parenting
Implement parenting at the ECS level. Parent-child relationships should be quickly query-able and usable by components/systems. Deleting a parent should also delete all children.
Entity -> parent: Map in vector using entity as index
Parent -> children: Entity-indexed vector stores starting index into vector of child ids. Child vector nodes store child id and next index (essentially a linked list). Minimizes allocations while maintaining O(1) add and remove.
Add information allowing entities to depend on other entities. Block deletion (unless forced) of entities with dependencies. Allows for reference counted relationships in the ECS natively. Example: Slideshow -> AnimationPlayer. Use similar data approach as parenting.
Entity id should become 64 bits. Use the top 32 for metadata (version id, etc), and the bottom 32 as the index.
Parenting
Implement parenting at the ECS level. Parent-child relationships should be quickly query-able and usable by components/systems. Deleting a parent should also delete all children.
Entity -> parent: Map in vector using entity as index
Parent -> children: Entity-indexed vector stores starting index into vector of child ids. Child vector nodes store child id and next index (essentially a linked list). Minimizes allocations while maintaining O(1) add and remove.
Provide templated base class for components:
Dependencies
Add information allowing entities to depend on other entities. Block deletion (unless forced) of entities with dependencies. Allows for reference counted relationships in the ECS natively. Example:
Slideshow
->AnimationPlayer
. Use similar data approach as parenting.