A fast, portable Entity Component System for Luau. https://ukendio.github.io/jecs/
Find a file
2025-02-20 00:01:27 +05:30
.github Bump analysis.yaml 2025-02-02 19:06:11 -05:00
assets Cleanup repository 2024-11-23 04:42:54 +01:00
benches Improve cached queries 2025-01-14 11:09:18 +01:00
demo Modify example 2025-02-05 22:26:12 +01:00
docs Fix: #50 Updated Documentation 2025-02-19 21:40:38 +05:30
examples Modify example 2025-02-05 22:26:12 +01:00
test Add stress test 2025-02-15 21:57:30 +01:00
thesis Add tests for scheduler example 2024-08-21 01:59:25 +02:00
tools Cleanup codebase 2025-01-29 08:28:08 +01:00
.gitignore Cleanup codebase 2025-01-29 08:28:08 +01:00
.luaurc Cleanup repository 2024-11-23 04:42:54 +01:00
.prettierrc Update ts type definitions (#142) 2024-10-12 03:45:37 +02:00
bench.project.json Update changelog 2024-11-23 20:52:01 +01:00
CHANGELOG.md Fix types (#190) 2025-02-14 10:51:30 +01:00
default.project.json Cleanup repository 2024-11-23 04:42:54 +01:00
demo.rbxl decouple start 2024-09-08 19:45:49 +02:00
jecs.d.ts Typescript Types for Archetypes 2025-01-31 15:29:32 +01:00
jecs.luau Fix types (#190) 2025-02-14 10:51:30 +01:00
LICENSE Create LICENSE 2024-06-11 21:06:27 +02:00
mirror.luau Cleanup repository 2024-11-23 04:42:54 +01:00
mkdocs.yml Fix docs 2024-05-27 03:50:46 +02:00
package-lock.json 0.4.0-rc.0 2024-11-14 21:11:23 +01:00
package.json Bump 2025-01-17 10:42:24 +01:00
README.md Update README.md 2025-02-20 00:01:27 +05:30
rokit.toml fix(ci): stylua ci failing (#158) 2024-11-22 22:14:10 +01:00
selene.toml Fix style and add some micro optimizations (#27) 2024-05-05 01:52:01 +02:00
stress.project.json Add stress test 2025-02-15 21:57:30 +01:00
stylua.toml fix(ci): stylua ci failing (#158) 2024-11-22 22:14:10 +01:00
testez.d.luau Rename files to luau (#54) 2024-06-24 03:20:43 +02:00
tsconfig.json Update roblox-ts 2024-10-21 19:31:51 +02:00
wally.toml Bump 2025-01-17 10:42:24 +01:00

Jecs Logo

License: MIT Wally

Jecs

Just a Stupidly Fast ECS for Roblox

License: MIT Wally

Jecs - Just a Stupidly Fast ECS

A high-performance Entity Component System (ECS) for Roblox games, with first-class support for both Luau and TypeScript.

A high-performance Entity Component System (ECS) for Roblox games, supporting both Luau and TypeScript.

Features

Features

  • 🚀 Blazing Fast: Iterate over hundreds of thousands of entities at 60 FPS
  • 🔗 Entity Relationships: First-class support for entity relationships
  • 🏷️ Component Traits: Add metadata and behavior to components
  • 📝 Type Safety: Fully typed API for both Luau and TypeScript
  • 🎯 Zero Dependencies: Simple integration with no external dependencies
  • Optimized Storage: Cache-friendly archetype/SoA storage
  • Battle-tested: Comprehensive test coverage
  • 📚 Well Documented: Clear, thorough documentation and examples
  • Blazing Fast: Iterate over hundreds of thousands of entities at 60 frames per second. Benchmark results are available in the documentation.
  • Entity Relationships: First-class support for defining and querying relationships between entities.
  • Type Safety: Fully typed API for both Luau and TypeScript, enhancing code maintainability and reducing errors.
  • Zero Dependencies: No external dependencies required, simplifying integration into your project.
  • Optimized Storage: Cache-friendly archetype/SoA (Structure of Arrays) storage for optimal performance.
  • Battle-tested: Rigorously unit tested for stability and reliability.
  • Comprehensive Documentation: Detailed documentation guides you through installation, usage, and advanced concepts.

🚀 Quick Start

Installation

Documentation

Quick Example (Luau)

local world = jecs.World.new()
local Position = world:component() :: jecs.Entity<Vector3>
local Velocity = world:component() :: jecs.Entity<Vector3>

local entity = world:entity()
world:set(entity, Position, Vector3.new(0, 0, 0))
world:set(entity, Velocity, Vector3.new(1, 0, 0))

-- Update system (example)
for id, position, velocity in world:query(Position, Velocity) do
    world:set(id, Position, position + velocity)
end

Quick Example (TypeScript)

import { World } from "@rbxts/jecs";

const world = new World();
const Position = world.component<Vector3>();
const Velocity = world.component<Vector3>();

const entity = world.entity();
world.set(entity, Position, new Vector3(0, 0, 0));
world.set(entity, Velocity, new Vector3(1, 0, 0));

// Update system (example)
for (const [id, position, velocity] of world.query(Position, Velocity)) {
    world.set(id, Position, position.add(velocity));
}

Performance

Benchmark results demonstrating Jecs' performance are available in the documentation. These include query and insertion performance tests.

Installation

Using Wally (Luau)

Add Jecs to your wally.toml:

Using Wally (recommended):

[dependencies]
jecs = "ukendio/jecs@0.2.3"

Then run:

wally install

Using npm (Roblox-ts)

npm install @rbxts/jecs

Standalone Installation

  1. Download jecs.rbxm from the releases page.
  2. Import it into your Roblox project.

Contributing

We welcome contributions! Please see our contribution guidelines for details.

Community & Support

License

Jecs is MIT licensed.


Jecs = "ukendio/jecs@VERSION"