A fast, portable Entity Component System for Luau. https://ukendio.github.io/jecs/
Find a file
EncodedVenom c697030ec4 debug
2024-10-19 19:53:43 -04:00
.github get around permissions 2024-10-19 19:52:21 -04:00
benches style: fix inconsistent project formatting (#144) 2024-10-12 22:18:11 +02:00
demo style: fix inconsistent project formatting (#144) 2024-10-12 22:18:11 +02:00
docs docs: fix syntax in ts example (#146) 2024-10-15 02:03:13 +02:00
examples style: fix inconsistent project formatting (#144) 2024-10-12 22:18:11 +02:00
mirror style: fix inconsistent project formatting (#144) 2024-10-12 22:18:11 +02:00
scripts debug 2024-10-19 19:53:43 -04:00
src style: fix inconsistent project formatting (#144) 2024-10-12 22:18:11 +02:00
test style: fix inconsistent project formatting (#144) 2024-10-12 22:18:11 +02: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 fix: remove json trailing comma (#145) 2024-10-13 22:37:11 +02:00
.prettierrc Update ts type definitions (#142) 2024-10-12 03:45:37 +02:00
bench.project.json Less memory footprint 2024-07-14 05:38:44 +02:00
CHANGELOG.md Update changelog 2024-10-12 22:04:32 +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
image-5.png Change logo 2024-10-06 05:42:18 +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 Merge to main branch 2024-10-12 22:06:31 +02:00
README.md Merge to main branch 2024-10-12 22:06:31 +02:00
rgb.luau style: fix inconsistent project formatting (#144) 2024-10-12 22:18:11 +02:00
rokit.toml style: fix inconsistent project formatting (#144) 2024-10-12 22:18:11 +02:00
selene.toml Fix style and add some micro optimizations (#27) 2024-05-05 01:52:01 +02:00
stylua.toml style: fix inconsistent project formatting (#144) 2024-10-12 22:18:11 +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 style: fix inconsistent project formatting (#144) 2024-10-12 22:18:11 +02:00
tsconfig.json Add Typescript Types (#51) 2024-06-15 22:03:04 +02:00
wally.toml bump 2024-10-02 22:59:33 +02:00

License: Apache 2.0 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