I am learning DOTS and have a question, obviously; I have two groups of Entities; Roads and Autos. The Roads have Lanes, and the Lanes have Points (along the length of the road/lane) Each Auto is on a specific lane on a specific road.
During a job it iterates through the Autos to affect it’s Translation. To do this I need to query the Road entities to get the matching Road and Lane Identity and with that get the next Point. I pass the road objects to the job and iterate through those and this seems to work… but looping through all roads seems expensive. I just watched another ECS video and it showed me I can add an Entity as a child to an another entity. So I am trying that as well, the current Road is a Component to the Auto entity. (that comes with it’s own set of issues… oh the joy of DOTS)
Anyway, I was thinking it might be easier/quicker if the Auto entity has the current set of road/lane points on it’s own archetype, so I only have to go fetch the next series of points fewer times.
However, that is redundant data, so that’ll take some more memory. This is for a VR app, so I have memory, but more importantly I want to hear feedback on the value of the redundant vs the time it takes to get the correct; Road/Lane/Points
Thanks kindly