I’m currently making a prototype using ECSY, and it appears to me that you can get the ID of an entity, but there isn’t a way to retrieve that entity using the ID (other than looping through entities and checking if they have that ID).
Am I correct about this?
My use case is for getting entities by location in a 2D grid. It seems to me that without modifying the current way of looking up entities, you would need to loop through all the entities with a Position component and check the position to do this, which must be much more expensive than having an array of entity IDs to directly get the entity by position. I’m also considering just storing references to the entities instead. Anyone have experience implementing position lookup in this kind of ECS?
Looking at others ECS’s -(I’ve been reading up on DOTS a lots to see how it handles things) it seems like you would normally maintain your own list of ids and then create a system that loops them and calls a “getEntityComponentData” method.
I wonder if there’s any advantage to having this kind of thing built into the query system though? A query that’s just a list of ids and gets cached along with the rest?
I suspect it maybe breaks the idea of such systems - maybe the component pooling?
I think maybe should use TagComponent to get the specific entity