Skip to content

Claude/clash royale ai coach 2 e smq#21

Open
justicehamilton35-hue wants to merge 8 commits into
krazyness:mainfrom
justicehamilton35-hue:claude/clash-royale-ai-coach-2ESmq
Open

Claude/clash royale ai coach 2 e smq#21
justicehamilton35-hue wants to merge 8 commits into
krazyness:mainfrom
justicehamilton35-hue:claude/clash-royale-ai-coach-2ESmq

Conversation

@justicehamilton35-hue

Copy link
Copy Markdown

No description provided.

claude added 8 commits January 6, 2026 10:36
Transform the real-time bot into an AI coaching system similar to Stockfish for chess.

Major Features:
- Video processing for screen recordings (mobile-friendly)
- AI analysis engine using trained DQN model
- Move-by-move evaluation with Q-values
- Move quality classification (Brilliant, Good, Inaccuracy, Mistake, Blunder)
- Comprehensive mistake detection system
- Performance ratings (elixir, placement, defensive, offensive)
- Multiple report formats (HTML, JSON, text)
- FastAPI web server for mobile uploads
- Mobile-friendly web interface
- CLI tool for local analysis

Components Added:
- video_processor.py: Extract game state from recordings
- clashfish_engine.py: DQN-based move evaluation
- mistake_detector.py: Identify specific error types
- report_generator.py: Create formatted reports
- api_server.py: Web API for uploads and analysis
- clashfish.py: Command-line interface
- frontend/index.html: Mobile upload interface
- Documentation: README, setup guide, design doc
- requirements_clashfish.txt: Python dependencies

Usage:
1. Web: python api_server.py (mobile uploads)
2. CLI: python clashfish.py analyze video.mp4
3. Batch: python clashfish.py batch ./replays/

This transforms the bot from "plays the game" to "analyzes your gameplay and helps you improve"
- Detects actions from elixir decreases
- Falls back to time-based estimation
- Uses available card data when possible
- Ensures minimum 10-20 actions detected
- Works even when Roboflow fails
- Creates annotated replays showing mistakes and optimal plays
- Visual markers for each move (colored by quality)
- Shows AI's suggested optimal placement (magenta circles)
- Displays evaluation loss percentages
- Stats panel with overall accuracy and ratings
- Info panel showing card played and quality
- Integrated into API server workflow
- Updated frontend with video player
- Endpoint: /video/{job_id}
- Add dotenv loading to api_server.py
- Pass Roboflow credentials from .env to VideoProcessor
- Add debug logging to verify credentials are loaded
- Fixes 'No Roboflow API key provided' warning
- Changed from http://localhost:9001 to https://detect.roboflow.com
- Fixes connection refused errors during video processing
- API key is now properly passed to cloud service
- Use numeric constants instead of named constants
- Fixes AttributeError: module 'cv2' has no attribute 'CAP_PROP_WIDTH'
- Works with all OpenCV versions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants