Skip to content

Roxeez/Orbita

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 Orbita

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


✨ Features

  • 🌌 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

🚀 Getting Started

Server

Prerequisites

  • .NET 8.0 SDK or newer

Run the server

cd Server
dotnet run

Client

Prerequisites

  • Unity 2022.3 LTS or compatible version

Run the client

  1. Open Game/ in Unity.
  2. Press Play to launch the client.
  3. By default, it connects to 127.0.0.1:7777.

You can build the client and launch two instances to test multiplayer.


⚙️ Configuration

  • Server port: 7777
  • Tick rate: 20 ticks/sec (configurable)
  • Send rate: 20 packets/sec from client
  • Interpolation delay: 100ms for remote smoothing

📦 Dependencies

Server

  • Microsoft.Extensions.DependencyInjection – DI framework
  • Serilog – logging
  • Custom TCP implementation (no third-party networking libs)

Client

  • Unity 2D URP
  • VContainer – DI for Unity
  • TextMeshPro – for nameplates

📈 Profiling & Monitoring

The server includes a built-in profiler to track:

  • Average and highest tick rate
  • Packets sent/received per second
  • Exposed via an API

💡 Future Ideas

  • NPC movement & combat
  • Spatial partitioning (quadtree or per-sector maps)
  • Bullet/projectile system with hit validation
  • Chat, inventory, skills
  • Server-authoritative physics or collisions

📜 License

MIT License — free to use, modify, and share.


👨‍💻 Author

Made by @Roxeez

About

Multiplayer 2D space MMO, built with Unity and C#

Topics

Resources

Stars

Watchers

Forks