mirror of
https://github.com/Ukendio/jecs.git
synced 2025-04-25 01:20:04 +00:00
A fast, portable Entity Component System for Luau.
https://ukendio.github.io/jecs/
data-orienteddata-oriented-designecsentity-component-systemgame-developmentgamedevjecslualuauno-dependencies
.github | ||
assets | ||
benches | ||
demo | ||
docs | ||
examples | ||
test | ||
thesis | ||
tools | ||
.gitignore | ||
.luaurc | ||
.prettierrc | ||
bench.project.json | ||
CHANGELOG.md | ||
default.project.json | ||
demo.rbxl | ||
jecs.d.ts | ||
jecs.luau | ||
LICENSE | ||
mirror.luau | ||
mkdocs.yml | ||
package-lock.json | ||
package.json | ||
README.md | ||
rokit.toml | ||
selene.toml | ||
stress.project.json | ||
stylua.toml | ||
testez.d.luau | ||
tsconfig.json | ||
wally.toml |
Jecs - Just a Stupidly Fast ECS
A high-performance Entity Component System (ECS) for Roblox games.
Features
- 🚀 Blazing Fast: Iterate over 800,000 entities at 60 frames per second
- 🔗 Entity Relationships: First-class support for entity relationships
- 🔒 Type Safety: Fully typed API for both Luau and TypeScript
- 📦 Zero Dependencies: No external dependencies required
- ⚡ Optimized Storage: Cache-friendly archetype/SoA storage
- ✅ Battle-tested: Rigorously unit tested for stability
Documentation
Quick Example
local world = jecs.World.new()
local pair = jecs.pair
-- Define components
local Position = world:component() :: jecs.Entity<Vector3>
local Velocity = world:component() :: jecs.Entity<Vector3>
-- Create an entity
local entity = world:entity()
world:set(entity, Position, Vector3.new(0, 0, 0))
world:set(entity, Velocity, Vector3.new(1, 0, 0))
-- Update system
for id, position, velocity in world:query(Position, Velocity) do
world:set(id, Position, position + velocity)
end
Performance
Query Performance
21,000 entities, 125 archetypes, 4 random components queried:
Insertion Performance
Inserting 8 components to an entity and updating them over 50 times:
Installation
Using Wally
[dependencies]
jecs = "ukendio/jecs@0.2.3"
Using npm (roblox-ts)
npm i @rbxts/jecs
Standalone
Download jecs.rbxm
from our releases page.
Contributing
We welcome contributions! Please see our contribution guidelines for details.
Community & Support
License
Jecs is MIT licensed.