A fast, portable Entity Component System for Luau. https://ukendio.github.io/jecs/
Find a file
2024-07-02 12:53:33 +02:00
.github/workflows Release (#43) 2024-05-19 04:17:22 +02:00
benches Update benchmarks (#55) 2024-06-24 19:02:27 +02:00
docs Merge branch 'main' of https://github.com/Ukendio/jecs 2024-05-27 20:09:25 +02:00
lib Drainless iterators 2024-07-02 12:53:33 +02:00
mirror Rename files to luau (#54) 2024-06-24 03:20:43 +02:00
tests Rename files to luau (#54) 2024-06-24 03:20:43 +02:00
thesis Publish paper 2024-04-23 17:20:33 +02:00
.gitignore Add Typescript Types (#51) 2024-06-15 22:03:04 +02:00
aftman.toml Bump wally to 0.3.2 2024-05-14 03:22:05 +02:00
bench.project.json Update benchmarks (#55) 2024-06-24 19:02:27 +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 Update benchmarks image 2024-06-22 01:08:51 +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
LICENSE Create LICENSE 2024-06-11 21:06:27 +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
package-lock.json Add Typescript Types (#51) 2024-06-15 22:03:04 +02:00
package.json Add Typescript Types (#51) 2024-06-15 22:03:04 +02:00
README.md Update README.md 2024-06-24 04:08:57 +02:00
rgb.luau Rename files to luau (#54) 2024-06-24 03:20:43 +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.luau Rename files to luau (#54) 2024-06-24 03:20:43 +02:00
testkit.luau Rename files to luau (#54) 2024-06-24 03:20:43 +02:00
tsconfig.json Add Typescript Types (#51) 2024-06-15 22:03:04 +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 500,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

21,000 entities 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