This repository is under active development. Not currently at a usable state. Contributions are welcome.
Cross-platform Native SDK for Colyseus. Aimed to be used for all native targets, such as Godot, Unreal Engine, Game Maker, and more.
This project supports two build systems: CMake (traditional) and Zig (modern). Choose the one that fits your workflow!
Quick Start:
# Install dependencies
git submodule update --init --recursive
# Build with Zig
zig build
# Run example
zig build run-exampleWhy Zig?
- ✨ Simple, readable build files
- 🌍 Easy cross-compilation
- ⚡ Faster builds with built-in caching
- 📦 No separate C compiler needed
See BUILD_WITH_ZIG.md for detailed documentation.
# Install dependencies
git submodule update --init --recursive
# Build with CMake
mkdir -p build
cd build
cmake ..
cmake --build .
# Run example
./bin/simple_example| Task | Zig | CMake |
|---|---|---|
| Build | zig build |
cmake --build build/ |
| Release build | zig build -Doptimize=ReleaseFast |
cmake -DCMAKE_BUILD_TYPE=Release .. |
| Shared library | zig build -Dshared=true |
cmake -DBUILD_SHARED_LIBS=ON .. |
| Skip examples | zig build -Dexamples=false |
cmake -DBUILD_EXAMPLES=OFF .. |
| Cross-compile | zig build -Dtarget=x86_64-windows |
(Complex, needs toolchain) |
| Run example | zig build run-example |
./build/bin/simple_example |
| Clean | rm -rf zig-out .zig-cache |
rm -rf build/ |
native-sdk/
├── build.zig # Zig build configuration
├── CMakeLists.txt # CMake build configuration
├── include/ # Public API headers
├── src/ # Implementation
├── examples/ # Example programs
└── third_party/ # Dependencies (cJSON, sds, uthash, wslay)
- libcurl - HTTP client library
- cJSON - JSON parser (included)
- sds - String library (included)
- uthash - Hash table library (included)
- wslay - WebSocket library (included)
- Building with Zig - Comprehensive Zig build guide
- Windows Compilation - Building on Windows with MinGW
- Colyseus Documentation - Server documentation
Work in progress. API is subject to change.
See LICENSE file for details.