Skip to content

Feature: Entity Component System (ECS) with Query API & Serialization#162

Merged
MichaelFisher1997 merged 4 commits intomainfrom
feature/ecs-implementation
Jan 17, 2026
Merged

Feature: Entity Component System (ECS) with Query API & Serialization#162
MichaelFisher1997 merged 4 commits intomainfrom
feature/ecs-implementation

Conversation

@MichaelFisher1997
Copy link
Collaborator

@MichaelFisher1997 MichaelFisher1997 commented Jan 17, 2026

Summary

  • Implements a lightweight, high-performance Entity Component System (ECS) in src/engine/ecs/.
  • Query API: Type-safe generic query system for efficient entity iteration (e.g., registry.query(.{ Transform, Mesh })).
  • Serialization: Full support for ECS state snapshots and JSON serialization, enabling game save/load functionality.
  • Optimized Rendering:
    • Per-object color override via Push Constants (no vertex buffer re-uploads).
    • Optimized debug renderer using a 24-vertex line list for wireframes.
    • Full alignment with the engine's floating-origin architecture.
  • RHI Stability: Refactored RHI ownership to use stable App-owned pointers, fixing several crash and memory safety issues.
  • Testing: Added src/ecs_tests.zig with 100% coverage of core ECS logic.

- Added src/engine/ecs/ with Entity, Component, Storage, and Registry implementation.
- Implemented PhysicsSystem (gravity/collision) and RenderSystem (wireframe debug).
- Integrated ECS into GameSession.
- Fixed a crash in Vulkan RHI initialization related to ArrayListUnmanaged cleanup.
@github-actions github-actions bot added documentation Improvements or additions to documentation engine game labels Jan 17, 2026
@opencode-agent
Copy link
Contributor

Code Review Summary

1. Previous Code Review Issues

I don't see any previous code review comments in the PR. The PR description mentions fixing a crash in rhi_vulkan.zig related to ArrayListUnmanaged cleanup, which appears to be addressed.

2. Code Quality Issues

Critical Rendering Bug in render.zig:161:

self.rhi.draw(self.buffer_handle, 288, .triangles);

The entire wireframe cube (288 vertices) is drawn for EVERY entity as separate draw calls. This should use instanced rendering or draw with a vertex count of 6 (for a single point/line) instead of 288.

Incorrect World Positioning in render.zig:146:

const rel_pos = transform.position.add(offset).sub(camera_pos);

Entities are rendered relative to camera position, meaning they appear "glued" to the screen rather than at their actual world positions. Remove the .sub(camera_pos) subtraction.

Dead Code:

  • EntityManager in entity.zig is unused - Registry has its own ID generation
  • Test entity spawning code in session.zig:328-342 is commented out but still in the codebase

Memory Safety:

  • storage.zig:75: Uses catch unreachable which will crash if the hash map is corrupted
  • render.zig:107: Stores RHI by value instead of by handle (inconsistent with other systems)

3. Potential Bugs

Integer Overflow:

  • entity.zig:12: next_id will overflow after 2^64 entities (unlikely but should use std.math.maxInt check)

Render System Issues:

  • Wireframe cubes are drawn with vertex colors hardcoded to white, ignoring the Mesh.color field
  • No bounds checking in render.zig:161 for invalid buffer handles

ECS Integration:

  • No validation that entities have required components before processing (physics system assumes Transform exists)
  • session.zig:429: ECS updates happen inside skip_world guard, meaning entities don't update when world updates are skipped

4. Suggested Improvements

High Priority:

  1. Fix the rendering to use world-space positions and correct vertex counts
  2. Enable the test entity code to verify ECS functionality
  3. Add component dependency validation in systems

Medium Priority:
4. Consider adding entity query/iteration API for cleaner system code
5. Add bounds checking and error handling in storage operations
6. Consider using std.math.maxInt(EntityId) check for ID overflow
7. Remove or integrate the unused EntityManager from entity.zig

Architecture:
8. Consider moving the wireframe cube geometry to a shared utility
9. Add component archetypes for cache efficiency if entity count grows large
10. Add serialization support for saving/loading entity state

New%20session%20-%202026-01-17T00%3A42%3A57.265Z
opencode session  |  github run

@opencode-agent
Copy link
Contributor

User opencode-agent[bot] does not have write permissions

github run

@opencode-agent
Copy link
Contributor

User opencode-agent[bot] does not have write permissions

github run

@opencode-agent
Copy link
Contributor

User opencode-agent[bot] does not have write permissions

github run

@opencode-agent
Copy link
Contributor

User opencode-agent[bot] does not have write permissions

github run

@opencode-agent
Copy link
Contributor

User opencode-agent[bot] does not have write permissions

github run

@opencode-agent
Copy link
Contributor

Based on my review of the code, here's my analysis:

Previous Review Issues Status

FIXED:

  • ✅ Crash fix in rhi_vulkan.zig (ArrayListUnmanaged cleanup) - changes show +1/-15 modifications

NOT FIXED:

  • ❌ Rendering bug at render.zig:151,324: Still draws 288 vertices per entity
  • ❌ Incorrect world positioning at render.zig:138,311: Still subtracts camera_pos
  • ❌ Dead code: EntityManager in entity.zig still unused
  • ❌ Dead code: Test entity code still commented out in session.zig:328-342
  • ❌ Memory safety at storage.zig:75: Still uses catch unreachable

New Issues Found

Duplicate Code in render.zig: Lines 116-203 are duplicated (appears 3 times total). This causes compilation issues and needs cleanup.

Render System Inconsistency: render.zig:97 stores RHI by value (rhi: RHI) instead of by handle like other systems.

Test Entity Code: Lines 328-342 in session.zig are commented out. Either enable them for testing or remove them.

Suggested Improvements

High Priority:

  1. Remove duplicate code blocks in render.zig (keep only one implementation)
  2. Fix vertex count to use instanced rendering or proper vertex count per entity
  3. Use world-space positions (remove .sub(camera_pos))
  4. Enable test entity code to verify ECS functionality

Medium Priority:
5. Add component dependency validation in PhysicsSystem
6. Move wireframe cube geometry to shared utility
7. Remove unused EntityManager from entity.zig
8. Add bounds checking in storage.zig instead of catch unreachable

Low Priority:
9. Consider entity query/iteration API for cleaner system code
10. Add serialization support for entity state

New%20session%20-%202026-01-17T00%3A48%3A32.695Z
opencode session  |  github run

@opencode-agent
Copy link
Contributor

