Brine2D Game Engine¶
What's New in v0.9.0-beta
Package separation, track-based audio, performance monitoring, GPU renderer improvements, and .NET 10 support!
Modern 2D game development with .NET elegance¶
Brine2D is a modern .NET 10 engine built on SDL3, inspired by the architecture and developer experience of ASP.NET. If you've built ASP.NET Core applications, the development model will feel immediately familiar.
-
Get Started in Minutes
Familiar patterns mean minimal learning curve for .NET developers
-
Learn the Basics
Comprehensive guides covering every aspect of Brine2D
-
API Reference
Complete API documentation for all Brine2D packages
-
View on GitHub
Open source and MIT licensed
Why Brine2D?¶
Convention Over Configuration¶
Just like ASP.NET, Brine2D provides sensible defaults that just work. Focus on building your game, not fighting with configuration.
First-Class Dependency Injection¶
Built on Microsoft's DI container, Brine2D makes testable, maintainable code the defaultβnot the exception.
using Brine2D.Core;
using Brine2D.Input;
using Brine2D.Rendering;
using Microsoft.Extensions.Logging;
public class GameScene : Scene
{
// Constructor injection - just like ASP.NET controllers
public GameScene(IRenderer renderer, IInputService input, ILogger<GameScene> logger) : base(logger)
{
// Dependencies automatically injected!
}
}
Familiar Developer Experience¶
| ASP.NET Core | Brine2D | What It Means |
|---|---|---|
WebApplicationBuilder |
GameApplicationBuilder |
Configure your game with the same patterns |
| Controllers | Scenes | Organize game logic into manageable units |
| Middleware Pipeline | System Pipelines | Automatic execution via lifecycle hooks |
appsettings.json |
gamesettings.json |
JSON configuration with hot reload |
ILogger<T> |
ILogger<T> |
Structured logging everywhere |
| Entity Framework | Scene Management | Transitions, loading screens |
Production-Ready Architecture¶
- Modular by design - Mix and match only what you need
- Clean separation of concerns - Abstractions over implementations
- Testable - Mock any service, test any component
- Cross-platform - Windows, macOS, Linux support via SDL3
See It In Action¶
Here's a complete game in ~30 lines of code:
using Brine2D.Core;
using Brine2D.Engine;
using Brine2D.Hosting;
using Brine2D.Input;
using Brine2D.Rendering;
using Brine2D.SDL;
using Microsoft.Extensions.Logging;
// Create builder (like ASP.NET's WebApplication.CreateBuilder)
var builder = GameApplication.CreateBuilder(args);
// Add Brine2D with sensible defaults (SDL3 backend, GPU rendering, input, audio)
builder.Services.AddBrine2D(options =>
{
options.WindowTitle = "My Game";
options.WindowWidth = 1280;
options.WindowHeight = 720;
});
builder.Services.AddScene<GameScene>();
// Build and run
var game = builder.Build();
await game.RunAsync<GameScene>();
// Define your scene (like an ASP.NET controller)
public class GameScene : Scene
{
private readonly IInputService _input;
private readonly IRenderer _renderer;
private readonly IGameContext _gameContext;
public GameScene
(
IRenderer renderer,
IInputService input,
IGameContext gameContext,
ILogger<GameScene> logger
) : base(logger)
{
_renderer = renderer;
_input = input;
_gameContext = gameContext;
}
protected override void OnRender(GameTime gameTime)
{
// Frame management happens automatically!
_renderer.DrawText("Hello, Brine2D!", 100, 100, Color.White);
}
protected override void OnUpdate(GameTime gameTime)
{
if (_input.IsKeyPressed(Keys.Escape))
{
_gameContext.RequestExit();
}
}
}
That's it! A complete game window with input handling and rendering.
Core Features¶
Modern GPU Rendering¶
- Hardware-accelerated via SDL3 GPU (Vulkan/Metal/D3D12)
- Texture atlasing with runtime sprite packing
- Sprite sheets and animations
- Camera system with zoom and rotation
- Line drawing with configurable thickness
Hybrid Entity Component System¶
- Components are classes that can contain logic
- Optional systems for performance optimization
- Composition over inheritance for flexible entities
- ASP.NET-style system pipelines with automatic execution
Advanced Query System¶
- Fluent API for complex entity searches
- Cached queries for zero-allocation performance
- Spatial queries (within radius/bounds)
- Multiple filter conditions
Scene Transitions¶
- Smooth fade transitions between scenes
- Custom loading screens with progress bars
- Async scene loading
- Scene chaining support
Flexible Input System¶
- Keyboard, mouse, and gamepad support
- Input layers (like middleware for input)
- Event-driven and polling APIs
2D Spatial Audio System¶
- Distance-based volume attenuation
- Stereo panning based on position
- Configurable falloff curves (linear, quadratic, custom)
- ECS integration with audio sources and listeners
Advanced Particle System¶
- Object pooling for zero-allocation performance
- Particle textures with custom sprites
- Rotation, trails, and blend modes
- 7 emitter shapes (point, circle, ring, box, cone, line, burst)
Collision Detection¶
- Box and circle colliders
- Spatial partitioning for performance
- Physics response (bounce, slide, push)
Tilemap Support¶
- Tiled (.tmj) file format
- Automatic collision generation
- Layer rendering
Complete UI Framework¶
- 15+ production-ready components
- Buttons, sliders, text inputs, dialogs, tabs
- Scroll views, tooltips, dropdowns
- Input layer management
Project Structure¶
Brine2D follows a clean, modular architecture:
Brine2D/
βββ Brine2D.Core # Core abstractions (IScene, ITexture, etc.)
βββ Brine2D.Engine # Game loop, scene management, transitions
βββ Brine2D.Hosting # ASP.NET-style hosting model
βββ Brine2D.ECS # Entity Component System
βββ Brine2D.Rendering # Rendering abstractions
βββ Brine2D.Rendering.SDL # SDL3 rendering implementation
βββ Brine2D.Rendering.ECS # ECS rendering systems
βββ Brine2D.Input # Input abstractions
βββ Brine2D.Input.SDL # SDL3 input implementation
βββ Brine2D.Input.ECS # ECS input systems
βββ Brine2D.Audio # Audio abstractions
βββ Brine2D.Audio.SDL # SDL3 audio implementation
βββ Brine2D.Audio.ECS # ECS audio systems
βββ Brine2D.UI # Complete UI framework
Each package is focused, testable, and can be swapped with custom implementations.
What's New in 0.9.0-beta¶
Brine2D 0.9.0-beta is a major architectural release with significant improvements:
- Package Separation - Cleaner architecture with Brine2D + Brine2D.SDL packages
- Track-Based Audio - New track-based API replaces channel-based system for precise control
- Performance Monitoring - Built-in overlay with FPS, frame time, memory stats, and batch efficiency
- GPU Renderer - Now the default with automatic batching and improved performance
- Post-Processing - Render-to-texture pipeline with screen shake, vignette, and custom shaders
- ECS Multi-Threading - Parallel entity processing with thread-safe collections
- .NET 10 Support - Built on the latest .NET with modern language features
- 8+ Performance Improvements - 30% faster queries, 50% fewer allocations, 10x+ sprite batching
Who Is This For?¶
ASP.NET Developers¶
You already know the patterns. Now build games with them.
Game Developers¶
Build games on a modern, maintainable .NET architecture.
Students & Educators¶
Learn game development with familiar .NET patterns.
Enterprise Teams¶
Build internal tools and games with maintainable code.
Requirements¶
- .NET 10 SDK or later
- SDL3 (included via SDL3-CS NuGet)
- Windows, macOS, or Linux
Next Steps¶
-
5-Minute Quickstart
Create your first game in minutes
-
Tutorials
Step-by-step guides for common scenarios
-
Concepts
Deep dive into Brine2D's architecture
-
FeatureDemos
Interactive demos showcasing all major features
Community & Support¶
- GitHub: CrazyPickleStudios/Brine2D
- Issues: Report bugs or request features
- Discussions: Ask questions and share ideas
- License: MIT - Use it anywhere, even commercially
Ready to build games the ASP.NET way?