18 hours ago, Kylotan said:My point above stands. This particular update requires accessing 3 distinct parts of memory within the same loop, just to perform a relatively trivial operation. Having the data all co-located inside each Entity object, and allocating Entities from a pool so they are located near each other would have simpler code and probably perform better as well.
That true, and a toy project is not good proof. But the point is to solve that isue of bad use of caches and CPU prefetching. Is fall back prety fast to OOP or braking DOD rulez.
the point is to move on into advance solution. In DOD it might be done differently. Posibly counter intuitive. But probaly doable.
First thing in mind.
keep DoD pure.
EntityID Key. Take out use of pointers make Entity and components moveable in the array.
that gives many way to sort and move to other systems
Position used bij few Systems
one pure of position PODs
other POD including position and orientation
other POD inc. position and velocity.
That a direction to pioneer into.
Reusing and sorting Component
if entity start moving the positionPod and movable is put in pod incl position and velocity in other system for these PODs
i think this is
normalizing tabels
by having multiple tables without gaps.
excistance based programing. It also means iets system act like booleaan no check for Null. As no pointers.
That direction solution could be viable.