A fast, portable Entity Component System for Luau. https://ukendio.github.io/jecs/
Find a file
Marcus a73eeb1a4f
Demo (#96)
* Fix query types

* Add systems to demo

* Remove comments of inlined versions

* Fix style

* Replication

* Test :iter
2024-08-07 18:45:56 +02:00
.github Update ci.yaml (#82) 2024-07-15 19:10:56 +02:00
benches Save column indexing 2024-07-30 19:36:53 +02:00
demo Demo (#96) 2024-08-07 18:45:56 +02:00
docs Tree main 2024-08-03 06:30:08 +02:00
examples Add wildcards 2024-08-03 06:21:56 +02:00
mirror Revert mirror (#79) 2024-07-14 06:35:13 +02:00
src Merge branch 'main' of https://github.com/Ukendio/jecs 2024-08-07 18:44:38 +02:00
test Example (#93) 2024-08-03 05:48:48 +02:00
thesis Add pages to docs (#92) 2024-07-31 02:43:24 +02:00
.gitignore Fix column pointers invalidated by upvalues (#88) 2024-07-26 02:55:36 +02:00
.luaurc Change casing 2024-07-15 20:29:06 +02:00
aftman.toml Demo (#96) 2024-08-07 18:45:56 +02:00
bench.project.json Less memory footprint 2024-07-14 05:38:44 +02:00
CHANGELOG.md Fix grammar 2024-07-07 05:17:12 +02:00
default.project.json Update default.project.json (#71) 2024-07-08 14:43:35 +02:00
demo.project.json Demo (#96) 2024-08-07 18:45:56 +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 Zoom into picture 2024-07-30 19:40:54 +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 Start Work on Documentation (#74) 2024-07-14 01:06:50 +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 Add skip to testkit (#77) 2024-07-14 02:37:16 +02:00
tsconfig.json Add Typescript Types (#51) 2024-06-15 22:03:04 +02:00
wally.toml Bump version (#94) 2024-08-03 05:53:49 +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