Files
caro/docs/project-roadmap.md
T

15 KiB

Project Roadmap

Overview

Caro (Gomoku) is a completed multiplayer game with all core features implemented and tested. This roadmap documents completed phases and future enhancement ideas.

Current Version: 1.4.0
Status: Stable, actively maintained
Last Updated: 2026-04-10


Completed Phases

Phase 1: Gomoku Game Conversion ✓ DONE

Timeline: 2025-Q4
Status: Complete

What was done:

  • Converted ratel (Landlords card game framework) to Gomoku
  • Implemented 15x15 board with standard rules
  • Created game logic: move validation, win detection (4 directions)
  • Defined protocol: ServerEventCode (14 codes), ClientEventCode (24 codes)
  • Shared library with reusable entities (Board, Room, GameMove)

Key files:

  • landlords-common/entity/Board.java — Board state & validation
  • landlords-common/enums/ — Event and game state enums
  • landlords-common/helper/GomokuHelper.java — Win detection

Outcome:

  • Working multiplayer server (Netty)
  • Game rules correctly enforced
  • Extensible for AI and spectators

Phase 2: Code Cleanup & Modernization ✓ DONE

Timeline: 2026-Q1
Status: Complete

What was done:

  • Removed all Landlords card game code (poker, scoring, etc.)
  • Removed Chinese text and localized to English
  • Cleaned up server event handlers (separated concerns)
  • Cleaned up client event handlers
  • Updated README with Gomoku focus
  • Fixed broken references in code

Key files modified:

  • landlords-server/event/ServerEventListener_*.java — Simplified
  • landlords-client/event/ClientEventListener_*.java — Simplified
  • README.md — Updated with Gomoku features
  • Removed files: ~15 obsolete files

Outcome:

  • Lean, maintainable codebase
  • No dead code
  • Clear separation between game logic and protocol

Phase 3: Comprehensive Testing ✓ DONE

Timeline: 2026-Q1
Status: Complete (37 tests)

What was done:

  • Wrote 37 unit tests for game logic
  • Created GomokuHelperTest (20+ tests for win detection)
  • Created GomokuAITest (17+ tests for AI moves)
  • All tests pass with 100% game logic coverage

Test breakdown:

  • Win Detection: Horizontal, vertical, diagonal (2 directions), edges, corners
  • Draw Detection: Full board with no winner
  • AI Easy: Validates random move generation
  • AI Medium: Validates find-win and block-opponent logic
  • AI Hard: Validates minimax scoring at depth 3

Key files:

  • landlords-common/src/test/java/helper/tests/GomokuHelperTest.java
  • landlords-common/src/test/java/robot/tests/GomokuAITest.java

Outcome:

  • Game logic is battle-tested
  • Regression bugs caught early
  • CI/CD pipeline runs tests automatically

Phase 4: Built-in Web UI ✓ DONE

Timeline: 2026-Q1
Status: Complete

What was done:

  • Created StaticFileHandler in Netty pipeline
  • Implemented HTTP file serving (port 1025)
  • Created basic HTML/CSS/JS UI
  • Integrated with WebSocket protocol
  • MIME type mapping for assets (html, css, js, images, audio)
  • Path traversal security (prevents ../ attacks)

Key files:

  • landlords-server/handler/StaticFileHandler.java — File serving
  • landlords-server/resources/static/ — HTML, CSS, JS

Outcome:

  • Players can access UI without separate deployment
  • Quick play: just run server JAR
  • Security: path traversal blocked

Phase 5: Phaser 3 Web Client ✓ DONE

Timeline: 2026-Q2
Status: Complete (fully polished)

What was done:

  • Created professional game UI with Phaser 3
  • Implemented scenes: Boot, Menu, Game
  • Built services: EventBus, ConnectionService, GameStateService
  • Designed game objects: Board (wood texture), Stone (gradient + animation)
  • Created UI components: MenuUI, GameUI (HUD, move history, game over)
  • Added sound effects (Web Audio API)
  • Integrated Vite for fast builds

