Skip to content

Anatta is a library that integrates the ECS pattern into Roblox.

License

Notifications You must be signed in to change notification settings

kennethloeffler/anatta

Repository files navigation

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.

About

Anatta is a library that integrates the ECS pattern into Roblox.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published