Skip to content

This is a Chess Playing interface which I have created as part of my Robotics Project.

Notifications You must be signed in to change notification settings

AkNegi924/ChessPlayingInterface

Repository files navigation

Chess Playing Interface

A complete chess interface built in Python using the Pygame library. This interface supports three game modes: Player vs Player, Player vs Stockfish, and Player vs Custom Chess Engines. The project includes custom chess engines with distinct evaluation strategies, providing a versatile and competitive chess experience.

Features

  • Graphical User Interface (GUI): A user-friendly interface built with Pygame, displaying an interactive chessboard for seamless gameplay.
  • Game Modes:
    • Player vs Player (PvP): Traditional chess between two human players.
    • Player vs Stockfish: Challenge yourself against the Stockfish chess engine for a competitive experience.
    • Player vs Custom Engine: Play against one of five custom chess engines, each with unique evaluation strategies.
  • Custom Chess Engines:
    • Created 5 engines with distinct evaluation metrics, including mobility, king safety, material balance, pawn structure, and piece-square tables (PST).
    • Engines were compared in a round-robin tournament, with the mobility-based engine achieving a 37.5% win rate, though with a longer evaluation time.

Requirements

  • Python 3.12
  • Pygame: pip install pygame
  • Stockfish chess engine installed and configured

Setup and Installation

  1. Clone this repository:

    git clone https://github.com/AkNegi924/Chess-Playing-Interface.git
    cd Chess-Playing-Interface
  2. Install the required libraries:

    pip install pygame
  3. Configure Stockfish:

    • Download and install the Stockfish chess engine.
    • Ensure the Stockfish executable path is set correctly in the code.

How to Run

  1. Open main.py in a code editor, such as VS Code.
  2. Run main.py to launch the initial window.
  3. Select one of the three game modes:
    • Player vs Player
    • Player vs Stockfish
    • Player vs Custom Engine
  4. After selecting a mode, begin playing!

Screenshots

Game Modes Selection

initialWindow

Chessboard Interface

chess

Performance Comparison

Round-robin tournament results of the custom chess engines. graph

Custom Engines Tournament Results

The custom engines were evaluated based on their unique strategies in a round-robin format. The mobility-based engine showed the highest win rate (37.5%) but required more computational time compared to other engines.

Future Work

  • Optimization of engine performance, especially for the mobility-based engine.
  • Addition of more evaluation functions and combinations for enhanced gameplay.
  • Improved user interface for move suggestions and analysis tools.

License

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


About

This is a Chess Playing interface which I have created as part of my Robotics Project.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published