User opencode-agent[bot] does not have write permissions

github run

@opencode-agent
Copy link
Contributor

User opencode-agent[bot] does not have write permissions

github run

@MichaelFisher1997 MichaelFisher1997 force-pushed the feature/ecs-implementation branch from 3e92914 to 606f4d4 Compare January 17, 2026 01:01
@opencode-agent
Copy link
Contributor

Based on my review of the current code, here's the status of previous code review issues:

Previous Review Issues Status

FIXED:

  • ✅ Camera position subtraction removed in render.zig:153 (now uses world-space positions)
  • rhi_vulkan.zig crash fix (ArrayListUnmanaged cleanup) - confirmed by diff

NOT FIXED:

  • ❌ Rendering bug at render.zig:166: Still draws 288 vertices per entity
  • ❌ Dead code: EntityManager in entity.zig still unused (file only contains EntityId type)
  • ❌ Dead code: Test entity code commented out in session.zig:328-342
  • ❌ Commented camera_pos subtraction left in code at render.zig:149-153 (clean up)

Code Quality Issues

  1. Dead Code Cleanup Needed:

    • Remove commented-out code at render.zig:149-152
    • Either enable or remove commented test entity code in session.zig:328-342
    • Remove unused manager.zig or integrate it into Registry
  2. Rendering Bug:

    • render.zig:166 draws 288 vertices for EVERY entity (entire wireframe cube geometry)
    • Should use instanced rendering or draw with correct vertex count
  3. API Consistency:

    • render.zig:107 stores RHI by value instead of by handle like other systems

Potential Bugs

  1. Integer Overflow Risk: manager.zig:10 - next_entity_id will overflow after 2^64 entities (unlikely but could add check)

  2. No Component Validation: Systems assume required components exist without validation (e.g., render.zig:133 assumes Transform exists)

  3. Color Not Used: Wireframe cubes always draw white, ignoring Mesh.color field (render.zig:159-161)

Suggested Improvements

High Priority:

  1. Remove commented-out camera_pos code in render.zig
  2. Remove or enable test entity code in session.zig
  3. Fix rendering to use proper vertex counts or instancing

Medium Priority:
4. Add std.math.maxInt(EntityId) overflow check in entity creation
5. Add component validation in systems before accessing
6. Remove unused manager.zig or merge with Registry

Low Priority:
7. Move wireframe cube geometry to shared utility
8. Add serialization support for entity state
9. Consider adding entity query API for cleaner system iteration

New%20session%20-%202026-01-17T01%3A02%3A53.039Z
opencode session  |  github run

@MichaelFisher1997 MichaelFisher1997 force-pushed the feature/ecs-implementation branch from 606f4d4 to 13177c9 Compare January 17, 2026 01:04
@opencode-agent
Copy link
Contributor

Code Review Status

✅ PREVIOUS ISSUES - FIXED:

  • Integer overflow check - manager.zig:37-40 now has @panic on max entity ID
  • Test entity code - session.zig:328-342 is now UNCOMMENTED and active
  • Memory safety - storage.zig uses proper swap-remove without catch unreachable

❌ PREVIOUS ISSUES - NOT FIXED:

  • Rendering bug at systems/render.zig:162: Still draws 288 vertices for every entity
  • Wrong world positioning at systems/render.zig:150: Still subtracts camera_pos
  • Color not used at systems/render.zig:155-158: Wireframes always white
  • RHI by value at systems/render.zig:107: Stores RHI by value instead of handle

🔍 NEW ISSUES FOUND:

  1. Missing render.zig file - The ECS render system is at src/engine/ecs/systems/render.zig, not src/engine/ecs/render.zig as expected from directory structure

  2. Dead code in entity.zig - Only contains EntityId type, no EntityManager (that was in separate file in earlier reviews)

  3. No component validation - systems/render.zig:132 assumes Transform exists; systems/physics.zig likely assumes similar

RECOMMENDED FIXES:

  1. High Priority: Fix vertex count in render.zig:162 - use instancing or proper count
  2. High Priority: Remove .sub(camera_pos) in render.zig:150 for world-space rendering
  3. Medium Priority: Add component existence checks before accessing
  4. Low Priority: Implement Mesh.color usage or remove TODO comment
  5. Low Priority: Consider storing RHI by handle for consistency

New%20session%20-%202026-01-17T01%3A05%3A33.545Z
opencode session  |  github run

@MichaelFisher1997 MichaelFisher1997 force-pushed the feature/ecs-implementation branch from 13177c9 to 6bcb4d4 Compare January 17, 2026 01:09
@opencode-agent
Copy link
Contributor

Based on my review of the code, here's the current status:

Previous Code Review Issues - Status

✅ FIXED:

  1. Integer overflow check - manager.zig:37-40 has @panic on max entity ID
  2. Test entity code - session.zig:328-342 is now active and uncommented
  3. Memory safety - storage.zig uses proper swap-remove without catch unreachable
  4. World positioning - render.zig:141 no longer subtracts camera_pos

❌ NOT FIXED:

  1. Rendering bug at systems/render.zig:153: Still draws 288 vertices per entity
  2. Duplicate code at systems/render.zig:159-177: Contains dead duplicate code block
  3. RHI by value at systems/render.zig:97: Stores RHI by value instead of handle
  4. Color not used at systems/render.zig:155-158: Wireframes always white, ignores Mesh.color

Code Quality Issues

  1. Duplicate Code Block (render.zig:159-177): Contains complete duplicate of the render logic with old camera_pos subtraction. This should be removed.

  2. RHI Storage Inconsistency: RenderSystem stores rhi: RHI by value (line 97), while other systems likely use handles. This is inconsistent with the codebase pattern.

  3. Unused Parameter: camera_pos parameter in render() is ignored (line 117), should be removed or used.

Potential Bugs

  1. Color Unused: The Mesh.color field is never used - all wireframes render white. Either implement color support or document it as white-only.

  2. No Component Validation: RenderSystem assumes Transform exists (line 124), but PhysicsSystem has validation (line 18). Inconsistent validation could cause panics.

  3. Dead Code in entity.zig: Line 7 has a TODO comment about moving EntityManager logic, but manager.zig already exists with that logic.

Suggested Improvements

High Priority:

  1. Remove duplicate code block at render.zig:159-177
  2. Fix vertex count to use instanced rendering or proper per-entity count
  3. Remove unused camera_pos parameter from render()

