4 ms·
Correct, you basically invert the typical component/object oriented approach, so each property relating to some Component isn't stored in memory alongside the g
by m12k 5y ago
Correct, you basically invert the typical component/object oriented approach, so each property relating to some Component isn't stored in memory alongside the game object it relates to (causing the values relating to e.g. physics to be scattered around memory) but is instead stored in an array (indexed by an id - the Entity id) with all the other values for this component type, making it much more cache efficient when a System (e.g. particle system, physics system) needs to perform updates on all components of a given type (which typically happens once per run loop iteration in a game engine). See also https://en.wikipedia.org/wiki/AoS_and_SoA https://en.wikipedia.org/wiki/AoS_and_SoA