Feature breakdown:

  • Board Rendering: 15x15 grid, wood texture, cell hover effects
  • Stone Animations: Drop animation on placement, gradient colors
  • Move History: Chronological list of all moves
  • Turn Indicator: Shows whose turn + waiting animation
  • Game Over Modal: Winner/loser announcement, rematch button
  • Menus: Nickname input, room creation, room list, settings
  • Sound Effects: Move sound, win/lose sound, UI click sounds
  • Spectator Mode: Watch games without ability to move
  • Connection Management: Auto-reconnect, heartbeat (30s interval)

Key files:

  • web-client/src/scenes/game-scene.js — Main gameplay
  • web-client/src/objects/board.js — Board renderer
  • web-client/src/services/connection-service.js — WebSocket client
  • web-client/src/ui/game-ui.js — HUD & notifications

Outcome:

  • Professional, polished game experience
  • Works on modern browsers (Chrome, Firefox, Safari, Edge)
  • Mobile-friendly responsive design
  • Fast dev iteration (Vite hot reload)

Phase 6: CI/CD & Automation ✓ DONE

Timeline: 2026-Q2
Status: Complete

What was done:

  • Set up GitHub Actions Build pipeline

    • Triggers on every push
    • Runs Maven build
    • Executes all 37 tests
    • Builds web-client with npm
  • Set up GitHub Actions Deploy pipeline

    • Triggers on push to master
    • Builds web-client
    • Auto-deploys to GitHub Pages
    • URL: https://tiennm99.github.io/caro/

Key files:

  • .github/workflows/build.yml — Build & test
  • .github/workflows/deploy-pages.yml — Auto-deploy

Outcome:

  • No manual deployment needed
  • Web client always up-to-date on master push
  • Tests must pass before merge
  • Zero-downtime rollback possible via tags

Current Stable Features

Game Features

  • ✓ Player vs Player (PVP) multiplayer
  • ✓ Player vs AI (PVE) with 3 difficulties
  • ✓ Spectator mode
  • ✓ 15x15 board with standard Gomoku rules
  • ✓ Real-time move synchronization
  • ✓ Game over detection (win, lose, draw)
  • ✓ Rematch/reset functionality

Network Features

  • ✓ TCP/Protobuf protocol (CLI clients)
  • ✓ WebSocket/JSON protocol (web clients)
  • ✓ Dual protocol simultaneous support
  • ✓ Connection heartbeat (keep-alive)
  • ✓ Auto-reconnect with exponential backoff
  • ✓ Graceful disconnection handling

UI Features

  • ✓ Web client (Phaser 3, professional UI)
  • ✓ CLI client (terminal-based)
  • ✓ Built-in web UI (static HTML, served by server)
  • ✓ Responsive design (desktop + tablet)
  • ✓ Sound effects
  • ✓ Move animations
  • ✓ Move history panel
  • ✓ Game over notifications

Infrastructure

  • ✓ Maven build (Java)
  • ✓ Vite build (JavaScript)
  • ✓ GitHub Actions CI/CD
  • ✓ Unit tests (37 tests, 100% game logic coverage)
  • ✓ Docker-ready (single JAR)
  • ✓ Cross-platform (Windows, macOS, Linux)

Future Enhancement Ideas

Tier 1: High Value (If Implementing)

In-Game Chat

  • Problem: Players can't communicate during games
  • Solution: Add text chat service
  • Effort: Medium (1-2 weeks)
  • Impact: Better social experience
  • Dependencies: None
  • Files to add: ChatService.java, chat UI component
  • Risks: Moderation, toxic behavior

Player Accounts & Leaderboards

  • Problem: No persistent player stats
  • Solution: Add user registration, store game results in DB
  • Effort: High (3-4 weeks)
  • Impact: Replayability, competition
  • Dependencies: Database (PostgreSQL/MongoDB), auth library
  • Files to add: UserService.java, LeaderboardService.java, AuthHandler.java
  • Risks: Database complexity, privacy considerations