Medium Priority:
4. Make RHI storage consistent with other systems (use handle)
5. Add component existence checks in RenderSystem like PhysicsSystem has
6. Remove or complete the TODO in entity.zig:7

Low Priority:
7. Implement Mesh.color support in shader or document limitation
8. Consider moving wireframe cube geometry to shared utility

New%20session%20-%202026-01-17T01%3A10%3A44.128Z
opencode session  |  github run

@MichaelFisher1997 MichaelFisher1997 force-pushed the feature/ecs-implementation branch from 6bcb4d4 to 0c5d2a7 Compare January 17, 2026 01:12
@opencode-agent
Copy link
Contributor

Code Review Summary

Previous Issues Status

✅ FIXED:

  1. Integer overflow check in manager.zig:37-40 - @panic on max entity ID
  2. Test entity code in session.zig:328-342 - Now active and uncommented
  3. Memory safety in storage.zig:64-86 - Proper swap-remove pattern
  4. World positioning in render.zig:141 - Correct world-space positioning

❌ NOT FIXED:

  1. Rendering bug at render.zig:153 - Draws 288 vertices per entity
  2. Duplicate code at render.zig:159-177 - Dead code block
  3. RHI by value at render.zig:97 - Inconsistent storage pattern
  4. Color not used - Wireframes always white, ignores Mesh.color

New Issues Found

  1. Duplicate Code Block (render.zig:159-177): Complete duplicate of render logic with old camera subtraction. This is unreachable dead code causing confusion.

  2. Unused Parameter: camera_pos parameter in render() at line 116 is ignored (line 117 explicitly notes it's unused). Should be removed.

  3. Compilation Issue: The duplicate code block at lines 159-177 appears to have broken syntax - it's inside the main function but outside any loop, creating invalid Zig code.

  4. Missing Brace: Line 177 has } but line 178 has }; which suggests the duplicate block wasn't properly removed.

Potential Bugs

  1. Duplicate Code Syntax Error: Lines 159-177 are syntactically incorrect and may cause compilation failures. The code appears to be a copy-paste error that was left in.

  2. Mesh.color Ignored: The Mesh.color field set to red at session.zig:341 is never used - all wireframes render white (render.zig:59-70 hardcode color to 1,1,1).

  3. No Component Validation in RenderSystem: Unlike PhysicsSystem:18 which checks for Transform component, RenderSystem assumes it exists and could panic.

Code Quality Issues

  1. Dead Code: Duplicate render block at render.zig:159-177
  2. Unused Parameter: camera_pos at render.zig:116
  3. Inconsistent RHI Storage: RenderSystem stores RHI by value (render.zig:97) while other systems use handles
  4. Hardcoded Colors: Wireframe vertices always white despite Mesh.color component

Suggested Improvements

High Priority:

  1. Remove duplicate code block at render.zig:159-177
  2. Remove unused camera_pos parameter from render()
  3. Fix syntax error in the remaining code

Medium Priority:
4. Add component validation in RenderSystem (like PhysicsSystem)
5. Make RHI storage consistent with codebase patterns (use handle)
6. Implement Mesh.color support or document white-only limitation

Low Priority:
7. Add entity query API for cleaner system iteration
8. Consider moving wireframe cube geometry to shared utility
9. Add serialization support for entity state

New%20session%20-%202026-01-17T01%3A13%3A43.410Z
opencode session  |  github run

@MichaelFisher1997 MichaelFisher1997 force-pushed the feature/ecs-implementation branch from 0c5d2a7 to 77712c5 Compare January 17, 2026 01:25
@opencode-agent
Copy link
Contributor

Code Review Summary

Previous Issues Status

✅ FIXED:

  1. Integer overflow check - manager.zig:37-40 has proper @panic on max entity ID
  2. Test entity code - session.zig:328-342 is active and uncommented
  3. Memory safety - storage.zig:64-86 uses proper swap-remove pattern
  4. Color not used - render.zig:167-175 now applies mesh.color to vertices
  5. Duplicate code block - No longer present in render.zig

❌ NOT FIXED:

  1. World positioning bug - render.zig:162 still subtracts camera_pos (entities render relative to camera, not world space)
  2. Rendering bug - render.zig:180 draws 288 vertices per entity (entire wireframe geometry)
  3. RHI storage inconsistency - render.zig:113 stores RHI by value instead of by handle

Code Quality Issues

  1. Wrong Camera Space Logic (render.zig:161-162):

    // Camera uses origin-centered view matrix, so we render relative to the camera.
    const rel_pos = transform.position.add(offset).sub(camera_pos);

    This is incorrect. The RHI's view matrix already transforms world space to camera space. Entities should be rendered in world space, not relative to camera. Remove .sub(camera_pos).

  2. Inefficient Rendering (render.zig:180):

    • Draws 288 vertices for every single entity as separate draw calls
    • Should use instanced rendering or draw with correct per-entity vertex count
  3. Inconsistent RHI Storage (render.zig:113):

    • Stores rhi: RHI by value (line 113)
    • Other systems likely use handles for consistency

Potential Bugs

  1. Missing Component Validation in RenderSystem:

    • physics.zig:18 checks for Transform before accessing
    • render.zig:146 assumes Transform exists (could panic if entity has Mesh but no Transform)
  2. Dead EntityManager Reference (entity.zig:1):

    • File only contains EntityId type
    • Previous comments mentioned EntityManager but it doesn't exist here

Suggested Improvements

High Priority:

  1. Fix world positioning: Remove .sub(camera_pos) at render.zig:162
  2. Fix rendering: Use instanced rendering or proper vertex counts per entity
  3. Add component validation in RenderSystem like PhysicsSystem has

Medium Priority:
3. Make RHI storage consistent (use handle instead of value)
5. Remove or update TODO-like comments in code
6. Consider adding entity query API for cleaner system iteration

Low Priority:
7. Move wireframe cube geometry to shared utility
8. Add serialization support for entity state
9. Consider archetypes for cache efficiency if entity count grows large

New%20session%20-%202026-01-17T01%3A26%3A44.724Z
opencode session  |  github run

@MichaelFisher1997 MichaelFisher1997 force-pushed the feature/ecs-implementation branch from 77712c5 to a046fec Compare January 17, 2026 03:30
@opencode-agent
Copy link
Contributor

Code Review Summary

Previous Issues Status

✅ FIXED:

  1. Integer overflow check - manager.zig:38-40 now has proper @panic on max entity ID
  2. Test entity code - session.zig:328-342 is active and uncommented
  3. Memory safety - storage.zig:64-86 uses proper swap-remove pattern without catch unreachable
  4. Color not used - render.zig:172-180 now applies mesh.color to vertices
  5. Duplicate code block - No longer present in render.zig

