Empire Builder Documentationο
Welcome to Empire Builder - a real-time multiplayer strategy game built with Flask and Supabase.
Overviewο
Empire Builder is a web-based multiplayer strategy game that combines classic empire-building gameplay with modern real-time web technologies. Players build and manage empires, engage in battles, form alliances, and compete for dominance in a persistent online world.
- π° Key Features
Real-time multiplayer gameplay with WebSocket support
Persistent game state using Supabase PostgreSQL
Advanced battle and combat systems
Resource management and city building
Alliance and diplomacy systems
Comprehensive user authentication and session management
- π Technology Stack
Backend: Flask 2.2.5, Python 3.11+
Database: Supabase (PostgreSQL) with real-time subscriptions
Real-time: Flask-SocketIO for WebSocket communication
Frontend: HTML5/CSS3, JavaScript, Jinja2 templates
Authentication: Custom Supabase-based auth system
Quick Startο
Get Empire Builder running in minutes:
# Clone and navigate to empire directory
cd empire
# Install dependencies
pip install -r requirements.txt
# Set up environment variables
cp .env.template .env
# Edit .env with your Supabase credentials
# Run the application
python app_supabase.py
The game will be available at http://localhost:5000
Game Featuresο
- ποΈ Empire Management
Build and upgrade cities
Manage resources (gold, food, materials)
Research technologies
Train military units
- βοΈ Combat System
Real-time battles between players
Strategic unit positioning
Terrain and weather effects
Battle history and statistics
- π€ Multiplayer Features
Alliance formation and management
Diplomatic relations
Global chat and messaging
Leaderboards and rankings
- π§ Administrative Tools
User account management
Game moderation features
Analytics and reporting
Backup and recovery systems
Architectureο
Empire Builder uses a modern, scalable architecture:
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β Web Browser βββββΊβ Flask Server βββββΊβ Supabase DB β
β β β β β β
β β’ HTML/CSS/JS β β β’ Game Logic β β β’ PostgreSQL β
β β’ WebSocket β β β’ Authenticationβ β β’ Real-time β
β β’ Real-time UI β β β’ API Endpoints β β β’ Row Level Sec β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
Core Components:
app_supabase.py: Main Flask application with routes and WebSocket handlers
models_supabase.py: Game logic, database models, and business rules
auth_supabase.py: User authentication and session management
ai_system.py: AI opponents and automated gameplay
supabase_config.py: Database configuration and connection management
Development Statusο
Empire Builder is actively developed with the following components:
- β Completed Features:
User registration and authentication
Basic empire management
Real-time WebSocket communication
Supabase database integration
Battle system foundation
- π§ In Development:
Advanced combat mechanics
Alliance system
Technology research trees
Enhanced UI/UX
- π Planned Features:
Mobile responsive design
Advanced AI opponents
Tournament system
Mod support
Getting Helpο
Documentation: Browse the sections in this documentation
Issues: Report bugs and request features on GitHub
Development: See the development guide for contributing