A fast, portable Entity Component System for Luau. https://ukendio.github.io/jecs/
Find a file
2024-05-27 20:09:25 +02:00
.github/workflows Release (#43) 2024-05-19 04:17:22 +02:00
benches Release (#44) 2024-05-19 04:30:20 +02:00
docs Merge branch 'main' of https://github.com/Ukendio/jecs 2024-05-27 20:09:25 +02:00
lib Add docs (#45) 2024-05-27 03:39:20 +02:00
mirror Update mirror 2024-05-05 15:06:57 +02:00
tests Add docs (#45) 2024-05-27 03:39:20 +02:00
thesis Publish paper 2024-04-23 17:20:33 +02:00
.gitignore Add case for when component is not found in archetype (#25) 2024-05-08 00:57:22 +02:00
aftman.toml Bump wally to 0.3.2 2024-05-14 03:22:05 +02:00
bench.project.json Release (#44) 2024-05-19 04:30:20 +02:00
default.project.json Rebase 2024-04-23 17:10:49 +02:00
image-1.png More benchmarks 2024-04-25 05:48:22 +02:00
image-2.png Update benchmark 2024-04-25 05:55:11 +02:00
image-3.png Include ECR in benchmark 2024-04-25 16:41:41 +02:00
image-4.png Move assertion up (#9) 2024-04-30 17:52:44 +02:00
image.png Add image 2024-04-24 02:24:34 +02:00
jecs_darkmode.svg Add svg images (#18) 2024-05-07 18:37:14 +02:00
jecs_lightmode.svg Add svg images (#18) 2024-05-07 18:37:14 +02:00
logo_old.png Add svg images (#18) 2024-05-07 18:37:14 +02:00
mkdocs.yml Fix docs 2024-05-27 03:50:46 +02:00
README.md Add docs (#45) 2024-05-27 03:39:20 +02:00
rgb.lua Rebase 2024-04-23 17:10:49 +02:00
selene.toml Fix style and add some micro optimizations (#27) 2024-05-05 01:52:01 +02:00
stylua.toml Fix style and add some micro optimizations (#27) 2024-05-05 01:52:01 +02:00
test.project.json Release (#44) 2024-05-19 04:30:20 +02:00
testez-companion.toml Fix style and add some micro optimizations (#27) 2024-05-05 01:52:01 +02:00
testez.d.lua Rebase 2024-04-23 17:10:49 +02:00
testkit.lua Add testkit 2024-05-01 14:41:51 +02:00
wally.toml Release (#44) 2024-05-19 04:30:20 +02:00

License: Apache 2.0 Wally

Just an ECS

jecs is a stupidly fast Entity Component System (ECS).

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

Example

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

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

125 archetypes, 4 random components queried. Queries Can be found under /benches/query.lua

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