Game Replay & Review

  • Problem: Can't review past games
  • Solution: Record move history, implement playback
  • Effort: Medium (2 weeks)
  • Impact: Learning tool, competition
  • Dependencies: None (storage layer needed)
  • Files to add: ReplayService.java, replay scene
  • Implementation: Store moves list, allow forward/backward navigation

Mobile Responsive Improvements

  • Problem: Desktop-first design, touch not optimized
  • Solution: Add touch controls, responsive board sizing
  • Effort: Low-Medium (1 week)
  • Impact: Play on phones/tablets
  • Dependencies: None (Phaser has mobile support)
  • Files to modify: board.js, game-scene.js, game-config.js

Tier 2: Medium Value (Nice to Have)

Tournament Mode

  • Bracket-style matches, best-of-N series
  • Effort: Medium
  • Impact: Competitive events
  • Dependencies: Leaderboards (Tier 1)

Alternative Board Sizes

  • 13x13, 19x19 (like traditional Gomoku)
  • Effort: Low (mostly config changes)
  • Impact: Variety
  • Dependencies: Minimal (Board.java configurable)
  • Files to modify: Board.java, game-config.js

Better AI (Minimax with Alpha-Beta Pruning)

  • Current: Simple minimax at depth 3
  • Improvement: Depth 5+, alpha-beta pruning
  • Effort: Medium
  • Impact: Harder AI opponent
  • Dependencies: None
  • Files to modify: GomokuAI.java
  • Risks: Longer move time (< 5 seconds acceptable)

Elo Rating System

  • Track player skill rating (like chess)
  • Effort: Medium
  • Impact: Matchmaking, competitive fairness
  • Dependencies: Player accounts (Tier 1)

Tier 3: Polish (When Bored)

Sound Preferences

  • Toggle sound on/off, volume control
  • Effort: Low
  • Files: UI component, localStorage

Board Themes

  • Different textures (stone, wood, marble)
  • Effort: Low
  • Files: Asset files, theme loader

Move Animation Options

  • Faster/slower, disable animations
  • Effort: Low
  • Files: Config, Phaser tweens

Player Statistics Dashboard

  • Win rate, games played, favorite opponent, etc.
  • Effort: Medium
  • Dependencies: Accounts (Tier 1)

Time Controls

  • Blitz (5 min), Rapid (15 min), Classical (no limit)
  • Effort: Medium
  • Files: TimerService.java, timer UI
  • Impact: Different play styles

Known Limitations

Limitation Workaround Future Fix
No persistent accounts Use nickname Implement Tier 1: Accounts
No game history Remember moves mentally Implement Tier 1: Replay
No chat Use Discord/Slack Implement Tier 1: Chat
Single board size (15x15) Accept standard Implement Tier 2: Alt sizes
AI depth 3 only Beat hard AI rarely Implement Tier 2: Better AI
No mobile touch Use keyboard/mouse Implement Tier 1: Mobile
No tournament Play manually Implement Tier 2: Tournaments

Performance Baselines

Metric Target Current Status
Move latency < 500ms ~50ms ✓ Exceeds
AI response (Hard) < 1s ~800ms ✓ Exceeds
Server startup < 5s ~1s ✓ Exceeds
Web client load < 2s ~400ms ✓ Exceeds
Concurrent players 50+ 100+ ✓ Exceeds
Game logic tests > 30 37 ✓ Exceeds

Maintenance & Support Schedule

Regular (Every Release)

  • Run all 37 tests
  • Build JAR + web client
  • Deploy to GitHub Pages
  • Update version in pom.xml + package.json

Quarterly

  • Check Maven dependency updates
  • Update npm packages (Phaser, Vite)
  • Review GitHub issues
  • Update documentation

As-Needed

  • Bug fixes (push as patch version)
  • Security patches (priority)
  • User feedback implementation

Version History