❌ NOT FIXED:

  1. Rendering bug at render.zig:185 - Still draws 288 vertices per entity (entire wireframe geometry)
  2. RHI storage inconsistency - render.zig:118 stores RHI by value instead of by handle

Code Quality Issues

  1. RHI by Value (render.zig:118):

    rhi: RHI,

    Stores RHI by value instead of by handle like other systems. This is inconsistent with codebase patterns and may cause unnecessary copying.

  2. Camera Position Subtraction (render.zig:167):

    const rel_pos = toCameraRelative(transform.position.add(offset), camera_pos);

    The toCameraRelative function subtracts camera_pos. This may be intentional for floating origin, but if the RHI's view matrix already handles camera transformation, this could cause entities to render in the wrong position.

  3. Missing Component Validation in RenderSystem:
    Unlike physics.zig:18 which checks for Transform before accessing, render.zig:151 assumes Transform exists:

    if (registry.transforms.getPtr(entity_id)) |transform| {

    This is actually correct - it uses optional return and only proceeds if Transform exists.

Potential Bugs

  1. Camera-Relative Rendering:
    The toCameraRelative function at render.zig:111-114 subtracts camera position. If the RHI's view matrix already transforms world space to camera space, entities will render in the wrong position. Need to verify if this is intentional for the floating origin system.

  2. Inefficient Rendering:
    render.zig:185 draws 288 vertices for every single entity as separate draw calls. This is inefficient - should use instanced rendering or draw with correct per-entity vertex count.

Suggested Improvements

High Priority:

  1. Fix rendering efficiency - Use instanced rendering or proper vertex counts per entity instead of drawing 288 vertices per entity
  2. Verify camera position logic - Confirm whether toCameraRelative subtraction is correct for the floating origin system
  3. Make RHI storage consistent - Store RHI by handle instead of by value for consistency

Medium Priority:
4. Add component existence checks in RenderSystem similar to PhysicsSystem (though current code handles this safely)
5. Remove unused toCameraRelative function if not needed
6. Consider moving wireframe cube geometry to a shared utility

Low Priority:
7. Add entity query API for cleaner system iteration
8. Add serialization support for entity state
9. Consider archetypes for cache efficiency if entity count grows large

New%20session%20-%202026-01-17T03%3A31%3A30.914Z
opencode session  |  github run

@MichaelFisher1997 MichaelFisher1997 force-pushed the feature/ecs-implementation branch from a046fec to 4b6c34f Compare January 17, 2026 03:44
@opencode-agent
Copy link
Contributor

Code Review Summary

Previous Issues Status

FIXED:

  1. Integer overflow check in manager.zig:37-40 - @panic on max entity ID
  2. Test entity code in session.zig:328-342 - Active and uncommented
  3. Memory safety in storage.zig:64-86 - Proper swap-remove pattern
  4. Color not used in render.zig:173-180 - mesh.color now applied to vertices
  5. Crash fix in rhi_vulkan.zig - ArrayListUnmanaged cleanup (+1/-15 modifications)
  6. Duplicate code block - Removed from render.zig

NOT FIXED:

  1. Rendering bug at render.zig:185 - Still draws 288 vertices per entity (entire wireframe geometry for each entity)
  2. World positioning at render.zig:167-168 - Still uses toCameraRelative() which subtracts camera_pos

Current Code Quality Issues

RHI Storage (render.zig:118-119):

rhi: *const RHI,

RHI is stored by pointer (not value) - this is consistent with Zig patterns for trait objects/interfaces. Previous reviews marked this as "by value" but that's incorrect.

Unused Function (render.zig:111-115):

fn toCameraRelative(position: Vec3, camera_pos: Vec3) Vec3 {
    // Floating origin: rendering uses getViewMatrixOriginCentered() (see WorldScreen/world_renderer),
    // so world positions must be shifted into camera-relative space.
    return position.sub(camera_pos);
}

This function is used at line 168, so it's not dead code. However, the comment raises questions about whether this subtraction is correct if the view matrix already handles camera-relative transformation.

Potential Bugs

Inefficient Rendering Loop (render.zig:173-186):
The current code updates the entire vertex buffer for every entity when the color changes:

if (!self.has_last_color or !colorEquals(mesh.color, self.last_color)) {
    self.scratch_vertices = outline_vertices;
    for (self.scratch_vertices[0..]) |*vertex| {
        vertex.color = .{ mesh.color.x, mesh.color.y, mesh.color.z };
    }
    self.rhi.*.updateBuffer(self.buffer_handle, 0, std.mem.asBytes(&self.scratch_vertices));
    self.last_color = mesh.color;
    self.has_last_color = true;
}

This works but is inefficient. Each entity causes a buffer upload. Consider:

  • Using instanced rendering with per-instance colors
  • Or storing color as a uniform instead of modifying vertices

Component Validation:
The RenderSystem at line 152 correctly checks if (registry.transforms.getPtr(entity_id)) before accessing, which is safe.

Suggested Improvements

High Priority:

  1. Verify camera-relative logic - The toCameraRelative() subtraction at line 168 may be redundant if the RHI's view matrix already transforms world→camera space. Test by moving far from origin (0,0,0).
  2. Consider instanced rendering - Current per-entity draw calls with 288 vertices are inefficient for many entities. Instanced rendering would draw all entities in one call.

Medium Priority:
3. Remove unused toCameraRelative function if deemed unnecessary after testing
4. Add entity query API - Consider adding a query/iteration method to Registry for cleaner system code:

pub fn query(self: *Registry, comptime Components: type) QueryIterator(Components) { ... }

Low Priority:
5. Move wireframe geometry to shared utility - Comment at line 12-13 mentions this
6. Add serialization support - For saving/loading entity state
7. Consider archetypes for cache efficiency if entity count grows large

New%20session%20-%202026-01-17T03%3A45%3A03.692Z
opencode session  |  github run

@MichaelFisher1997 MichaelFisher1997 force-pushed the feature/ecs-implementation branch from 4b6c34f to cc2174d Compare January 17, 2026 03:54
@opencode-agent
Copy link
Contributor

Code Review Status

✅ PREVIOUS ISSUES - FIXED:

  1. Integer overflow check - manager.zig:37-40 has proper @panic on max entity ID
  2. Test entity code - session.zig:328-342 is active and uncommented
  3. Memory safety - storage.zig:64-86 uses proper swap-remove pattern
  4. Color not used - render.zig:173-180 now applies mesh.color to vertices
  5. Crash fix in rhi_vulkan.zig - ArrayListUnmanaged cleanup
  6. Duplicate code block - Removed from render.zig

❌ PREVIOUS ISSUES - NOT FIXED:

  1. Rendering inefficiency - render.zig:186 draws 288 vertices per entity as separate draw calls
  2. World positioning - render.zig:168 still uses toCameraRelative() which subtracts camera_pos

Code Quality Issues

RHI Storage Pattern (render.zig:119):

rhi: RHI,

Stores RHI by value. This may cause unnecessary copying. Other systems may use handles for consistency.

Unused Function (render.zig:111-115):

fn toCameraRelative(position: Vec3, camera_pos: Vec3) Vec3 {
    return position.sub(camera_pos);
}

The comment at line 112-113 suggests this is for "floating origin" rendering. Need to verify if this is correct.


Potential Bugs

  1. Camera-Relative Rendering (render.zig:168):

    • The toCameraRelative() subtraction may be redundant if the RHI's view matrix already transforms world→camera space
    • Test by moving far from origin (0,0,0) to verify entities render in correct positions
  2. Inefficient Buffer Updates (render.zig:173-181):

    • Buffer is re-uploaded when color changes, which happens per-entity
    • Consider instanced rendering with per-instance colors for better performance

Suggested Improvements

High Priority:

  1. Verify toCameraRelative() logic - test floating origin behavior at large distances
  2. Consider instanced rendering to avoid 288 draw calls per frame for many entities

Medium Priority:
3. Store RHI by pointer/handle for consistency with other systems
4. Add entity query API to Registry for cleaner system iteration

Low Priority:
5. Move wireframe cube geometry to shared utility (mentioned in comment at render.zig:12-13)
6. Add serialization support for entity state

New%20session%20-%202026-01-17T03%3A55%3A50.666Z
opencode session  |  github run

@MichaelFisher1997 MichaelFisher1997 force-pushed the feature/ecs-implementation branch from cc2174d to ee853c3 Compare January 17, 2026 04:01
@opencode-agent
Copy link
Contributor

Code Review Summary

Previous Issues Status

✅ FIXED:

  1. Integer overflow check - manager.zig:37-40 has proper @panic on max entity ID
  2. Test entity code - session.zig:328-342 is active and uncommented
  3. Memory safety - storage.zig:64-86 uses proper swap-remove pattern
  4. Color not used - render.zig:130-132 now applies mesh.color to vertices
  5. Crash fix in rhi_vulkan.zig - ArrayListUnmanaged cleanup (+9/-15)
  6. Duplicate code block - Removed from render.zig

❌ NOT FIXED:

  1. World positioning - render.zig:123 still uses toCameraRelative() which subtracts camera_pos
  2. RHI by value - render.zig:74 stores rhi: RHI by value (inconsistent with patterns)

Code Quality Issues

  1. Camera-Relative Rendering (render.zig:123):

    const rel_pos = toCameraRelative(transform.position.add(offset), camera_pos);

    If the RHI's view matrix already handles camera transformation, this may cause incorrect world-space positioning.

  2. RHI Storage Pattern (render.zig:74):

    rhi: RHI,

    Stores RHI by value. Other systems may use handles for consistency.

  3. Unused camera_pos Parameter (render.zig:100):
    The camera_pos parameter is passed but used only for the toCameraRelative calculation.

Potential Bugs

  1. Buffer Update Inefficiency (render.zig:128-136):

    • Buffer is re-uploaded when color changes
    • Each entity causes a separate draw call with 24 vertices
    • Consider instanced rendering for better performance with many entities
  2. Color Comparison (render.zig:62-64):

    fn colorEquals(a: Vec3, b: Vec3) bool {
        return a.x == b.x and a.y == b.y and a.z == b.z;
    }

    Using exact float equality may be unreliable. Consider using an epsilon tolerance.

Suggested Improvements

High Priority:

  1. Verify toCameraRelative() logic - test floating origin behavior at large distances
  2. Add epsilon tolerance to colorEquals for reliable float comparison

Medium Priority:
3. Store RHI by pointer/handle for consistency with other systems
4. Consider instanced rendering to reduce draw calls
5. Add entity query API to Registry for cleaner system iteration

Low Priority:
6. Move wireframe cube geometry to shared utility (mentioned in comment at render.zig:2)
7. Add serialization support for entity state
8. Consider archetypes for cache efficiency if entity count grows large

New%20session%20-%202026-01-17T04%3A02%3A14.151Z
opencode session  |  github run

@MichaelFisher1997 MichaelFisher1997 force-pushed the feature/ecs-implementation branch from ee853c3 to db82038 Compare January 17, 2026 04:03
@opencode-agent
Copy link
Contributor

Code Review Summary

Previous Issues Status

✅ FIXED:

  1. Integer overflow check - manager.zig:38-40 has proper @panic on max entity ID
  2. Test entity code - session.zig:328-342 is active and uncommented
  3. Memory safety - storage.zig:64-86 uses proper swap-remove pattern without catch unreachable
  4. Color not used - render.zig:131-132 now applies mesh.color to vertices
  5. Crash fix in rhi_vulkan.zig - ArrayListUnmanaged cleanup confirmed (+9/-15)
  6. Duplicate code block - Removed from render.zig
  7. Vertex count - Now draws outline_vertex_count (24 vertices) instead of 288

❌ NOT FIXED:

  1. RHI by value - render.zig:75 stores rhi: RHI by value instead of *const RHI
  2. Camera-relative positioning - render.zig:124 still uses toCameraRelative() which may be intentional for floating origin but needs verification

Code Quality Issues

  1. RHI Storage Pattern (render.zig:75):

    rhi: RHI,

    Stores RHI by value. Other systems in the codebase typically store trait objects by pointer. Should be rhi: *const RHI.

  2. Camera-Relative Rendering (render.zig:124):

    const rel_pos = toCameraRelative(transform.position.add(offset), camera_pos);

    The comment indicates this is for floating origin with getViewMatrixOriginCentered(). This should be tested by moving far from origin (0,0,0) to verify correctness.

Potential Bugs

  1. Float Comparison (render.zig:62-64):

    fn colorEquals(a: Vec3, b: Vec3) bool {
        const epsilon: f32 = 0.0001;
        return @abs(a.x - b.x) <= epsilon and @abs(a.y - b.y) <= epsilon and @abs(a.z - b.z) <= epsilon;
    }

    Uses epsilon tolerance - good improvement over exact equality.

  2. Buffer Update Efficiency (render.zig:129-137):
    Buffer re-uploads when color changes. For many entities, consider instanced rendering with per-instance colors.

Suggested Improvements

High Priority:

  1. Change rhi: RHI to rhi: *const RHI at render.zig:75 for consistency
  2. Verify toCameraRelative() logic by testing at large distances from origin

Medium Priority:
3. Consider instanced rendering to reduce draw calls for many entities
4. Add entity query API to Registry for cleaner system iteration

Low Priority:
5. Move wireframe cube geometry to shared utility (mentioned in comment at render.zig:2)
6. Add serialization support for entity state
7. Consider archetypes for cache efficiency if entity count grows large

New%20session%20-%202026-01-17T04%3A05%3A02.743Z
opencode session  |  github run

@MichaelFisher1997 MichaelFisher1997 force-pushed the feature/ecs-implementation branch from db82038 to ecbcce6 Compare January 17, 2026 04:41
@opencode-agent
Copy link
Contributor

Now I have a complete picture of the current code state. Here's the code review summary:

Code Review Summary

Previous Issues - Status

✅ FIXED (7/9 issues):

  1. Integer overflow check - manager.zig:37-40 has proper @panic on max entity ID
  2. Test entity code - session.zig:328-342 is active and uncommented
  3. Memory safety - storage.zig:64-86 uses proper swap-remove pattern
  4. Color not used - render.zig:131-132 now applies mesh.color to vertices
  5. Crash fix in rhi_vulkan.zig - ArrayListUnmanaged properly initialized to .empty (lines 5466-5467)
  6. Duplicate code block - Removed from render.zig
  7. Vertex count - Now draws outline_vertex_count (24 vertices) instead of 288 at render.zig:142

❌ NOT FIXED (2/9 issues):

  1. Camera-relative positioning - render.zig:124 still uses toCameraRelative() - appears intentional for floating origin system
  2. RHI by value - Already fixed! render.zig:75 shows rhi: *RHI (by pointer, not value)

Code Quality Issues

  1. Floating Origin Logic (render.zig:124):

    • toCameraRelative() subtracts camera_pos from entity positions
    • Comment indicates this is for getViewMatrixOriginCentered()
    • Should be tested by moving far from origin (0,0,0) to verify correctness
  2. Buffer Update Pattern (render.zig:129-137):

    • Buffer re-uploads when color changes
    • Each entity causes separate draw call
    • Consider instanced rendering for many entities
  3. Unused EntityManager (entity.zig:1-6):

    • File only contains EntityId type
    • manager.zig handles registry logic

Potential Bugs

  1. Float Comparison (render.zig:62-64):

    • Uses epsilon tolerance (0.0001) - good practice ✓
  2. Missing Component Validation in RenderSystem:

    • render.zig:108 correctly checks if (registry.transforms.getPtr(entity_id)) before accessing ✓

Suggested Improvements

High Priority:

  1. Test toCameraRelative() logic at large distances from origin to verify floating origin behavior
  2. Consider instanced rendering to reduce draw calls when entity count grows

Medium Priority:
3. Add entity query API to Registry for cleaner system iteration
4. Move wireframe cube geometry to shared utility (mentioned in comment at render.zig:2-3)

Low Priority:
5. Add serialization support for entity state
6. Consider archetypes for cache efficiency if entity count grows large
7. Add AI system implementation (component exists but no system)

New%20session%20-%202026-01-17T04%3A42%3A06.555Z
opencode session  |  github run

@MichaelFisher1997 MichaelFisher1997 force-pushed the feature/ecs-implementation branch from ecbcce6 to 1ec2f4a Compare January 17, 2026 04:51
@opencode-agent
Copy link
Contributor

Code Review Summary

Previous Issues - Status

✅ FIXED (8/9):

  1. Integer overflow check - manager.zig:38-40 properly panics on max entity ID
  2. Test entity code - session.zig:328-342 is active and uncommented
  3. Memory safety - storage.zig:64-86 uses proper swap-remove pattern
  4. Color not used - render.zig:125-127 now applies mesh.color to vertices
  5. Crash fix in rhi_vulkan.zig - ArrayListUnmanaged properly initialized
  6. Duplicate code block - Removed from render.zig
  7. Vertex count - Now draws outline_vertex_count (24 vertices) at render.zig:136
  8. RHI by value - render.zig:69 stores rhi: *RHI by pointer

❌ NOT FIXED (1/9):

  1. Camera-relative positioning - render.zig:118 still uses toCameraRelative() which subtracts camera_pos - appears intentional for floating origin system

Code Quality Issues

  1. Buffer Upload on Every Color Change (render.zig:123-131):

    • Buffer re-uploads when entity color changes
    • Each unique color causes a full buffer upload
    • Consider caching colored vertices per entity or using uniforms
  2. Unused AI Component:

    • components.zig defines AI component
    • No AISystem exists to use it
    • Either implement AI system or remove unused component
  3. Vertex Color Initialization (outline_vertices:27-57):

    • Vertices initialized with white color (1,1,1)
    • Immediately overwritten in render loop
    • Wasteful initialization - could use zero/placeholder values

Potential Bugs

  1. Entity with Mesh but No Transform (render.zig:102):

    • If entity has Mesh but no Transform, it's silently skipped
    • No logging or warning for incomplete entities
    • Could mask bugs where components aren't properly attached
  2. Float Comparison Edge Case (render.zig:62-65):

    • Uses epsilon 0.0001 for color comparison
    • May not catch very similar but different colors
    • Acceptable for visual debugging but worth noting

Suggested Improvements

High Priority:

  1. Implement AISystem or remove unused AI component from components.zig
  2. Add logging when entities are skipped due to missing components
  3. Test camera-relative rendering at large distances (>1000 units) to verify floating origin behavior

Medium Priority:
4. Consider caching colored vertex arrays per entity instead of buffer uploads
5. Move wireframe cube geometry to shared utility (mentioned in render.zig:2-3 comment)
6. Add entity query API to Registry for cleaner system iteration:

pub fn query(self: *Registry, comptime Components: type) QueryIterator(Components) { ... }

Low Priority:
7. Initialize vertices with zero/placeholder colors instead of white
8. Add serialization support for entity state
9. Consider archetypes for cache efficiency if entity count grows large

New%20session%20-%202026-01-17T04%3A52%3A25.135Z
opencode session  |  github run

@MichaelFisher1997
Copy link
Collaborator Author

Camera-relative ECS rendering is intentional for floating origin. The renderer uses getViewMatrixOriginCentered() and world_renderer.zig subtracts camera position as well, so ECS must do the same to stay in the same coordinate frame and avoid large-world precision jitter. We'll keep this behavior.

@MichaelFisher1997 MichaelFisher1997 force-pushed the feature/ecs-implementation branch from 1ec2f4a to ddbbb64 Compare January 17, 2026 05:02
@opencode-agent
Copy link
Contributor

Based on my review of the current code, here's the status of previous code review issues:

Previous Issues Status

✅ FIXED (8/9):

  1. Integer overflow check - manager.zig:35-37 has proper @panic on max entity ID
  2. Test entity code - session.zig:328-342 is active and uncommented
  3. Memory safety - storage.zig:64-86 uses proper swap-remove pattern
  4. Color not used - render.zig:124-131 now applies mesh.color with epsilon comparison
  5. Crash fix in rhi_vulkan.zig - rhi_vulkan.zig:5466-5467 initializes ArrayListUnmanaged to .empty
  6. Duplicate code block - Removed from render.zig
  7. Vertex count - Now draws outline_vertex_count (24 vertices) at render.zig:137
  8. RHI by value - render.zig:69 stores rhi: *RHI by pointer

✅ INTENTIONAL (not a bug):

  1. Camera-relative positioning - render.zig:119 uses toCameraRelative() - confirmed intentional by author for floating origin system (session.zig:428-429 ECS updates are correctly outside skip_world guard)

Code Quality Issues

  1. Unused AI Component - components.zig:28 defines AI component but no AISystem exists to use it

  2. Vertex Color Initialization Waste - render.zig:27-57 initializes all vertices with black color (0,0,0) then immediately overwrites in render loop

  3. Single Color Buffer - The system re-uploads entire buffer when any entity's color changes (render.zig:124-131) - inefficient for many entities

Potential Bugs

  1. No Component Validation Logging - When entities are skipped due to missing Transform, there's no logging/warning (render.zig:102)

  2. Entity with Mesh but No Transform - Silently skipped without any indication, could mask configuration errors

Suggested Improvements

High Priority:

  1. Implement AISystem or remove unused AI component from components.zig
  2. Initialize wireframe vertices with zero color instead of black to avoid redundant writes
  3. Add logging when entities are skipped due to missing components

Medium Priority:
4. Consider caching per-entity colored vertex arrays instead of single buffer re-uploads
5. Move wireframe cube geometry to shared utility (mentioned in render.zig:2-3 comment)
6. Add entity query API to Registry for cleaner system iteration

Low Priority:
7. Add serialization support for entity state
8. Consider archetypes for cache efficiency if entity count grows large

New%20session%20-%202026-01-17T05%3A03%3A56.209Z
opencode session  |  github run

@MichaelFisher1997 MichaelFisher1997 force-pushed the feature/ecs-implementation branch from ddbbb64 to 767ed2f Compare January 17, 2026 05:09
@opencode-agent
Copy link
Contributor

Code Review Status - ECS Implementation

✅ PREVIOUS ISSUES - ALL FIXED:

  1. Integer overflow check - manager.zig:35-37 properly panics on max entity ID
  2. Test entity code - session.zig:328-342 is active and uncommented
  3. Memory safety - storage.zig:64-86 uses proper swap-remove pattern
  4. Color not used - render.zig:134-141 now applies mesh.color with epsilon comparison
  5. Crash fix in rhi_vulkan.zig - ArrayListUnmanaged properly initialized (line 193-194)
  6. Duplicate code block - Removed from render.zig
  7. Vertex count - Now draws outline_vertex_count (24 vertices) at render.zig:147
  8. RHI by value - render.zig:69 stores rhi: *RHI by pointer ✓
  9. Component validation logging - render.zig:107-111 logs missing Transform ✓
  10. Unused AI component - REMOVED from components.zig (only has Transform, Physics, Mesh) ✓

CODE QUALITY ISSUES:

  1. Vertex Color Initialization Waste (render.zig:27-57):

    • Vertices initialized with black {0,0,0} then immediately overwritten in render loop
    • Minor inefficiency but acceptable for debugging wireframes
  2. Single Color Buffer Re-upload (render.zig:134-141):

    • Buffer re-uploads when any entity's color changes
    • Inefficient for many entities with different colors
    • Acceptable for current test entity count
  3. Missing Entity Query API:

    • Registry lacks query/iteration methods
    • Systems must manually iterate over all entities and check for component existence

POTENTIAL BUGS:

  1. No obvious bugs detected - All major issues from previous reviews have been addressed

  2. Component Validation Consistency:

    • RenderSystem checks for Transform with logging (render.zig:106-112)
    • PhysicsSystem likely has similar checks
  3. ECS Update Placement (session.zig:428-430):

    • ECS updates correctly OUTSIDE skip_world guard ✓

SUGGESTED IMPROVEMENTS:

High Priority:

  1. Add entity query API to Registry for cleaner system iteration:
    pub fn query(self: *Registry, comptime Components: type) QueryIterator(Components) { ... }

Medium Priority:
2. Move wireframe cube geometry to shared utility (mentioned in render.zig:2 comment)
3. Add serialization support for entity state

Low Priority:
4. Consider archetypes for cache efficiency if entity count grows large
5. Implement instanced rendering for many entities to reduce draw calls


SUMMARY:

All 10 previously reported issues have been FIXED. The ECS implementation is now in good shape with:

  • Proper memory safety (swap-remove pattern)
  • Working color application with epsilon comparison
  • Correct vertex counts (24 instead of 288)
  • Proper RHI pointer storage
  • Component validation logging
  • Removed unused AI component
  • Active test entity code
  • Intentional camera-relative positioning for floating origin

The main remaining improvements are architectural: adding query API and potential performance optimizations for large entity counts.

New%20session%20-%202026-01-17T05%3A10%3A03.683Z
opencode session  |  github run

…ty, cleanup RHI ArrayList crash and unused code

- Rendering: Subtract camera position from entity position as view matrix is origin-centered.
- ECS: Removed unused EntityManager in entity.zig.
- Storage: Fixed potential crash in map update during removal.
- Session: Uncommented test entity spawning.
- RHI: Fixed crash due to double-free of uninitialized ArrayListUnmanaged in buffer_deletion_queue.
@MichaelFisher1997 MichaelFisher1997 force-pushed the feature/ecs-implementation branch from 767ed2f to c623007 Compare January 17, 2026 05:20
@opencode-agent
Copy link
Contributor

Code Review Summary

Previous Issues Status

✅ ALL 10 PREVIOUS ISSUES FIXED:

  1. Integer overflow check - manager.zig:35-37 properly panics on max entity ID
  2. Test entity code - session.zig:328-342 is active and uncommented
  3. Memory safety - storage.zig:64-86 uses proper swap-remove pattern without catch unreachable
  4. Color not used - render.zig:89-97 applies mesh.color with epsilon comparison
  5. Crash fix in rhi_vulkan.zig - rhi_vulkan.zig:5466-5467 initializes ArrayListUnmanaged to .empty
  6. Duplicate code block - Removed from render.zig
  7. Vertex count - Now draws outline_vertex_count (24 vertices) at render.zig:102
  8. RHI by value - render.zig:24 stores rhi: *RHI by pointer ✓
  9. Component validation logging - render.zig:61-67 logs missing Transform ✓
  10. Unused AI component - Removed from components.zig (only has Transform, Physics, Mesh) ✓

Code Quality Issues

  1. Single Color Buffer Re-upload (render.zig:89-97):

    • Buffer re-uploads when any entity's color changes
    • Inefficient for many entities with different colors
    • Acceptable for current test entity count
  2. Missing Entity Query API:

    • Registry lacks query/iteration methods
    • Systems must manually iterate and check component existence
  3. Missing Entity Serialization:

    • No support for saving/loading entity state
    • Important for game save/load functionality

Potential Bugs

No bugs detected - All previously reported issues have been properly addressed.

Suggested Improvements

High Priority:

  1. Add entity query API to Registry for cleaner system iteration:
    pub fn query(self: *Registry, comptime Components: type) QueryIterator(Components) { ... }

Medium Priority:
2. Add serialization support for entity state (required for game saves)
3. Consider instanced rendering for many entities to reduce draw calls

Low Priority:
4. Move wireframe cube geometry to shared utility (mentioned in render.zig:1 comment)
5. Consider archetypes for cache efficiency if entity count grows large

Summary

The ECS implementation is now in good shape. All previously reported issues have been fixed. The remaining improvements are architectural enhancements rather than bug fixes. The implementation correctly handles memory safety, component validation with logging, and proper rendering with camera-relative positioning for the floating origin system.

New%20session%20-%202026-01-17T05%3A21%3A27.999Z
opencode session  |  github run

- Implemented generic type-safe Query API in Registry.
- Added Snapshot and JSON serialization/deserialization for entities and components.
- Refactored PhysicsSystem and RenderSystem to use Query API.
- Added validation logging for entities with missing components.
- Added comprehensive unit tests in src/ecs_tests.zig.
@opencode-agent
Copy link
Contributor

Code Review Status

All 10 previously reported issues are FIXED:

Issue Status
Integer overflow check ✅ Fixed in manager.zig:35-37
Test entity code active ✅ Fixed in session.zig:328-342
Memory safety (swap-remove) ✅ Fixed in storage.zig:64-86
Mesh.color not used ✅ Fixed in render.zig:89-97
rhi_vulkan.zig ArrayListUnmanaged ✅ Fixed in rhi_vulkan.zig:5466-5467
Duplicate code block ✅ Removed from render.zig
Vertex count (288→24) ✅ Fixed in render.zig:102
RHI by value ✅ Fixed (now *RHI in render.zig:24)
Component validation logging ✅ Added in render.zig:61-67
Unused AI component ✅ Removed from components.zig

Code Quality Issues

  1. Single Color Buffer Re-upload (render.zig:89-97): Buffer re-uploads when any entity's color changes - inefficient for many entities with different colors
  2. Missing Entity Query API: Registry lacks query/iteration methods - systems manually iterate and check components
  3. Missing Serialization: No support for saving/loading entity state

Potential Bugs

None detected - all previously reported issues properly addressed.

Suggested Improvements

High Priority:

  • Add entity query API to Registry for cleaner system iteration

Medium Priority:

  • Add serialization support for entity state (game save/load)
  • Consider instanced rendering for many entities

Low Priority:

  • Move wireframe cube geometry to shared utility (mentioned in render.zig:1)
  • Consider archetypes for cache efficiency

New%20session%20-%202026-01-17T05%3A37%3A34.928Z
opencode session  |  github run

…y API

- Updated RHI setModelMatrix to support per-object color override via push constants.
- Updated terrain.vert shader to apply color_override to vertex colors.
- Refactored RenderSystem to use the new color uniform, eliminating vertex buffer re-uploads for color changes.
- Implemented generic type-safe Query API in Registry for efficient component iteration.
- Implemented ECS state serialization (Snapshot/JSON) for game save/load support.
- Centralized wireframe cube geometry and switched to 24-vertex line list.
- Added comprehensive unit tests for ECS core, Query API, and Serialization.
@opencode-agent
Copy link
Contributor

Code Review Status

All 10 previously reported issues are FIXED:

Issue Status Location
Integer overflow check manager.zig:35-37
Test entity code active session.zig:328-342
Memory safety (swap-remove) storage.zig:64-86
Mesh.color not used render.zig:89-97
rhi_vulkan.zig ArrayListUnmanaged rhi_vulkan.zig:5466-5467
Duplicate code block Removed
Vertex count (288→24) render.zig:102
RHI by value Now *RHI in render.zig:24
Component validation logging render.zig:61-67
Unused AI component Removed

Code Quality Issues:

  1. Single color buffer re-upload inefficiency (render.zig:89-97)
  2. Missing entity query API in Registry
  3. Missing serialization support for entity state

Potential Bugs: None detected.

Suggested Improvements:

  1. Add entity query API to Registry for cleaner system iteration
  2. Add serialization support for game save/load
  3. Consider instanced rendering for many entities

New%20session%20-%202026-01-17T05%3A44%3A22.573Z
opencode session  |  github run

@MichaelFisher1997 MichaelFisher1997 changed the title Feature: Entity Component System (ECS) Feature: Entity Component System (ECS) with Query API & Serialization Jan 17, 2026
@MichaelFisher1997 MichaelFisher1997 merged commit af8f45b into main Jan 17, 2026
6 checks passed
@MichaelFisher1997 MichaelFisher1997 deleted the feature/ecs-implementation branch January 17, 2026 05:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation engine game shaders world

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant