A cross-platform MuOnline client implementation built with .NET 10 and MonoGame framework.
Features โข Quick Start โข Building โข Architecture โข Contributing
โ ๏ธ Educational Purpose Disclaimer This project is created strictly for educational and research purposes to explore game client architecture, network protocols, and cross-platform development with .NET and MonoGame. This is a non-commercial, open-source learning project that demonstrates reverse engineering and game development concepts.
- ๐ Cross-Platform Support - Windows (OpenGL/DirectX), Linux, macOS, Android, and iOS
- ๐จ Full 3D Rendering - MonoGame-based graphics engine with dynamic lighting and effects
- ๐ฏ Dual Graphics Backends - Choose between OpenGL (compatibility) or DirectX 11 (performance)
- ๐ฆ Original Data Compatibility - Supports Season 20 (1.20.61) game data files
- ๐ Network Protocol - Season 6 (S6) protocol implementation
- ๐ฏ Multiplayer Ready - Full networking stack with packet handling system
- ๐ผ๏ธ Custom UI System - Resolution-independent UI with virtual coordinates
- ๐บ๏ธ Terrain Rendering - Heightmap-based terrain with walkability attributes
- ๐ Character Animation - BMD skeletal animation system
- ๐ก Real-Time Lighting - Dynamic lighting with shader support
- โก Performance Optimized - Multi-threaded packet processing with main thread scheduling
| Component | Version | Download Link |
|---|---|---|
| .NET SDK | 10.0+ | Download |
| Git | Latest | Download |
| MuOnline Data | Season 20 (1.20.61) | Download |
โ Windows
- Windows 10/11 (64-bit)
- Visual Studio 2022 (optional, for IDE support)
Graphics Backend Options:
- OpenGL (MuWinGL) - Better hardware compatibility, works on older GPUs
- DirectX 11 (MuWinDX) - Better performance on modern hardware, Windows-only
Recommended: Try DirectX first for best performance. Use OpenGL if you encounter graphics issues or have older hardware.
๐ง Linux
- Compatible with most x64 distributions
- Required packages:
libgdiplus,libopenal-dev
# Ubuntu/Debian
sudo apt-get install libgdiplus libopenal-dev
# Fedora
sudo dnf install libgdiplus openal-soft-devel๐ macOS
- macOS 11.0+ (Big Sur or later)
- Xcode Command Line Tools
xcode-select --install๐ฑ Android
- Android SDK (API Level 21+)
- Java Development Kit (JDK) 11 or later
๐ฑ iOS
- macOS with Xcode installed
- Valid Apple Developer account (for device deployment)
- iOS 10.0+ target
git clone https://github.com/xulek/muonline.git
cd muonlineThis client requires Season 20 (1.20.61) client data files for assets (models, textures, maps) but communicates using Season 6 protocol.
- Download: MU Red 1.20.61 Full Data
- Extract the archive to a location on your system
- Note the path to the
Datafolder
Open Client.Main/Constants.cs and update line 25:
// Windows
public static string DataPath = @"C:\Games\MU_Red_1_20_61_Full\Data";
// Linux/macOS
public static string DataPath = "/home/user/Games/MU_Red_1_20_61_Full/Data";Edit Client.Main/appsettings.json:
{
"MuOnlineSettings": {
"ConnectServerHost": "localhost",
"ConnectServerPort": 44405,
"ProtocolVersion": "Season6",
"ClientVersion": "1.04d",
"ClientSerial": "0123456789ABCDEF"
}
}This client is designed to work with OpenMU, an open-source MuOnline server implementation.
Quick Start with Docker:
# Download and run OpenMU server
curl -o docker-compose.yml https://raw.githubusercontent.com/MUnique/OpenMU/master/deploy/all-in-one/docker-compose.yml
docker-compose up -dThe server will be available at localhost:44405 (matches default client configuration).
Alternative: You can also connect to any Season 6 compatible MuOnline server.
# Restore .NET tools
dotnet tool restore
# Build the solution
dotnet build# Windows (DirectX 11 - Recommended)
dotnet run --project ./MuWinDX/MuWinDX.csproj -f net10.0-windows -c Debug -p:MonoGameFramework=MonoGame.Framework.WindowsDX
# Windows (OpenGL - For compatibility)
dotnet run --project ./MuWinGL/MuWinGL.csproj -f net10.0-windows -c Debug -p:MonoGameFramework=MonoGame.Framework.DesktopGL
# Linux
dotnet run --project ./MuLinux/MuLinux.csproj -f net10.0 -c Debug
# macOS
dotnet run --project ./MuMac/MuMac.csproj -f net10.0 -c Debugmuonline/
โโโ Client.Data/ # Data file readers (BMD, ATT, MAP, OZB, etc.)
โโโ Client.Main/ # Core game engine, networking, UI, game logic
โ โโโ Client.Main.Shared.props # shared settings
โ โโโ Client.Main.*.csproj # platform variants: desktop/windows/android/ios
โโโ Client.Data/ # data processing (platform variants)
โ โโโ Client.Data.Shared.props
โ โโโ Client.Data.*.csproj
โโโ Client.Editor/ # Asset editor tool
โโโ MuWinGL/ # Windows OpenGL executable (MonoGame.Framework.DesktopGL)
โโโ MuWinDX/ # Windows DirectX 11 executable (MonoGame.Framework.WindowsDX)
โโโ MuAndroid/ # Android executable project
โโโ MuIos/ # iOS executable project
โโโ MuLinux/ # Linux executable project
โโโ MuMac/ # macOS executable project
For predictable restores and to avoid missing workloads, build/clean one head at a time.
# Windows DirectX (Recommended)
dotnet clean MuWinDX/MuWinDX.csproj && dotnet build MuWinDX/MuWinDX.csproj -c Debug -p:MonoGameFramework=MonoGame.Framework.WindowsDX
# Windows OpenGL
dotnet clean MuWinGL/MuWinGL.csproj && dotnet build MuWinGL/MuWinGL.csproj -c Debug -p:MonoGameFramework=MonoGame.Framework.DesktopGL
# Linux
dotnet clean MuLinux/MuLinux.csproj && dotnet build MuLinux/MuLinux.csproj -c Debug
# macOS
dotnet clean MuMac/MuMac.csproj && dotnet build MuMac/MuMac.csproj -c Debug
# Android (requires Android workload)
dotnet workload restore
dotnet clean MuAndroid/MuAndroid.csproj && dotnet build MuAndroid/MuAndroid.csproj -c Debug
# iOS (requires macOS + Xcode + iOS workload)
dotnet workload restore
dotnet clean MuIos/MuIos.csproj && dotnet build MuIos/MuIos.csproj -c DebugBuild outputs are placed in bin/Release/ directories.
# DirectX 11 (Recommended for modern hardware)
dotnet publish ./MuWinDX/MuWinDX.csproj -c Release -r win-x64 -o publish-dx -p:MonoGameFramework=MonoGame.Framework.WindowsDX
# OpenGL (Better hardware compatibility)
dotnet publish ./MuWinGL/MuWinGL.csproj -c Release -r win-x64 -o publish-gl -p:MonoGameFramework=MonoGame.Framework.DesktopGLThe GitHub Actions workflow automatically builds both Windows versions (OpenGL and DirectX) on every push to main and publishes them to GitHub Pages.
dotnet publish ./MuLinux/MuLinux.csproj -f net10.0 -c Release -r linux-x64 --self-containeddotnet publish ./MuMac/MuMac.csproj -f net10.0 -c Releasedotnet publish ./MuAndroid/MuAndroid.csproj -f net10.0-android -c Release \
-p:AndroidSdkDirectory="<path-to-android-sdk>" \
-p:JavaSdkDirectory="<path-to-jdk-11>" \
-p:AcceptAndroidSdkLicenses=True# Requires macOS with Xcode and valid signing certificates
dotnet publish ./MuIos/MuIos.csproj -f net10.0-ios -c ReleaseThis project implements a layered architecture with clear separation of concerns:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Platform Layer โ
โ (MuWinGL/MuWinDX, MuLinux, MuMac, MuAndroid, MuIos) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Client.Main (Core) โ
โ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โ
โ โ Scenes โ โ Networking โ โ Rendering โ โ
โ โ (Login/Game) โ โ (S6 Proto) โ โ (MonoGame) โ โ
โ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โ
โ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โ
โ โ Game Objects โ โ UI System โ โ World System โ โ
โ โ(Player/NPC) โ โ (GameControl)โ โ (Terrain) โ โ
โ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Client.Data (Data Readers) โ
โ BMD โข ATT โข MAP โข OZB โข OZG โข CWS โข OBJS โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
- Pattern: Finite State Machine
- Implementation:
BaseScenebase class withLoginScene,LoadScene,GameScene - World Switching: Dynamic world loading via
ChangeWorldAsync<T>()
- Architecture: Service-Oriented with attribute-based routing
- Protocol: Season 6 (C1/C3 packet structure)
- Components:
PacketRouter- Dual-mode routing (ConnectServer/GameServer)[PacketHandler]- Attribute-based handler registration- Service Layer -
LoginService,CharacterService,ConnectServerService
- Thread Safety: Async packet processing with main thread scheduling
- Hierarchy:
WorldObjectโPlayerObject,MonsterObject,NPCObject,DroppedItemObject - Management:
ScopeManagerhandles object visibility and lifecycle - Animation: BMD skeletal animation system
- Pattern: Hierarchical component model
- Base Class:
GameControlwith lifecycle methods - Scaling: Virtual resolution (1280x720) with
UiScaler - Events: Click, Focus, Blur, SizeChanged
- Main Thread: MonoGame rendering and UI updates
- Network Thread: Async packet processing
- Marshalling:
MuGame.ScheduleOnMainThread(Action)for thread safety - Task Scheduler: Priority-based queue with backpressure control
| Format | Description | Usage |
|---|---|---|
| BMD | 3D models and skeletal animations | Characters, monsters, items, NPCs |
| ATT | Terrain walkability attributes | Collision detection, pathfinding |
| MAP | Terrain heightmap data | 3D terrain rendering |
| OZB/OZG | Compressed texture formats | Textures for models and UI |
| CWS | Camera walk/pan scripts | Cinematic camera movements |
| OBJS | Object placement data | Map decorations and static objects |
Debug vs Release builds have different configurations:
Debug Settings:
SHOW_DEBUG_PANEL: true- Shows FPS, position, network statsUNLIMITED_FPS: true- Disables VSync for testingDataPath- Absolute path to data files
Release Settings:
SHOW_DEBUG_PANEL: falseDataPath- Relative to executable location
Rendering Options:
RENDER_SCALE: 2.0- Supersampling multiplierENABLE_DYNAMIC_LIGHTING_SHADER: true- GPU-based lightingMSAA_ENABLED: false- Multi-sample anti-aliasing (performance impact)
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Client.Main.Networking": "Trace"
}
},
"MuOnlineSettings": {
"ConnectServerHost": "localhost",
"ConnectServerPort": 44405,
"ProtocolVersion": "Season6",
"ClientVersion": "1.04d",
"ClientSerial": "0123456789ABCDEF",
"Graphics": {
"Width": 1280,
"Height": 720,
"IsFullScreen": false,
"UiVirtualWidth": 1280,
"UiVirtualHeight": 720
}
}
}| Feature | OpenGL (MuWinGL) | DirectX 11 (MuWinDX) |
|---|---|---|
| Performance | Good | Excellent (modern GPUs) |
| Compatibility | Excellent (older hardware) | Windows 10/11 only |
| Shader Model | 3.0 (vs_3_0/ps_3_0) | 4.0 (vs_4_0/ps_4_0) |
| Visual Quality | Identical | Identical |
| Cross-Platform | Yes (same as Linux/macOS) | Windows-only |
| Stability | Very stable | Stable (fixed GPU sync issues) |
- โ Older GPUs or integrated graphics
- โ Need exact same rendering as Linux/macOS
- โ Experiencing graphics driver issues with DirectX
- โ Better compatibility with virtualization/remote desktop
- โ Modern dedicated GPU (NVIDIA/AMD)
- โ Want best performance on Windows
- โ Latest graphics drivers installed
- โ Windows 10/11 with DirectX 11 support
Both versions produce identical visual results but use different rendering paths:
Shader Compatibility:
- All shaders use conditional compilation (
#if OPENGL) to support both backends - DirectX version includes fixes for GPU buffer synchronization
- Explicit vertex declarations ensure correct memory layout
Known Fixed Issues (DirectX):
- โ GPU/CPU race conditions in buffer pooling (now disabled for DirectX)
- โ Vertex stride mismatches between C# and HLSL shaders
- โ Async model loading deadlocks in UI rendering
- โ Shadow rendering artifacts
โ "Data path not found" error
Solution: Ensure Client.Main/Constants.cs has the correct path to your MU data files.
public static string DataPath = @"C:\Games\MU_Red_1_20_61_Full\Data";Verify the path exists and contains files like Data/Player.bmd, Data/Item, etc.
โ Cannot connect to server
Solution: Check the following:
- Server is running (for OpenMU:
docker psshould show running containers) appsettings.jsonhas correct host/port- Firewall isn't blocking port 44405
- Protocol version matches server (Season6)
โ Black screen / Graphics not loading
Solution:
- Verify data files are complete (re-extract if needed)
- Check
Constants.csshader settings:public const bool ENABLE_DYNAMIC_LIGHTING_SHADER = true;
- Update graphics drivers
- Try disabling MSAA in Constants.cs
- If using DirectX: Try the OpenGL version (MuWinGL) instead
โ DirectX: Graphics glitches, objects flickering or "exploding"
Solution: These issues have been fixed in the latest version. If you still experience them:
- Update to latest version from GitHub
- Clean build:
dotnet clean ./MuWinDX/MuWinDX.csproj dotnet build ./MuWinDX/MuWinDX.csproj -p:MonoGameFramework=MonoGame.Framework.WindowsDX
- Try OpenGL version as fallback:
dotnet run --project ./MuWinGL/MuWinGL.csproj -f net10.0-windows -c Debug -p:MonoGameFramework=MonoGame.Framework.DesktopGL
What was fixed:
- GPU/CPU race conditions in dynamic buffer pooling
- Vertex declaration mismatches in custom shaders
- Async loading deadlocks in inventory rendering
โ DirectX: Client freezes when opening inventory
Solution: Fixed in latest version. The issue was caused by async model loading blocking the main thread.
If still experiencing freezes:
- Update to latest code
- Verify you're using the fixed
BmdPreviewRenderer.cs(checksmodelTask.IsCompleted) - Switch to OpenGL version temporarily
โ Linux: "libopenal.so not found"
Solution:
# Ubuntu/Debian
sudo apt-get install libopenal-dev libgdiplus
# Fedora
sudo dnf install openal-soft-devel libgdiplusโ Build errors on mobile platforms
Solution: For desktop development, disable mobile targets:
dotnet build /p:EnableMobileTargets=falseContributions are welcome! This is an educational project, and we encourage learning and experimentation.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow existing code patterns and architecture
- Use
async/awaitfor networking operations - Marshal UI updates to main thread via
MuGame.ScheduleOnMainThread() - Add XML documentation for public APIs
- Follow C# Coding Conventions
Found a bug or have a question? Open an issue on GitHub.
- CLAUDE.md - Comprehensive developer documentation
- OpenMU Server - https://github.com/MUnique/OpenMU
- MonoGame Documentation - https://docs.monogame.net/
- .NET 10.0 Docs - https://docs.microsoft.com/en-us/dotnet/
This project is created for educational and research purposes only.
- This is a non-commercial educational project demonstrating game client architecture
- The code in this repository is provided as-is for learning purposes
- Authors are not responsible for misuse of this software
Protocol Implementation: The Season 6 network protocol implementation is based on publicly available information and reverse engineering for educational purposes.
Recommended Use Cases:
- Learning game client architecture
- Studying network protocol design
- Understanding cross-platform .NET development
- Exploring MonoGame framework capabilities
- Research and educational projects
Made with โค๏ธ for the game development community