2 ms·
Stuart Sierra components and ECS components are not really the same thing though. They share the name “components” but not thaaat much else. Stuart Sierra Comp
by dkersten 7y ago
Stuart Sierra components and ECS components are not really the same thing though. They share the name “components” but not thaaat much else.
Stuart Sierra Components are more akin to Unity’s behaviour components prior to their introduction of an ECS. They’re a way of encapsulating state which may have dependencies and has a lifecycle (needing to be started or stopped).
ECS components are purely blobs of (usually fine grained) state, the existence and combination of which in an entity creates behaviours (that is, the systems which implement the behaviour will dynamically do so for any entity that has the prerequisite components, but the components are just data).
I always preferred naming ECS components as “traits” (they are the traits that an entity has, eg “animated”) and the systems “behaviours” (they are the behaviours exhibited by entities that have certain traits).