RACEngine is a modular, modern game engine built with .NET 8 and C#. It serves as a learning platform and a foundation for developing custom games without relying on existing game engines. The project emphasizes clarity, separation of concerns, and practical elegance.
Entity, IComponent, World, ISystem, and SystemScheduler.RACEngine/
βββ src/
β βββ Rac.ECS/ # Core ECS module
β βββ Rac.Rendering/ # 4-phase rendering pipeline
β βββ Rac.Engine/ # Engine orchestration and facade
β βββ Rac.AI/ # AI subsystem
β βββ Rac.Animation/ # Animation subsystem
β βββ Rac.Audio/ # Audio subsystem
β βββ Rac.Assets/ # Asset management
β βββ Rac.Core/ # Core utilities and extensions
βββ samples/
βββ SampleGame/ # Multiple game samples and demos
βββ TicTacToe/ # Simple turn-based game example
RACEngine features a sophisticated rendering architecture that separates concerns into four distinct phases, enabling better performance, tool development, and maintainability.
graph LR
A[Configuration] --> B[Preprocessing]
B --> C[Processing]
C --> D[Post-Processing]
var config = RenderConfiguration.Create(new Vector2D<int>(1920, 1080))
.WithPostProcessing(new PostProcessingConfiguration { EnableBloom = true })
.WithQuality(new QualityConfiguration { MsaaSamples = 4 })
.Build();
β
Separation of Concerns: Each phase has a single, clear responsibility
β
Enforced Ordering: Cannot render without completing preprocessing
β
Performance: Asset loading never blocks frame rendering
β
Tool Integration: Each phase can be controlled independently
β
Extensibility: New features fit clearly into appropriate phases
The engine automatically manages all four phases:
// Happens once during initialization
renderer.Initialize(window); // Phase 1: Configuration
renderer.InitializePreprocessing(); // Phase 2: Asset loading & validation
renderer.InitializeProcessing(); // Phase 3: GPU resource setup
renderer.InitializePostProcessing(); // Phase 4: Post-processing setup
// Happens every frame in the render loop
renderer.Clear(); // Phase 3: Begin frame
renderer.UpdateVertices(vertices); // Phase 3: Upload data
renderer.Draw(); // Phase 3: Render geometry
renderer.FinalizeFrame(); // Phase 4: Apply effects & present
For optimal performance and full audiovisual effects support:
Note: The engine will automatically detect your graphics and audio capabilities and gracefully fall back to basic rendering/no audio if requirements arenβt met. Update your graphics drivers or use a newer graphics card for full visual effects support. Audio will use the NullAudioService as fallback if OpenAL initialization fails.
Clone the repository:
git clone https://github.com/tomasforsman/RACEngine.git
cd RACEngine
Navigate to the sample game:
cd samples/SampleGame
Build and run the sample game:
dotnet run
The repository includes multiple sample applications demonstrating different aspects of RACEngine:
Navigate to the sample game directory and run with specific sample names:
cd samples/SampleGame
dotnet run -- boidsample # Default: Boid flocking simulation
dotnet run -- shootersample # Interactive shooter
dotnet run -- bloomtest # HDR bloom effects
dotnet run -- camerademo # Camera system demonstration
dotnet run -- pipelinedemo # 4-phase rendering pipeline demo
dotnet run -- containersample # Container system with inventory patterns
Each sample includes:
Comprehensive documentation is forthcoming. In the meantime, refer to the source code and the SampleGame project for insights into the engineβs usage and capabilities.
Contributions are welcome! If youβre interested in contributing:
Create a new branch:
git checkout -b feature/YourFeature
Commit your changes:
git commit -m 'Add YourFeature'
Push to the branch:
git push origin feature/YourFeature
Please ensure that your code adheres to the projectβs coding standards and includes appropriate tests.
For questions, suggestions, or feedback: