lithhash/alloyecs

A fast, feature-rich Entity Component System for Roblox.

AlloyECS

A fast, feature-rich Entity Component System for Roblox.

Features

  • โšก High performance with bitset queries and caching
  • ๐Ÿท๏ธ Tag components for zero-cost markers
  • ๐Ÿ”— Entity relationships
  • ๐Ÿ“ฆ Prefab system for templates
  • ๐ŸŽฏ System scheduler with phases
  • ๐Ÿ”„ Change tracking (added/removed/changed)
  • ๐Ÿ’พ Serialization support

Installation

Manual

Download the latest release and add the src folder to your project.

Quick Start

local AlloyECS = require(path.to.AlloyECS)

local world = AlloyECS.createWorld()

-- Define components
local Position = world:component()
local Velocity = world:component()

-- Create entity
local entity = world:entity()
world:set(entity, Position, Vector3.zero)
world:set(entity, Velocity, Vector3.new(1, 0, 0))

-- Query and update
for id, pos, vel in world:query(Position, Velocity) do
    world:set(id, Position, pos + vel)
end

License

MIT