A fast, portable Entity Component System for Luau. https://ukendio.github.io/jecs/
Find a file
2025-06-05 22:48:13 +02:00
.github Fix line endings (#233) 2025-06-05 22:00:29 +02:00
addons fix typo, queyr -> query 2025-05-27 18:05:59 +01:00
assets Fix line endings (#233) 2025-06-05 22:00:29 +02:00
benches fix line endings (#234) 2025-06-05 22:48:13 +02:00
demo fix line endings (#234) 2025-06-05 22:48:13 +02:00
docs Fix line endings (#233) 2025-06-05 22:00:29 +02:00
examples Modify example 2025-02-05 22:26:12 +01:00
test fix line endings (#234) 2025-06-05 22:48:13 +02:00
thesis Add tests for scheduler example 2024-08-21 01:59:25 +02:00
tools Fix line endings (#233) 2025-06-05 22:00:29 +02:00
.gitattributes Fix line endings (#233) 2025-06-05 22:00:29 +02:00
.gitignore Fix line endings (#233) 2025-06-05 22:00:29 +02:00
.luaurc Fix line endings (#233) 2025-06-05 22:00:29 +02:00
.prettierrc Update ts type definitions (#142) 2024-10-12 03:45:37 +02:00
.stylua.toml Fix line endings (#233) 2025-06-05 22:00:29 +02:00
bench.project.json Update changelog 2024-11-23 20:52:01 +01:00
CHANGELOG.md Cleanup changelog 2025-05-10 23:27:35 +02:00
default.project.json Cleanup repository 2024-11-23 04:42:54 +01:00
jecs.d.ts Change types for tag and is_tag fns 2025-05-28 13:31:03 -04:00
jecs.luau Fix line endings 2025-06-01 16:11:32 +02:00
LICENSE Create LICENSE 2024-06-11 21:06:27 +02:00
mirror.luau Revert mirror back to pinned version 2025-03-27 06:33:41 +01:00
package-lock.json Allow world.add() to accept component, add world.entity overload (#225) 2025-05-18 01:44:22 +02:00
package.json Bump versions 2025-05-10 21:38:47 +02:00
README.md Cleanup README links and headers 2025-05-27 14:39:48 -04:00
rokit.toml Networking example 2025-04-28 23:40:03 +02:00
tsconfig.json Fix line endings (#233) 2025-06-05 22:00:29 +02:00
wally.toml Fix line endings (#233) 2025-06-05 22:00:29 +02:00

License: MIT Wally GitHub Actions Workflow Status

Just a stupidly fast Entity Component System

  • Entity Relationships as first class citizens
  • Iterate 800,000 entities at 60 frames per second
  • Type-safe Luau API
  • Zero-dependency package
  • Optimized for column-major operations
  • Cache friendly archetype/SoA storage
  • Rigorously unit tested for stability

Installation

With Wally:

jecs = "ukendio/jecs@0.6.0" # Inside wally.toml

With pesde:

pesde add wally#ukendio/jecs@0.6.0

With npm (roblox-ts):

npm i @rbxts/jecs

Example

local world = jecs.World.new()
local pair = jecs.pair

-- These components and functions are actually already builtin
-- but have been illustrated for demonstration purposes
local ChildOf = world:component()
local Name = world:component()

local function parent(entity)
    return world:target(entity, ChildOf)
end
local function getName(entity)
    return world:get(entity, Name)
end

local alice = world:entity()
world:set(alice, Name, "alice")

local bob = world:entity()
world:add(bob, pair(ChildOf, alice))
world:set(bob, Name, "bob")

local sara = world:entity()
world:add(sara, pair(ChildOf, alice))
world:set(sara, Name, "sara")

print(getName(parent(sara)))

for e in world:query(pair(ChildOf, alice)) do
    print(getName(e), "is the child of alice")
end

-- Output
-- "alice"
-- bob is the child of alice
-- sara is the child of alice

Benchmarks

21,000 entities 125 archetypes 4 random components queried. Queries Can be found under /benches/visual/query.luau

Inserting 8 components to an entity and updating them over 50 times. Insertions Can be found under /benches/visual/insertions.luau