EC4X is an asynchronous turn-based wargame of the classic eXplore, eXpand, eXploit, and eXterminate (4X) variety for multiple players.
Inspired by Esterian Conquest and other classic BBS door games, EC4X combines the async rhythm of turn-based strategy with modern cryptographic identity and decentralized infrastructure.
📖 Read the Complete Game Specification - Full rules, gameplay mechanics, and strategic systems
The twelve dynatoi (δυνατοί - "the powerful") - ancient Great Houses rising from the ashes - battle over a small region of space to dominate rivals and claim supremacy. The game features abstract strategic cycles that scale with map size - from decades in small skirmishes to centuries in epic campaigns.
Game Details:
- Players: 2-12
- Turn Duration: ~24 hours (real-time)
- Victory Condition: Turn limit reached (highest prestige wins) or last House standing
- Starting Prestige: 100 points
Turns cycle every 24 hours IRL, intentionally designed for async gameplay where players check in once per day.
EC4X uses Nostr relays for transport. For local development, point the daemon at a localhost relay (e.g. ws://localhost:8080). For multiplayer, point it at any public or private Nostr relay.
Binaries:
ec4x— Game moderator CLI: create games, manage invites, inspect stateec4x-daemon— Autonomous turn processing service: ingests player commands, resolves turns, publishes resultstui— Terminal player client: join games via invite code, submit orders, view game state
Key Features:
- Server-authoritative game state over Nostr (NIP-44 end-to-end encryption)
- Fog of war via intel system
- Bandwidth-efficient state deltas
- KDL-based configuration (18 config files, no hardcoded values)
- SQLite single source of truth per game
See Architecture Documentation for complete system design.
Engine, Daemon & TUI Operational — Playtesting
✅ Engine:
- Core game engine stable and tested (343+ tests passing)
- All 13 game systems operational
- Full turn cycle tested (Conflict → Income → Command → Production)
✅ Infrastructure:
- Daemon operational: game discovery, turn resolution, Nostr publish/subscribe
- TUI operational: invite code join flow, order submission, fog-of-war state rendering
- Nostr transport implemented: encrypted commands (NIP-44), replaceable events, delta publishing
🔄 Current Work:
- Playtesting and balance validation
- Polish and bug fixes surfaced during real games
📋 Test Coverage:
- Unit Tests: 9 suites passing
- Integration Tests: 310 tests passing
- Stress Tests: 24 tests passing
- Total: 343+ tests passing
Game Systems (Operational):
- Combat system (space battles, ground combat, starbases)
- Economy system (production, construction, maintenance)
- Research system (tech trees, science levels)
- Prestige system (dynamic scaling, morale)
- Espionage system (covert operations, counter-intelligence)
- Diplomacy system (three-state relations)
- Colonization system (PTU, Space Guild)
- Victory conditions (turn limit, elimination)
- Fleet management (movement, orders, status)
- Star map generation (procedural hex grid)
- Fog-of-war intelligence system
- Configuration system (KDL format)
- Turn resolution (order processing)
- Complete Game Specification - Full rules, gameplay, and strategic systems
- Documentation Overview - Navigation guide for all documentation
- System Architecture - Core system design and components
- Daemon Design - Daemon architecture and identity management
- Combat Engine - Combat system architecture
- Fleet System - Fleet management architecture
- Intelligence System - Fog-of-war and intelligence mechanics
- TODO - Current work tracking and roadmap
- Daemon Setup (system service) - Production deployment guide
- Daemon Setup (user service) - Local dev deployment guide
- Playtesting Plans - Human playtesting and training data collection
- Nim 2.0+ and Nimble
- OpenGL development libraries (for client)
- zstd compression library
Arch/CachyOS:
sudo pacman -S nim nimble zstd libgl libx11 libxcursor libxi libxrandrUbuntu/Debian:
sudo apt install nim libgl-dev libx11-dev libxcursor-dev libxi-dev libxrandr-dev libzstd-devmacOS (Homebrew):
brew install nim zstdBuild everything:
nimble buildAllRun tests:
nimble testUnit # Unit tests
nimble testIntegration # Integration tests
nimble testStress # Stress testsDev reset (clear state, create a fresh game, print invite codes):
nim r tools/clean_dev.nimThe daemon requires a Nostr relay. For local dev we recommend nostr-rs-relay at ws://localhost:8080 (configurable in config/daemon.kdl).
First-time setup — generate the daemon's Nostr keypair:
./bin/ec4x-daemon initThis creates ~/.local/share/ec4x/daemon_identity.kdl with 600 permissions. Running init again is safe — it will never overwrite an existing identity.
Start the daemon:
./bin/ec4x-daemon startFor running the daemon as a systemd service, see the full setup guides: