Conversation
#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>
… all component and systems
* 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>
There was a problem hiding this comment.
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)); |
There was a problem hiding this comment.
Callee is not a function: it has type undefined.
| // Helper function to count entities in world | ||
| function countEntities(world: EcsWorld): number { | ||
| let count = 0; | ||
| const testSystem = { |
There was a problem hiding this comment.
Unused variable testSystem.
… 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>
|
@copilot update the demo to use the new ECS system |
|
@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. |
* 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>
|
@copilot fix the linting issues |
|
@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. |
…d improve assertions
|
@copilot please fix the build issues |
|
@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. |
No description provided.