Skip to content

mleem97/RushBot

 
 

Repository files navigation

RushBot 🎮🤖

20250803_2330_RushBot App Logo_simple_compose_01k1rxd9atf21b3v5gkrpyxt0f RushBot is an advanced Python 3.13-based automation bot for Rush Royale that combines computer vision, machine learning, and Android device control. Using OpenCV for real-time game state recognition and scikit-learn for strategic decision-making, the bot can autonomously play Rush Royale on Android devices or emulators. Built with a robust architecture featuring ADB integration for device communication, advanced screenshot processing, and comprehensive analytics tracking, RushBot represents the evolution of Rush Royale automation - building upon the foundational work of AxelBjork, mleem97, and Frikadellental's previous implementations while pushing the boundaries with modern AI techniques and reliable cross-platform compatibility.

🔗 Project History & Related Work

This project builds upon the foundation of several Rush Royale bot implementations:

This repository represents the next evolution, focusing on advanced reinforcement learning techniques and autonomous gameplay.

🚀 Features

  • Computer Vision Integration: Advanced OpenCV-based image recognition for game state analysis
  • Android Device Control: Direct communication with Android devices via ADB
  • Machine Learning Analytics: Scikit-learn powered pattern recognition and decision making
  • Real-time Screenshot Processing: Fast image capture and analysis pipeline
  • Data-Driven Insights: Comprehensive gameplay analytics and performance tracking
  • Cross-Platform Compatibility: Works with Android emulators (physical devices are not tested yet)
  • Development Tools: Jupyter notebook integration for analysis and debugging

🏗️ Architecture

Computer Vision Pipeline

  • OpenCV Integration: Advanced image processing for game state recognition
  • Template Matching: Precise identification of game elements and UI components
  • Color Analysis: Strategic decision making based on visual game information
  • Screenshot Processing: Optimized real-time image capture and analysis

Machine Learning Components

  • Scikit-learn Models: Pattern recognition for optimal gameplay strategies
  • Data Analytics: Performance tracking and strategic improvement recommendations
  • Feature Extraction: Automated identification of key game state indicators

Device Communication

  • ADB Integration: Direct Android device control and automation
  • Cross-Platform Support: Compatible with emulators and physical devices
  • Reliable Input Simulation: Precise touch and gesture automation

📋 Requirements

  • Python 3.13+
  • OpenCV 4.10+
  • NumPy 1.24+
  • Pandas 2.0+
  • Scikit-learn 1.5+
  • Pure Python ADB
  • Pillow 10.0+
  • Matplotlib 3.7+

🛠️ Installation

  1. Clone the repository:
git clone https://github.com/yourusername/rushbot.git
cd rushbot
  1. Create a virtual environment:
python -m venv rushbot_env
source rushbot_env/bin/activate  # On Windows: rushbot_env\Scripts\activate
  1. Install dependencies:
pip install -r requirements.txt

🎯 Usage

Training the Bot

python main.py --mode train --device emulator-5554

Running the Bot

python main.py --mode play --device 

Analysis Mode

python analyze.py --log-file gameplay_data.json

📊 Performance Metrics

The bot tracks various performance indicators:

  • Win rate progression over time
  • Average game completion time
  • Decision accuracy and response time
  • Screenshot processing efficiency
  • ADB command success rates
  • Pattern recognition confidence scores

🔧 Configuration

Customize bot behavior through config.ini:

[DEVICE]
device_id = emulator-5554
screenshot_method = adb
resolution = 1920x1080

[GAMEPLAY]
action_delay = 0.5
confidence_threshold = 0.8
max_game_duration = 300

[ANALYSIS]
save_screenshots = true
log_level = INFO
data_retention_days = 30

📈 Development Progress

The bot development includes:

  1. Setup Phase: Device connection and screenshot capture implementation
  2. Vision Development: Template matching and game state recognition
  3. Automation: Touch input simulation and game interaction
  4. Analytics Integration: Performance tracking and data analysis
  5. Optimization: Speed improvements and reliability enhancements

🤝 Contributing

We welcome contributions! Please see our Contributing Guidelines for details.

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

📝 License

This project is licensed under the MIT License - see the LICENSE file for details.

⚠️ Disclaimer

This bot is created for educational and research purposes. Please ensure compliance with Rush Royale's Terms of Service when using automated tools.

🙏 Acknowledgments

  • AxelBjork for the original Rush Royale bot implementation
  • mleem97 for improving and fixing the original codebase
  • Frikadellental for the AI-focused redesign and modern approach
  • Rush Royale developers for creating an engaging strategic game
  • OpenAI and DeepMind for pioneering reinforcement learning techniques
  • The open-source community for providing essential ML libraries

Releases

No releases published

Contributors

Languages

  • Python 66.6%
  • Jupyter Notebook 29.2%
  • Batchfile 4.2%