3 ms·
>Exposing all of every entity's data to the world and letting unaligned actors unilaterally mutate many entities' state But that is NOT the pattern. Entities
by jayd16 5y ago
>Exposing all of every entity's data to the world and letting unaligned actors unilaterally mutate many entities' state
But that is NOT the pattern. Entities are ids, they have component tags that opt entities into some functionality and the systems encapsulate and track the mutable state that system controls.
If you want to start sharing ownership of mutable state, that basically comes down to an implementation detail. Unity's ECS system does NOT let "unaligned actors unilaterally mutate many entities' state with no middle man." One could perhaps implement it that way if they so choose. It's just a matter of taste because, again, the design pattern is not inherently OO or non-OO.
- bccdee 5y agoDon't systems sometimes have to access each other's components to do work? Isn't any given component exposed to all systems, and not merely one?
- jayd16 5y agoIts a bit of an implementation detail I would say. If you use a single thread and explicitly order your systems then its probably possible to have fully accessible global state. Unity, for example, encapsulates the actual component data and uses a fairly complex API around command buffers to schedule readonly and read/write commands across many threads.