kennethloeffler / anatta

Anatta is a library that integrates the ECS pattern into Roblox.
https://kennethloeffler.github.io/anatta/
MIT License
38 stars 1 forks source link

Intro

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:

Anatta is not a framework. Structure your code however you'd like!

Motivation

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 Instances 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.