Orbita is a multiplayer 2D space MMO, powered by a Unity client and a custom C# server.
It features smooth real-time movement and rotation with client-side interpolation, efficient TCP networking, and a clean, modular architecture via shared protocol and dependency injection.
This project is made for learning purpose and is far from finished
- 🌌 Unity-based 2D space environment with player and NPC ships
- 🛰️ Real-time movement with buffered interpolation and smooth rotation
- 📡 Custom C# TCP server using lightweight protocol/message system (binary/text hybrid)
- 🔁 Shared protocol library between client and server for consistent communication
- ⚔️ Combat system with:
- "In combat" state detection
- Damage sync and feedback
- Targeting logic and combat-aware UI updates
- 🎯 Display system:
- Health/shield bars based on combat state or targeting
- Always-on minimal self-health UI
- Target indicators and nameplates
- Smooth screen-space following using a world-space → UI bridge
- 🔄 Client-side Event Bus for clean decoupling of gameplay/UI logic
- 🧩 Dependency injection via VContainer for modular game systems
- ⏱️ Server tickrate control with stopwatch-based precision timing and profiler support
- 🗺️ Dynamic map loading from YAML configuration
- 🚪 Seamless map transitions, with optional black screen fade
- 🧠 Entity Component System architecture (movement, life, combat, targeting, display, etc.)
- 📦 Efficient packet handling — sends only changed state to reduce bandwidth
- 🧪 Built-in debug hooks and tools for smooth gameplay iteration
Prerequisites
- .NET 8.0 SDK or newer
Run the server
cd Server
dotnet runPrerequisites
- Unity 2022.3 LTS or compatible version
Run the client
- Open
Game/in Unity. - Press Play to launch the client.
- By default, it connects to
127.0.0.1:7777.
You can build the client and launch two instances to test multiplayer.
- Server port:
7777 - Tick rate: 20 ticks/sec (configurable)
- Send rate: 20 packets/sec from client
- Interpolation delay: 100ms for remote smoothing
Microsoft.Extensions.DependencyInjection– DI frameworkSerilog– logging- Custom TCP implementation (no third-party networking libs)
- Unity 2D URP
- VContainer – DI for Unity
- TextMeshPro – for nameplates
The server includes a built-in profiler to track:
- Average and highest tick rate
- Packets sent/received per second
- Exposed via an API
- NPC movement & combat
- Spatial partitioning (quadtree or per-sector maps)
- Bullet/projectile system with hit validation
- Chat, inventory, skills
- Server-authoritative physics or collisions
MIT License — free to use, modify, and share.
Made by @Roxeez