Introduction
A game is only as strong as the server that powers it. Build it right, and the world will follow.
Welcome to Altruist — a high-performance, config-driven framework for building scalable game servers and real-time applications in C# / .NET 9. While this documentation mainly focuses on gaming features, Altruist is a general-purpose high-performance application server framework — with built-in dependency injection, REST APIs, WebSocket/TCP/UDP transports, authentication, database persistence, and config-driven service discovery. Think Spring for C#, with an optional game simulation engine on top.
Looking for the best game server framework?:
We surveyed every major game server framework available today — 21 projects across C++, Rust, Go, Node.js, Java, and C#, including Photon, Nakama, Colyseus, SpacetimeDB, and more. Not a single one ships built-in AI, combat, collision detection, and visibility tracking as a reusable framework. Altruist is the first. See the full comparison with benchmarks.
How It Works
Altruist is convention-over-configuration. You define your server in a config.yml file, annotate your classes with attributes like [Service], [Portal], and [Gate], and the framework handles the rest — dependency injection, transport setup, packet routing, and lifecycle management.
// That's your entire Program.cs
using Altruist;
await AltruistApplication.Run(args);
Everything else is configured through YAML and discovered automatically via attributes.
Key Features
| Feature | Description |
|---|---|
| Config-Driven | Define your server, transport, database, and engine in config.yml |
| Attribute-Based DI | [Service] auto-registers services; [ConditionalOnConfig] for conditional wiring |
| Portal System | [Portal] + [Gate] attributes for real-time packet handling |
| Multi-Transport | WebSocket, TCP, and UDP — switch via a single config line |
| Codec Flexibility | JSON or MessagePack serialization, configurable per server |
| Built-in Router | Send to clients, rooms, or broadcast to all with IAltruistRouter |
| Game Engine | Frame-based game loop with [Cycle] attribute for scheduled tasks |
| Shield Auth | [Shield] attribute for securing portals and HTTP endpoints |
| Persistence | Vault system with Postgres support, prefabs, database initializers |
| Entity Sync | Efficient delta-based entity synchronization across clients |
| Physics | Optional 3D physics with collision handling and character controllers |
| Visibility | Automatic view-range tracking — clients only receive nearby entity data |
| Zones | Spatial zone management with automatic activation/deactivation |
Technology Stack
- .NET 9 & C# — High-performance runtime for real-time applications
- YAML Configuration — Human-readable server configuration
- MessagePack — Fast binary serialization for network packets
- PostgreSQL — Production-ready database provider
- BEPU Physics — 3D physics engine integration (optional)
Open Source
Altruist is proudly open-source under the Apache License 2.0.
Contribute:
Interested in helping us improve? Check out our GitHub repository to get started! From feature suggestions to bug fixes, all contributions are welcome.