Skip to content

Latest commit

 

History

History
23 lines (16 loc) · 2.13 KB

README.md

File metadata and controls

23 lines (16 loc) · 2.13 KB

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:

  • Represent game state with entities and components
  • Define components with introspectable types and perform validation automatically
  • Create expressive queries that can be used to iterate over entities and their components
  • Handle temporarily connected RBXSriptConnections and temporarily existing Instances
  • Convert entities and components between Roblox Instance attributes and their preferred representation

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.