A fast, portable Entity Component System for Luau. https://ukendio.github.io/jecs/
Find a file
2024-10-01 14:01:25 +02:00
.github Fix CI 2024-08-29 15:45:25 +02:00
benches Update Matter's time 2024-09-26 15:40:50 +02:00
demo Add nth parameter to world:target (#116) 2024-09-10 23:56:42 +02:00
docs Fix overview example (#120) 2024-09-16 22:16:50 +02:00
examples Add more examples 2024-09-29 05:36:21 +02:00
mirror Revert mirror (#79) 2024-07-14 06:35:13 +02:00
src Remove world:target debug error (#137) 2024-09-30 00:05:19 +02:00
test Allow nil indexing in world:target (#131) 2024-09-23 14:29:53 +02:00
thesis Add tests for scheduler example 2024-08-21 01:59:25 +02:00
.gitignore Fix column pointers invalidated by upvalues (#88) 2024-07-26 02:55:36 +02:00
.luaurc Fix invalid key 2024-09-09 02:18:08 +02:00
bench.project.json Less memory footprint 2024-07-14 05:38:44 +02:00
CHANGELOG.md Fix docs titles 2024-09-07 22:12:07 +02:00
default.project.json Update default.project.json (#71) 2024-07-08 14:43:35 +02:00
demo.rbxl decouple start 2024-09-08 19:45: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 Matter's time 2024-09-26 15:40:50 +02:00
image-4.png Move assertion up (#9) 2024-04-30 17:52:44 +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 Start Work on Documentation (#74) 2024-07-14 01:06:50 +02:00
package.json Update package.json (#121) 2024-09-16 21:47:58 +02:00
README.md Update README.md 2024-08-21 03:20:44 +02:00
rgb.luau Rename files to luau (#54) 2024-06-24 03:20:43 +02:00
rokit.toml Fix types in export 2024-08-18 16:46:52 +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 Implement testkit FOCUS() (#87) 2024-09-17 03:18:52 +02:00
tsconfig.json Add Typescript Types (#51) 2024-06-15 22:03:04 +02:00
wally.toml Bump to 0.3.1 2024-10-01 14:01:25 +02:00

License: Apache 2.0 Wally

jecs is 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
  • 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/visual/query.luau

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