Indexes: look up entities by the value of their components #4513
Labels
A-ECS
Entities, components, systems, and events
C-Feature
A new feature, making something new possible
S-Needs-Design-Doc
This issue or PR is particularly complex, and needs an approved design doc before it can be merged
What problem does this solve or what need does it fill?
An "index" is a way to quickly find entries based on their value.
In the context of an ECS, indexes would let us e.g. "find all entities with components of this enum value", identify all entities inside a spatial region using a quadtree on
Transform
, quickly look up entities by theirName
, or filter entities to find all components whose value lies within a range.What solution would you like?
Provide a native, efficient, fool-proof indexing solution.
Ideally, this should be user-extensible to account for other forms of acceleration data-structure.
This will be naturally coupled with change detection to ensure efficient updating.
The design of this is rather challenging, and requires a full RFC.
What alternative(s) have you considered?
Linear time search will always work... slowly. Parallel query tools will help though.
Users can hand-roll this themselves right now, using a resource and
Query::get
. This is not particularly ergonomic, requires writing a lot of boilerplate, forces users to duplicate the API work for each project, and forces them to reckon with the perils of synchronization alone.Additional context
May be useful for #3742. Would be useful for #1470. #1205 discusses some of the challenges and possible designs for data synchronization.
The text was updated successfully, but these errors were encountered: