The entity component system (aka ECS, entity system) is an architectural pattern that represents game objects with entities (unique IDs - essentially just numbers) associated with various components (pure data that contain no behavior). Systems proper are free functions called each frame (or at some other frequency) that select all the entities fulfilling some criteria (e.g. all entities with both a Health
component and a Regeneration
component). For more details see:
Anatta is a library that integrates the ECS pattern into Roblox. Anatta aims to provide all that is reasonably necessary to use ECS to develop a Roblox game, but no more. Anatta provides infrastructure to:
RBXSriptConnection
s and temporarily existing Instance
sInstance
attributes and their preferred representationAnatta is not a framework. Structure your code however you'd like!
An entity component system for use on Roblox was originally motivated by the inadequacy of the DataModel
to elegantly solve problems with state and identity - particularly when Workspace.StreamingEnabled
is set, when uniquely replicating Instance
s via PlayerGui
(where each client in a typical setup has their own copy of the Instance
), or in other cases when there is not necessarily a one-to-one correspondence between an Instance
and a logical game object.