This document provides instructions for the Gemini AI agent to effectively assist with development tasks in the RACEngine repository.
RACEngine is a modular, educational game engine built with C# and .NET. It is designed with a strict Entity-Component-System (ECS) architecture at its core and prioritizes clear, well-documented code for learning purposes.
- Core Engine: C# / .NET
- Documentation: DocFX
- Build/Doc Scripts: Node.js
src/: Contains all the C# source code for the engine modules.tests/: Contains the unit and integration tests for the engine.docs/: Contains the markdown files used as source for the documentation..docfx/: Contains the configuration and generated site for DocFX.samples/: Contains sample projects demonstrating engine features.
The project is a standard .NET solution. To build the entire solution, use the dotnet CLI from the root directory:
dotnet build RACEngine.slnTests are written using a .NET testing framework and can be run from the root of the repository:
dotnet test RACEngine.slnThe documentation is generated using DocFX.
- To run a local server to preview the docs:
docfx .docfx/docfx.json --serve - To build the documentation site:
docfx build .docfx/docfx.json - Important: Before any pull request, ensure that any code changes are reflected in the documentation in the
docs/directory. Incomplete documentation is treated like a failing test.
Adherence to the existing architecture is critical.
- Educational Focus: Code should be commented to explain algorithms and concepts. Performance is secondary to clarity.
- ECS Architecture:
- Components: Must be
readonly record structimplementingIComponent. They are for data only. - Systems: Must be stateless classes that operate on
Worlddata. They contain the logic.
- Components: Must be
- Null Object Pattern: Required for optional subsystems (
NullRenderer,NullAudioService, etc.). - 4-Phase Rendering Pipeline: Rendering follows a strict
Configuration → Preprocessing → Processing → Post-processingflow. - Namespaces: Follow the
Rac.{ModuleName}pattern. - Style: Follow the C# style conventions in
docs/code-guides/code-style-guidelines.md.
Before making changes, consult these files for context:
- Overall Architecture:
docs/architecture/system-overview.md - Coding Standards:
docs/code-guides/code-style-guidelines.md - XML Comments Guide:
docs/code-guides/csharp_xml_comments_guide.md - ECS Patterns:
docs/architecture/ecs-architecture.md - Rendering Pipeline:
docs/architecture/rendering-pipeline.md - Module-Specific Info:
docs/projects/Rac.{ModuleName}.md