An open-source Age of Empires-inspired RTS built with Unity 6 and a Rust relay server backend, featuring deterministic lockstep multiplayer.
- Engine: Unity 6 (6000.3.9f1) with URP and New Input System
- Backend: Rust (Axum + Tokio + WebSockets), PostgreSQL for matchmaking
- Multiplayer: Deterministic lockstep with dynamic input delay
- Math: Fixed-point (Q16.16) arithmetic for cross-platform determinism
- Clone the repository
- Open the
Open Empires/folder in Unity Hub (not the repo root) - Use Unity 6 (6000.3.9f1) or compatible
- Open the main scene and press Play
- Install Rust
- Install PostgreSQL and create a database
- Set the
DATABASE_URLenvironment variable (e.g.postgres://user:pass@localhost/openempires) - Run the server:
cd backend cargo run - Optional: Place a MaxMind GeoLite2 City database at
data/GeoLite2-City.mmdbfor player geolocation
A pre-built WebGL version is available in the docs/ folder and can be served as a static site.
All gameplay state lives in pure C# simulation classes (GameSimulation, SquadData, SoldierData, MapData) with no Unity dependencies. MonoBehaviour renderers (SquadView, SoldierView, MapRenderer) read simulation state and update visuals each frame.
Players send commands to a relay server, which broadcasts all inputs. Clients execute the same commands in the same order using fixed-point math and a deterministic PRNG, with checksums to detect desync.
Individual units are controlled directly. Villagers gather resources and construct buildings, while military units (spearmen, archers, horsemen, etc.) handle combat.
Villagers gather resources (food, wood, gold, stone) to fuel your economy and advance through ages.
Open Empires/
Assets/
Scripts/
Core/ # GameSimulation, GameBootstrapper, GameSetup
Units/ # UnitData, movement, combat
Network/ # CommandSerializer, relay client
Prefabs/ # Unit and building prefabs
Scenes/ # Game scenes
backend/ # Rust relay/matchmaking server
docs/ # WebGL build
See CONTRIBUTING.md for guidelines on how to contribute.
This project is licensed under the MIT License. See LICENSE for details.
For third-party license information, see THIRD_PARTY_NOTICES.md.



