A fast, portable Entity Component System for Luau. https://ukendio.github.io/jecs/
Find a file
2024-12-14 11:30:50 +03:00
.github Update workflows 2024-11-23 04:47:12 +01:00
assets Cleanup repository 2024-11-23 04:42:54 +01:00
benches Cleanup repository 2024-11-23 04:42:54 +01:00
demo resolves requiring ecs path issue for demo (#160) 2024-11-30 06:11:17 +01:00
docs Fix typos in docs (#151) 2024-11-17 21:05:20 +01:00
examples style: fix inconsistent project formatting (#144) 2024-10-12 22:18:11 +02:00
test Cleanup repository 2024-11-23 04:42:54 +01:00
thesis Add tests for scheduler example 2024-08-21 01:59:25 +02:00
.gitignore Add cleanup to types 2024-10-09 00:54:22 +02:00
.luaurc Cleanup repository 2024-11-23 04:42:54 +01:00
.prettierrc Update ts type definitions (#142) 2024-10-12 03:45:37 +02:00
bench.project.json Update changelog 2024-11-23 20:52:01 +01:00
CHANGELOG.md Update changelog 2024-11-23 20:52:01 +01:00
default.project.json Cleanup repository 2024-11-23 04:42:54 +01:00
demo.rbxl decouple start 2024-09-08 19:45:49 +02:00
jecs.d.ts fix "set" method defition 2024-12-14 11:30:50 +03:00
jecs.luau Remove upvalues 2024-11-23 20:50:15 +01:00
LICENSE Create LICENSE 2024-06-11 21:06:27 +02:00
mirror.luau Cleanup repository 2024-11-23 04:42:54 +01:00
mkdocs.yml Fix docs 2024-05-27 03:50:46 +02:00
package-lock.json refactor types 2024-12-09 14:15:28 +03:00
package.json Update changelog 2024-11-23 20:52:01 +01:00
README.md Cleanup repository 2024-11-23 04:42:54 +01:00
rokit.toml fix(ci): stylua ci failing (#158) 2024-11-22 22:14:10 +01:00
selene.toml Fix style and add some micro optimizations (#27) 2024-05-05 01:52:01 +02:00
stylua.toml fix(ci): stylua ci failing (#158) 2024-11-22 22:14:10 +01:00
testez.d.luau Rename files to luau (#54) 2024-06-24 03:20:43 +02:00
tsconfig.json Update roblox-ts 2024-10-21 19:31:51 +02:00
wally.toml Bump 2024-11-23 04:46:03 +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