A high-performance, massively multiplayer game engine built in Rust. Powering persistent medieval sandbox worlds — without server wipes.
Everything a modern MMO engine needs — in one integrated workspace.
The world (36 km × 36 km) is partitioned by a quadtree into independent shards, each owning its own ECS world, physics simulation and terrain. Shards split at 600 entities or 75 % CPU load and merge when idle — the orchestrator manages the full lifecycle automatically with 30 s cooldowns and up to 4 concurrent operations.
100 m overlap corridors exist at every shard boundary. Entities approaching the edge are mirrored into the neighbouring shard and synced every 100 ms (up to 500 ghosts per neighbour), guaranteeing seamless handoff with zero visible discontinuity for players.
Full voxel terrain at 0.1 m vertical resolution across a height range of −1 000 m to +1 000 m, persisted in ScyllaDB with RLE compression (1 333:1 for unmodified chunks). Biome layers, hydraulic and thermal erosion, cave generation, ore veins and procedural terrain decay are all built in.
NPCs run on Behaviour Trees with an XP-driven rank system (Normal → Elite → Boss) and difficulty grades (0–3 ★). Grade 3 bosses deal 2× damage with 2.5× health. A* pathfinding on a navigation mesh auto-generated from voxel data, up to 5 000 NPCs per dedicated AI worker at 10 Hz.
No server wipes — ever. Unclaimed terrain gradually reverts to its procedural state (72 h delay, 5 % per tick). Depleted ore veins respawn world-wide. Seasons progress on a real calendar (30-day months, 12 months, 8 real hours per in-game day). Dynamic weather with rain, snow, fog and thunderstorms.
UDP at 20–30 Hz for low-latency movement and combat (zero-copy binary, ≤ 1 400 B packets, < 100 ms RTT). QUIC for reliable inventory, chat and quest traffic. WebSocket for client connections. All internal services communicate via gRPC. SO_REUSEADDR and DSCP EF markings keep jitter low.
Cross-shard text and voice chat with eight channel types (Local 50 m, World, Global, Guild, Party, Trade, Whisper, System). Opus codec at 32 kbps, 3D spatial audio with Doppler effect, HRTF profiles, audio occlusion and reverb. Redis Pub/Sub distributes messages across all shards in real time.
Guilds claim land via monument circles (base radius 100 m, up to 5 upgrade levels reaching 140 m) or rectangular fief grids. Progressive upkeep costs apply (1.05× scaling exponent). Siege mechanics with a 1 h preparation phase, 2 h active window and 24 h cooldown. New claims enjoy 72 h protection.
14 optional plugins (Crafting, Farming, PvP Arenas, Quests and more) extend the engine at runtime via a verified dynamic loader with Ed25519 signature checks and ABI hash validation. A capability system controls exactly what each plugin can access — core modules are never modified.
A closer look at the systems that power Feudal Engine.
Distributed microservice architecture — designed for massive scale.
| Process | Port | Description |
|---|---|---|
feudal-gateway |
8080 WS | Client-facing WebSocket gateway (10 000 max connections, 10 per IP); login queue, session management, position-based shard routing via orchestrator snapshots |
feudal-orchestrator |
50100 gRPC | Quadtree shard coordinator; authority registry; split / merge lifecycle (split at 600 entities / 75 % CPU); HA failover with Redis leader election and 30 s cooldown |
feudal-node |
50200+ gRPC | World shard — 60 Hz ECS game loop, physics, terrain, networking, ghost-zone UDP sync with neighbours, entity persistence via gRPC pool |
feudal-physics-worker |
50300 gRPC | SIMD physics offload — horizontally scalable; triggered at > 2 000 bodies per shard; streaming gRPC entity state |
feudal-ai-worker |
50400 gRPC | NPC AI — Behaviour Trees, A* pathfinding on nav-mesh, adaptive ML grades (0–3 ★), 10 Hz tick, up to 5 000 NPCs per worker |
feudal-terrain-worker |
50500 gRPC | Terrain generation, hydraulic & thermal erosion, biome assignment, navmesh generation; offloaded via gRPC |
feudal-chat-server |
9200 gRPC | Cross-shard voice (Opus 32 kbps) and text chat; 8 channel types; Redis Pub/Sub distribution; JWT auth; moderation (mute/ban/flood detection) |
Physics, AI and terrain generation run in dedicated processes, dynamically assigned by the orchestrator. Each scales horizontally and independently — add more workers without touching shard servers.
Shards split automatically when load exceeds thresholds (600 entities or 75 % CPU for 5 consecutive cycles) and merge at 100 entities. The orchestrator manages the complete lifecycle with 30 s cooldowns — zero manual intervention.
PostgreSQL for player accounts and transactions (50-connection pool, TLS). ScyllaDB for voxel terrain and world state (QUORUM consistency, RF 3). Redis for sessions, leaderboards and real-time pub/sub. All drivers ship with in-memory mocks for fast iteration.
Best-in-class Rust ecosystem — from the ECS core to the database layer.
14 optional plugins extend the engine at runtime — without modifying the core.
Instanced PvP arenas with teams, scoring, 10-min matches and leaderboards
Crafting stations (Anvil, Workbench, Alchemy, Cooking), recipes and skill levelling
Crop growth stages (seedling → mature), water and health mechanics, seasonal yields
Quest tracking, objective management and in-game delivery
High-performance persistent quest state via storage API, batch loading and async I/O
Zone management, region hierarchy, instancing and auto-scaling (max 100 players per instance)
Player voxel terrain editing with undo/redo (100 steps), batch processing and async persistence
Hierarchical LOD streaming: LOD0 128 m, LOD1 512 m, LOD2 2 048 m; priority queue and memory budgets
Live Prometheus/Grafana performance dashboard with per-plugin metric collection
Delta-compressed replication rules, interest filtering and per-entity bandwidth budgeting (128 KB/s)
Server-side validation with anomaly detection and rate limiting
Progressive asset loading (low-res → high-res) with priority queue and LRU eviction
Swappable PostgreSQL / Cassandra backend with connection pooling, batch writes and caching
Minimal reference plugin demonstrating init, update and shutdown lifecycle hooks