Version Date Major Changes
1.4.0 2026-Q2 Phaser 3 client, CI/CD, polished
1.3.0 2026-Q1 Built-in web UI, comprehensive tests
1.2.0 2026-Q1 Code cleanup, remove dead code
1.1.0 2025-Q4 Gomoku conversion, multiplayer working
1.0.0 2025-Q4 Initial release (ratel base)

Technical Debt & Issues

Current Issues

  • None blocking — all features work as designed
  • Web client not mobile optimized (desktop-first)
  • AI depth limited to 3 (acceptable for casual play)

Future Refactoring

  • Consider microservices if scaling to 1000+ players
  • Add database layer if implementing accounts
  • Modularize web client further (currently <300 LOC per file)

Success Metrics

Quantitative

  • ✓ 37 unit tests passing (100% game logic)
  • ✓ < 50ms move latency
  • ✓ 0 security vulnerabilities (no CVEs)
  • ✓ < 400ms web client load time
  • ✓ 100+ concurrent player capacity tested

Qualitative

  • ✓ Code is readable and maintainable
  • ✓ New players understand rules quickly
  • ✓ AI provides challenge across difficulties
  • ✓ No major bugs reported
  • ✓ Responsive to community feedback

Decision Log

Decision 1: Java 8 Source/Target (2025-Q4)

Why: Compatibility with older systems, widespread JVM support
Alternative: Java 11 (more modern, but drops older systems)
Impact: Works on Java 8+ (no newer language features needed)

Decision 2: Netty for Server (2025-Q4)

Why: Async, low-latency, battle-tested for game servers
Alternative: Spring Boot (easier, less control)
Impact: High concurrency, responsive to 100+ players

Decision 3: Phaser 3 for Web Client (2026-Q2)

Why: Mature game engine, great 2D support, active community
Alternative: Babylon.js (overkill), vanilla canvas (too much code)
Impact: Professional-quality rendering, quick dev iteration

Decision 4: No Database (Current)

Why: Simplifies deployment, no persistence required for casual play
Alternative: Add PostgreSQL/MongoDB
Impact: Stateless server, easy scaling, but no long-term player data

Decision 5: Dual Protocol Support (2025-Q4)

Why: TCP/Protobuf for efficiency, WebSocket/JSON for web browsers
Alternative: Single protocol
Impact: Supports both CLI and web clients, more flexible


Communication & Feedback

Getting Help

  • Documentation: See ./docs/ directory
  • Code Issues: GitHub Issues
  • Contributions: Pull Requests welcome

Roadmap Feedback

  • Have feature ideas? Open a GitHub Issue with label enhancement
  • Found a bug? Open Issue with label bug
  • Have questions? Use GitHub Discussions (if enabled)

Next Steps (If Continuing)

High Priority:

  1. Implement Tier 1 features (Accounts, Chat, Replay) based on community interest
  2. Monitor server performance in production
  3. Gather user feedback on current features

Medium Priority:

  1. Add alternative board sizes (Tier 2)
  2. Improve AI with alpha-beta pruning (Tier 2)
  3. Mobile optimization (Tier 1)

Low Priority:

  1. Polish features (Tier 3)
  2. Add sound preferences
  3. Tournament mode

  • GitHub Repository: https://github.com/tiennm99/caro
  • Original Framework (Ratel): https://github.com/ainilili/ratel
  • Related Documentation:
    • project-overview-pdr.md — Product requirements
    • system-architecture.md — Technical design
    • code-standards.md — Coding guidelines
    • deployment-guide.md — Installation & operation
    • codebase-summary.md — Code organization

Conclusion

Caro is a stable, feature-complete multiplayer game with professional UI and architecture. All core features (PVP, PVE AI, spectator mode) are implemented and thoroughly tested. The codebase is clean, maintainable, and ready for enhancement or scaling.

Current Status: Production-ready ✓
Recommendation: Deploy with confidence, plan enhancements based on user feedback

For questions or contributions, see GitHub issues or contact maintainer @tiennm99.