Version: 1.0.0
A single-player online strategy game with army movement, territory control, and AI opponent
Barony is a browser-based turn-based strategy game where you command armies to capture villages and castles against an AI opponent. Build your forces, control territory, and use strategic policies to defeat your enemy.
- PLAYER_GUIDE.md - Complete guide to playing Barony (start here!)
- DOCS.md - Documentation index (find what you need)
- CHANGELOG.md - Version history and features
- MVP.md - MVP specification and implementation details
- ROADMAP.md - Future feature roadmap (v1.1+)
- TICKETS.md - Development tickets and tasks
docker-compose up --buildThen open http://localhost:3000 in your browser.
# Backend
cd backend && ./mvnw spring-boot:run
# Web Client (separate terminal)
cd web-client && ./mvnw spring-boot:runThen open http://localhost:3000 in your browser.
backend/- Spring Boot REST API (game logic)web-client/- Browser-based client (HTML5 Canvas)
Single-Game Endpoints:
GET /state- Get current game statePOST /tick- Advance game by one turnPOST /command- Send MOVE or SPLIT commandPOST /api/reset- Reset gamePOST /api/decision- Change ruler policyGET /api/ruler-stats- Get realm statistics
Session-Aware Endpoints (require X-Session-Id header):
GET /api/session/state- Get game state for sessionPOST /api/session/tick- Advance game by one turn for sessionPOST /api/session/command- Send command for sessionPOST /api/session/reset- Reset game for sessionPOST /api/session/decision- Change ruler policy for sessionGET /api/session/ruler-stats- Get realm statistics for session
Authentication:
POST /api/auth/login- Login and get session ID
Move Army:
curl -X POST http://localhost:8080/command \
-H "Content-Type: application/json" \
-d '{"type":"MOVE","armyId":1,"targetX":5,"targetY":5}'Split Army:
curl -X POST http://localhost:8080/command \
-H "Content-Type: application/json" \
-d '{"type":"SPLIT","armyId":1,"splitAmount":5}'Change Policy:
curl -X POST http://localhost:8080/api/decision \
-H "Content-Type: application/json" \
-d '{"category":"ECONOMIC","choice":"HEAVY_TAXATION"}'For detailed API documentation, see technical sections below.
Browser-based interface with HTML5 Canvas rendering.
Start:
docker-compose upThen open http://localhost:3000
- Toast notifications replace all in-game blocking alerts
- Canvas hover tooltips (tile info, army stats, castle capture progress)
- Army selection highlight ring on canvas
- Right-click to deselect armies
- Auto Play toggle button (single button, active-state indication)
- Color-coded stats (green ≥ 90, amber 70–89, red < 70)
- Policy cooldown progress bar
- Game-over banner overlay on canvas
- Inline split validation (no alerts)
- Colorblind modes: Deuteranopia, Protanopia, Tritanopia
- Themes: Dark (default), Classic, High Contrast
- Adjustable font size: Small, Medium, Large
- Settings panel with live preview
- Settings persisted to
localStorageunderbarony_settings
- Goal: Capture all enemy castles to win
- Players: You (blue) vs AI (red)
- Movement: Armies move 1 tile per turn
- Villages: Generate +1 soldier/turn for stationed armies
- Combat: Simultaneous damage (10 vs 7 → 3 vs 0)
- Castle Capture: Occupy for 3 consecutive turns
See PLAYER_GUIDE.md for complete gameplay instructions.
Requirements: Java 17, Maven (wrapper included)
# Backend
cd backend && ./mvnw clean package test
# Web Client
cd web-client && ./mvnw clean package testGitHub Actions runs on all PRs:
- Builds backend and web client
- Runs all unit and integration tests
- Uses JDK 17 with Maven caching
- Spring Boot REST API
- In-memory game state (thread-safe)
- Unique army IDs (not list indices)
- CORS: localhost only
- Spring Boot + Thymeleaf
- HTML5 Canvas rendering
- RESTful backend communication
Backend won't start:
- Check Java 17:
java -version - Port 8080 in use:
lsof -i :8080(Unix) ornetstat -ano | findstr :8080(Windows)
Web client won't load:
- Ensure backend is running first
- Check that port 3000 isn't already in use
- Try clearing browser cache
Policy changes not working:
- Wait for 15-turn cooldown
- Check Ruler Stats panel for timer
- Effects are gradual (several turns)
For detailed troubleshooting, see PLAYER_GUIDE.md.
- Playing the game? See PLAYER_GUIDE.md
- Technical issues? Check the Troubleshooting section above
- Can't find what you need? See DOCS.md for documentation index
- Found a bug? Open an issue on GitHub
This project is licensed under the Stephenson Software Non-Commercial License (Stephenson-NC).
© 2025 Daniel McCoy Stephenson. All rights reserved.
You may use, modify, and share this software for non-commercial purposes only.
Commercial use is prohibited without explicit written permission from the copyright holder.
Full license text: LICENSE.md (canonical: Stephenson-Software/stephenson-nc-license)
SPDX Identifier (custom): LicenseRef-Stephenson-NC