Skip to content

This Game is made up from scratch . This is 1 Player and 2 Player Game . The AI for this Game is made by NegMax algo.

Notifications You must be signed in to change notification settings

siddheshsingh26/ChessAI-Game

Repository files navigation

ChessAI-Game

An amazing 1P Chess Game.The Artificial Intelligence Algorithm used or Algorithm used for Engine is "NegMax Algorithm".

📝 Description

This is a Chess Game with Two variations.

  • Player vs Player
  • Player vs Computer

Summary

ChessAI is game in which 1P game works on NegMax algorithm .In this game one can set the variaton he/she want to play.The Difficulty of the game varies from 1 to 4 depending on the PC of user.The difficulty is basically the depth or how much moves Ahead does the AI calculte the possiblities .AI make a move on the basis of Net Score.This score is Calculated by giving a particular value to each piece and on the Position of the piece located at on chess board.Position Score of that square is different for different pieces .As we know all pieces should move towards the center ,so center square are given more points and so on.

This was a short summary of working of chess Game.

Some Extra Features

  • Press z to undo a move.
  • Press r to reset the game.

NegMax Algorithm Flowchart

🖼 Screenshots

Board

Mid Game

Oposo Move

Castling

All Possible move of a piece

🤖 Technology Stack

  • Python 3.10.5
  • pygame 2.1.2

Resources

🔮Future Work

  • Creating a Board.
  • Positioning Pieces.
  • Legal Piece Movements.
  • En-passant & Castle Moves.
  • Two Player Game.
  • One Player Game using NegMax Algorithm.
  • Stalemate on 3 repeated moves or 50 moves without capture/pawn advancement.
  • More Efficient(Depth > 6).
  • Making App & Website For Playing.

How to change Difficulty & selection of type of game

If you have a powerful/weak computer, try upping/lowering the depth parameter of the NegMax Algorithm. To do this, navigate to the "chessAI.py" file in the project directory, and locate the Variable name "DEPTH". Once there, you can increase/decrease the range as per your PC. I Would recommend to Play till Difficulty level or depth 4 , Max to Max 5. As we level increase the Game decome slower and slower.

To select the type of game you should navigate "chessMainBoard.py" line number 50.

🛠️ Project Setup

  1. Install Python:- To Install Python.
  2. Install Pygame:- To install Pygame, open the command prompt and give the command as shown below:
  pip install pygame
  1. Clone the repository
  git clone https://github.com/siddheshsingh26/ChessAI-Game.git
  1. Go to the project directory
  cd ChessAI-Game
  1. Start the Game
   python .\chessMainBoard.py

Project Timeline

gantt
        Chess Board:a, 2022-08-14, 1w
        Pieces movements: b,after a,10d
        Legal Piece Moves: c, after b, 9d
        Animations & Bug Fixing: d , after c , 10d
        Chess AI: e , 2022-09-17 , 10d

Loading

👩‍💻Authors

About

This Game is made up from scratch . This is 1 Player and 2 Player Game . The AI for this Game is made by NegMax algo.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages