Freeciv Longturn Server
A self-hosted Freeciv 3.2.3 multiplayer server designed for longturn games (23-hour turns), running on Fly.io with email notifications, a live status page, and an AI-generated newspaper.
An active 16-player game is running on this codebase right now. Check out the status page to see live rankings, turn countdowns, history charts, diplomacy tracking, and the AI-generated wartime newspaper.
What is Longturn?
Longturn is a style of Freeciv multiplayer where each turn lasts ~23 hours instead of minutes. Players log in once a day, make their moves, click "Turn Done", and go about their lives. When all players have ended their turn (or the timer runs out), the next turn begins.
Architecture Overview
┌─────────────────────────────────────────────────┐ │ Fly.io Container │ │ │ │ entrypoint.sh │ │ ├── busybox crond (status page refresh) │ │ └── start.sh │ │ ├── freeciv-server (port 5556) │ │ ├── busybox httpd (port 8080 → 80/443) │ │ ├── FIFO command writer │ │ ├── Turn change watcher │ │ ├── Auto-saver (every 5 min) │ │ └── Turn reminder checker │ │ │ │ /data/saves (persistent volume) │ │ ├── lt-game-*.sav.gz (save files) │ │ ├── freeciv.sqlite (player auth DB) │ │ ├── status.json (live game state) │ │ ├── history.json (per-turn stats) │ │ ├── attendance.json (missed turns) │ │ ├── diplomacy.json (relationships) │ │ └── gazette.json (AI newspaper) │ └─────────────────────────────────────────────────┘
The server communicates via a FIFO pipe ( /tmp/server-input ) — scripts send commands to the running Freeciv server by writing to this pipe.
Scripts
Core
... continue reading