From 93cbd2d287226062885f24737958c4b3cf7d4bad Mon Sep 17 00:00:00 2001 From: EncodedVenom Date: Sat, 24 May 2025 16:38:53 -0400 Subject: [PATCH 1/4] Add installation methods --- README.md | 15 +++++++++++++++ docs/learn/overview.md | 17 +++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/README.md b/README.md index 723874c..7db4e13 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,21 @@ Just a stupidly fast Entity Component System - Cache friendly [archetype/SoA](https://ajmmertens.medium.com/building-an-ecs-2-archetypes-and-vectorization-fe21690805f9) storage - Rigorously [unit tested](https://github.com/Ukendio/jecs/actions/workflows/ci.yaml) for stability +### Installation + +With [Wally](https://wally.run/): +```bash +jecs = "ukendio/jecs@0.6.0" # Inside wally.toml +``` +With [pesde](https://pesde.dev/): +```bash +pesde add wally#ukendio/jecs@0.6.0 +``` +With [npm](https://www.npmjs.com/package/@rbxts/jecs) ([roblox-ts](https://roblox-ts.com/)): +```bash +npm i @rbxts/jecs +``` + ### Example ```lua diff --git a/docs/learn/overview.md b/docs/learn/overview.md index 9047a01..55c4f1f 100644 --- a/docs/learn/overview.md +++ b/docs/learn/overview.md @@ -2,6 +2,23 @@ Jecs is a standalone entity-component-system module written in Luau. ECS ("entity-component-system") describes one way to write games in a more data oriented design. +## Installation + +Jecs supports the following installation methods using package managers: +:::code-group +```bash [wally] +jecs = "ukendio/jecs@0.6.0" # Inside wally.toml +``` +```bash [pesde] +pesde add wally#ukendio/jecs@0.6.0 +``` +```bash [npm] +npm i @rbxts/jecs +``` +::: + +Additionally an `rbxm` is published with [each release under the assets submenu](https://github.com/Ukendio/jecs/releases/latest). + ## Hello World, Entity and Component It all has to start somewhere. A world stores entities and their components, and manages them. This tour will reference it for every operation. :::code-group From 077030738a16367b5fc14ed419562a18f81b4d17 Mon Sep 17 00:00:00 2001 From: Taran McVay Date: Tue, 27 May 2025 18:05:59 +0100 Subject: [PATCH 2/4] fix typo, queyr -> query --- addons/observers.luau | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/observers.luau b/addons/observers.luau index b725e7c..809d32e 100644 --- a/addons/observers.luau +++ b/addons/observers.luau @@ -7,7 +7,7 @@ type Observer = { type Monitor = { callback: (jecs.Entity, jecs.Entity) -> (), - queyr: jecs.Query + query: jecs.Query } export type PatchedWorld = jecs.World & { From c62db9f8c32a83da97e3c722bdde8c383160734c Mon Sep 17 00:00:00 2001 From: EncodedVenom <32179912+EncodedVenom@users.noreply.github.com> Date: Tue, 27 May 2025 14:39:48 -0400 Subject: [PATCH 3/4] Cleanup README links and headers --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7db4e13..bb0d4b0 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Just a stupidly fast Entity Component System - Zero-dependency package - Optimized for column-major operations - Cache friendly [archetype/SoA](https://ajmmertens.medium.com/building-an-ecs-2-archetypes-and-vectorization-fe21690805f9) storage -- Rigorously [unit tested](https://github.com/Ukendio/jecs/actions/workflows/ci.yaml) for stability +- Rigorously [unit tested](https://github.com/Ukendio/jecs/actions/workflows/unit-testing.yaml) for stability ### Installation @@ -70,6 +70,8 @@ end -- sara is the child of alice ``` +### Benchmarks + 21,000 entities 125 archetypes 4 random components queried. ![Queries](assets/image-3.png) Can be found under /benches/visual/query.luau From b669196a9889e8db5d0e6fced203522af908a59f Mon Sep 17 00:00:00 2001 From: EncodedVenom <32179912+EncodedVenom@users.noreply.github.com> Date: Wed, 28 May 2025 13:31:03 -0400 Subject: [PATCH 4/4] Change types for tag and is_tag fns --- jecs.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/jecs.d.ts b/jecs.d.ts index 6047d30..72b3215 100644 --- a/jecs.d.ts +++ b/jecs.d.ts @@ -244,12 +244,12 @@ export class World { export function component(): Entity; -export function tag(): Entity; +export function tag(): Tag; // note: original types had id: Entity, id: Id, which does not work with TS. -export function meta(e: Entity, id: Id, value?: T): Entity +export function meta(e: Entity, id: Id, value?: T): Entity; -export function is_tag(world: World, id: Id): boolean; +export function is_tag(world: World, id: Id): boolean; /** * Creates a composite key (pair)