Skip to content

Comments

Create new ecs system#432

Merged
stormmuller merged 20 commits intodevfrom
create-new-ecs-system
Jan 17, 2026
Merged

Create new ecs system#432
stormmuller merged 20 commits intodevfrom
create-new-ecs-system

Conversation

@stormmuller
Copy link
Member

No description provided.

stormmuller and others added 8 commits January 6, 2026 15:36
#427)

* Initial plan

* feat: migrate animation components and systems to new ECS style

Co-authored-by: stormmuller <17644200+stormmuller@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: stormmuller <17644200+stormmuller@users.noreply.github.com>
* Initial plan

* test: add comprehensive tests for audio system

Co-authored-by: stormmuller <17644200+stormmuller@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: stormmuller <17644200+stormmuller@users.noreply.github.com>
* Initial plan

* fix: update ecs test imports and API usage

Co-authored-by: stormmuller <17644200+stormmuller@users.noreply.github.com>

* fix: skip tests requiring old ECS API rewrite

Co-authored-by: stormmuller <17644200+stormmuller@users.noreply.github.com>

* fix: resolve build errors from old ECS API usage

Co-authored-by: stormmuller <17644200+stormmuller@users.noreply.github.com>

* fix: apply linting fixes

Co-authored-by: stormmuller <17644200+stormmuller@users.noreply.github.com>

* fix: rewrite system tests for new ECS API

Co-authored-by: stormmuller <17644200+stormmuller@users.noreply.github.com>

* fix: address code review feedback - use proper types, remove comments, delete empty test

Co-authored-by: stormmuller <17644200+stormmuller@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: stormmuller <17644200+stormmuller@users.noreply.github.com>
* Initial plan

* feat: update utility functions to use new ECS implementation

Co-authored-by: stormmuller <17644200+stormmuller@users.noreply.github.com>

* fix: replace any types with proper type imports in add-camera

Co-authored-by: stormmuller <17644200+stormmuller@users.noreply.github.com>

* refactor: simplify add-camera by using Partial<CameraEcsComponent>

Co-authored-by: stormmuller <17644200+stormmuller@users.noreply.github.com>

* fix: remove automatic system addition from addCamera to prevent duplicates

Co-authored-by: stormmuller <17644200+stormmuller@users.noreply.github.com>

* fix: implement Stoppable interface and remove unnecessary return from addCamera

Co-authored-by: stormmuller <17644200+stormmuller@users.noreply.github.com>

* refactor: follow codebase conventions and uncomment migrated ECS code

- Remove unnecessary note from addCamera documentation
- Uncomment and migrate rotation, scale, flip, and animation code in create-sprite
- Refactor Game constructor to follow codebase convention (private fields with getters)

Co-authored-by: stormmuller <17644200+stormmuller@users.noreply.github.com>

* fix: remove time and world getters from Game class

Remove the public getters for time and world as they were not requested. Update internal usage to reference private fields directly.

Co-authored-by: stormmuller <17644200+stormmuller@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: stormmuller <17644200+stormmuller@users.noreply.github.com>
Co-authored-by: Storm <stormmuller2@gmail.com>
Copilot AI review requested due to automatic review settings January 10, 2026 22:22
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a complete rewrite of the ECS (Entity-Component-System) architecture, replacing class-based components and systems with a more data-oriented, performance-focused approach using sparse sets and symbol-based component identification.

Changes:

  • Replaces the entire ECS architecture with a new implementation using sparse sets for component storage
  • Migrates all components from classes to interfaces with symbol-based IDs
  • Converts all systems from classes to factory functions returning system objects
  • Removes the old Entity, World, and Game classes and associated infrastructure
  • Updates rendering, physics, particles, lifecycle, timer, and input systems to use the new ECS

Reviewed changes

Copilot reviewed 115 out of 115 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/new-ecs/* New ECS implementation with world, system, and component types
src/utilities/sparse-set.ts High-performance sparse set data structure for component storage
src/utilities/game.ts Simplified game loop manager
src/common/components/* Component migrations to interface-based approach
src/rendering/systems/* Rendering system migrations to new ECS
src/physics/systems/* Physics system migrations
src/particles/systems/* Particle system migrations
src/lifecycle/systems/* Lifecycle system migrations
src/timer/systems/* Timer system migration
src/input/systems/* Input system migrations
src/ecs/* Removal of old ECS implementation
src/pooling/* Removal of object pooling infrastructure

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

world = new EcsWorld();
time = new Time();
random = new Random(12345);
world.addSystem(createParticleEmitterEcsSystem(time, random));
Copy link

Copilot AI Jan 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Callee is not a function: it has type undefined.

Copilot uses AI. Check for mistakes.
// Helper function to count entities in world
function countEntities(world: EcsWorld): number {
let count = 0;
const testSystem = {
Copy link

Copilot AI Jan 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused variable testSystem.

Copilot uses AI. Check for mistakes.
Copilot AI and others added 2 commits January 11, 2026 14:36
… runtime checks (#433)

* Initial plan

* fix: update physics and particle emitter test files to meet requirements

Co-authored-by: stormmuller <17644200+stormmuller@users.noreply.github.com>

* fix: revert unintended linting changes to non-test files

Co-authored-by: stormmuller <17644200+stormmuller@users.noreply.github.com>

* fix: replace Vector2(0,0) with Vector2.zero and remove unnecessary try-catch blocks

Co-authored-by: stormmuller <17644200+stormmuller@users.noreply.github.com>

* fix: replace Vector2(0,0) with Vector2.zero and remove unnecessary comments

Co-authored-by: stormmuller <17644200+stormmuller@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: stormmuller <17644200+stormmuller@users.noreply.github.com>
@stormmuller
Copy link
Member Author

@copilot update the demo to use the new ECS system

Copy link
Contributor

Copilot AI commented Jan 11, 2026

@stormmuller I've opened a new pull request, #435, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI and others added 3 commits January 11, 2026 15:09
* Initial plan

* feat(demo): update demo to use new ECS system

Co-authored-by: stormmuller <17644200+stormmuller@users.noreply.github.com>

* feat(demo): add camera system to demo

Co-authored-by: stormmuller <17644200+stormmuller@users.noreply.github.com>

* refactor: replace ControlAdventurerEcsComponent with tag in control-adventurer system

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: stormmuller <17644200+stormmuller@users.noreply.github.com>
Co-authored-by: Storm <stormmuller2@gmail.com>
@stormmuller
Copy link
Member Author

@copilot fix the linting issues

Copy link
Contributor

Copilot AI commented Jan 11, 2026

@stormmuller I've opened a new pull request, #436, to work on those changes. Once the pull request is ready, I'll request review from you.

@stormmuller
Copy link
Member Author

@copilot please fix the build issues

Copy link
Contributor

Copilot AI commented Jan 11, 2026

@stormmuller I've opened a new pull request, #437, to work on those changes. Once the pull request is ready, I'll request review from you.

@stormmuller stormmuller merged commit 9f1154a into dev Jan 17, 2026
10 checks passed
@stormmuller stormmuller deleted the create-new-ecs-system branch January 17, 2026 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants