1

Chess AI - Still Naive Bot

A simple chess AI implementing the Min-Max algorithm with evaluation functions, capable of human vs bot and bot vs bot modes.

Chess AI - Still Naive Bot

Overview

Chess AI - Still Naive Bot is a simple chess AI implementing the Min-Max algorithm, allowing users to play against the bot or watch a match between the bot and Stockfish. While the bot’s strategies are limited, it provides a foundation for understanding AI in chess. This project also explores Reinforcement Learning limitations in training a more advanced bot.

Key Features

  • Game Modes:

    • Human vs Bot: Players can play against the Min-Max AI bot.
    • Stockfish vs Bot: Watch a game between the Min-Max bot and Stockfish.
  • Min-Max Algorithm with Evaluation Functions:

    • The AI uses Min-Max for decision-making, evaluating moves based on a scoring function.
  • Exploration of RL Limitations:

    • Attempts to improve the bot with Q-Learning, AlphaGo Zero principles, and reward-based training faced significant computational limitations, demonstrating the challenges in creating a competitive chess bot without advanced hardware.

Prerequisites

Ensure Python is installed, along with the following packages:

  • pygame for game display
  • python-chess for chessboard and move handling
  • Stockfish for Stockfish vs Bot mode

Installation

  1. Install Python: Python Downloads
  2. Install Packages:
    pip install pygame
    pip install python-chess
    
  3. Download Stockfish: Stockfish Download

How to Run

  • Human vs Bot:

    • Navigate to HumanVSbot.py and uncomment the last two lines.
    • Run the program in an IDE or terminal:
      python HumanVSbot.py
      
  • Stockfish vs Bot:

    • Uncomment the last two lines in StockfishVSbot.py and update the Stockfish file path in Stockfish_FilePath.py.
    • Run the program in an IDE or terminal:
      python StockfishVSbot.py
      

Results

  • Game Analysis:

    • screenshots/game_0_plot.png shows the difference in scores over time, highlighting weaknesses in Min-Max.
    • numberof_moves_plot.png depicts game length across 50 consecutive games, with an average of 38.92 moves per game.
  • RL Challenges:

    • Attempts with AlphaGo Zero and Q-Learning revealed the computational intensity required for high-level AI training.

Documentation


This project demonstrates foundational knowledge in AI for games, the Min-Max algorithm, and the challenges of implementing Reinforcement Learning for chess without advanced resources.