Capitol Conquest
Hex‑grid territory strategy — AI heuristics, WebSocket multiplayer, adaptive rendering & telemetry.
Overview
Capitol Conquest is a modern, Hexxagon-style strategy game built with Phaser 3. Two parties compete for control on a hexagonal grid through tactical moves that duplicate or jump pieces and convert adjacent opponent tiles. The game includes adaptive AI with multiple difficulty levels, real-time online multiplayer, built‑in chat, analytics, and responsive UX across devices.
Game Features
🔷 Hex Strategy
Duplicate (range 1) or jump (range 2); adjacency flips opponent tiles.
🎮 Modes
AI solo, local two-player & online real-time multiplayer.
🤖 AI Levels
Normal, Hard, Expert—distinct evaluation weights & starting positions.
💬 In-Game Chat
Party-colored real-time messaging with scrollback.
📊 Global Stats
Match outcomes, duration, mode & difficulty persisted.
📱 Multi-Device
Responsive canvas, touch gestures & adaptive viewport.
🎵 Audio System
Music toggle + distinct SFX per action.
⚡ Smooth UX
Keyboard nav, clear affordances, smart defaults.
AI Implementation
The computer opponent uses a greedy, single-depth heuristic that balances multiple factors. Each candidate move is simulated and scored using a weighted combination of:
- Material advantage (piece differential)
- Limiting opponent mobility (reduce their next moves)
- Central control (prefer positions closer to the board center)
- Risk avoidance (penalize exposed positions)
- Small randomness (jitter) to prevent repetition
Different difficulty levels adjust weights and starting advantages to create distinct play styles and challenge levels.
Online Multiplayer System
Real-time multiplayer features include instant matchmaking, synchronized turns via WebSockets, and reliability features for production use.
- Instant matchmaking with room-based pairing (two players per room)
- Live turn updates and server-side validation of game state
- Reconnection handling and disconnect win assignment
- Waiting room UI with loading animation
- Party-colored chat available throughout the match
Architecture highlights:
- Socket.IO server with Express.js backend
- Room management and turn validation on the server
- PM2 configuration for production uptime
Statistics & Analytics
Global and per-mode stats are captured for online matches:
- Real-time write to Google Sheets via Google Apps Script
- Win/loss tracking, game duration, difficulty, mode, and timestamps
- Recent games view and performance analysis
- Analytics via Google Tag Manager for user engagement and performance
User Interface & UX
- Branded title and themed party colors throughout the UI
- Responsive menus with hover/touch feedback and clear state indicators
- Keyboard support (arrow keys, Enter) and accessible defaults
- Mobile optimizations for dynamic viewports, touch targets, and typography
Technical Architecture
Deployment & Performance
- Client hosted as a static site (GitHub Pages) with CDN assets
- Automated deployments via GitHub Actions
- Efficient rendering and lazy asset loading for performance
- Backend deployed to GCP compute instance
- Mobile performance optimizations and caching strategies
Game Rules
Objective
Control more tiles than your opponent when all playable hexes are filled.
How to Play
- Choose your side (🔴 Republicans or 🔵 Democrats)
- Select a mode (Single Player, Local Two-Player, or Online)
- For single player, pick a difficulty: Normal, Hard, or Expert
- On your turn, either:
- Duplicate to an adjacent hex (distance 1), or
- Jump up to two hexes (distance 2)
- After moving, adjacent enemy tiles flip to your color
- The game ends when no moves remain; majority wins
Controls
- Mouse/Touch: tap/click to select and move
- Keyboard: arrow keys to navigate menus, Enter to select
- ESC: return to menu; F: toggle fullscreen
- Music control available in the UI; chat in online matches
Try the Game
Try Capitol Conquest
Experience AI-driven positional evaluation, hex grid transformations & real-time multiplayer session orchestration.
Launch GameRepo: GitHub
Audio Credits
- Sound effects from Freesound.org (Creative Commons licensed)
- Background music generated with AIVA (Artificial Intelligence Virtual Artist)
MXM Consulting Capability Showcase
Demonstrates MXM Consulting strengths in:
- Interactive Web & Canvas Systems
- AI / Heuristic Algorithm Design
- Real-time Multiplayer State Synchronization
- Telemetry & Analytics Instrumentation
- Responsive & Accessible UI Architecture
Need Real-Time Interactive Systems?
Phaser / Canvas / WebGL experiences, AI opponent design, multiplayer orchestration & performance analytics — end to end.