Search Unity

Performance: Component on this archetype vs one another?

Discussion in 'Entity Component System' started by JamesWjRose, Oct 23, 2019.

  1. JamesWjRose

    JamesWjRose

    Joined:
    Apr 13, 2017
    Posts:
    687
    So, this is my 5th of what seems like it's going to be 127 questions about DOTS... sorry about that in advance.

    Anyway, as I mentioned in my previous posts I am making a traffic system using the data from the asset "Easy Roads 3D" Through it's api there is access to the roads, it's lanes and the points along each lane. So to use this in DOTS I need to create entities of this data, including an array (IBufferElementData) of the points for the lane. The car needs these points to navigate.

    So, my question (finally): Is having the car's archetype holding the current set of points going to be more performant than each time it arrives at a point, having to iterate through the Road entities to find the road, lane and it's points. That way I only need to get that list of points once every 10 to 40 points. The memory overhead will be something of course, but I thought I'd ask to see if there was something i was missing.

    Thanks kindly