A fast, portable Entity Component System for Luau. https://ukendio.github.io/jecs/
Find a file
2025-03-27 05:08:38 +01:00
.github Reorganize repo 2025-03-27 02:33:38 +01:00
assets Target should return the entity with its generation 2025-03-26 14:23:54 +01:00
benches Reorganize repo 2025-03-27 02:33:38 +01:00
coverage Add html files to coverage folder 2025-03-27 03:55:43 +01:00
demo Reorganize repo 2025-03-27 02:33:38 +01:00
docs Update Jecs version to latest in get-started.md (#199) 2025-02-23 18:34:53 +01:00
examples Modify example 2025-02-05 22:26:12 +01:00
test Clear ID will remove ID from all entities 2025-03-27 05:08:38 +01:00
thesis Add tests for scheduler example 2024-08-21 01:59:25 +02:00
tools Reorganize repo 2025-03-27 02:33:38 +01:00
.gitattributes Exclude html coverage reports from language stats 2025-03-27 04:09:09 +01:00
.gitignore Add html files to coverage folder 2025-03-27 03:55:16 +01:00
.luaurc Add entity visualiser 2025-03-12 16:30:19 +01:00
.prettierrc Update ts type definitions (#142) 2024-10-12 03:45:37 +02:00
.stylua.toml Add html files to coverage folder 2025-03-27 03:55:16 +01:00
bench.project.json Update changelog 2024-11-23 20:52:01 +01:00
CHANGELOG.md Fix types (#190) 2025-02-14 10:51:30 +01:00
default.project.json Cleanup repository 2024-11-23 04:42:54 +01:00
jecs.d.ts Change TS types for Archetype 2025-03-02 01:24:53 +01:00
jecs.luau Clear ID will remove ID from all entities 2025-03-27 05:08:38 +01:00
LICENSE Create LICENSE 2024-06-11 21:06:27 +02:00
mirror.luau Change invocation points for hooks 2025-03-24 14:31:56 +01:00
package-lock.json Reorganize repo 2025-03-27 02:33:38 +01:00
package.json Change TS types for Archetype 2025-03-02 01:24:53 +01:00
README.md Cleanup repository 2024-11-23 04:42:54 +01:00
rokit.toml Reorganize repo 2025-03-27 02:33:38 +01:00
text.txt Clear ID will remove ID from all entities 2025-03-27 05:08:38 +01:00
tsconfig.json Update roblox-ts 2024-10-21 19:31:51 +02:00
wally.toml Bump 2025-03-01 20:16:26 +01:00

License: MIT Wally

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

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

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