Overview

A UCI chess bot was created using Python's chess library for the InnovateX Hackathon. We have taken inspiration from game theory videos and implemented the playing algorithm using a negamax algorithm with alpha and beta pruning to a max depth of 4. A .exe file build is available to be tested against real players using Arena GUI.

Challenges Faced

We had to learn how to work with UCI and also learn a new game theory algorithm called Negamax. Implementing this after learning and making it bug-free was a harder challenge during our development. Moreover, at the start of the project, we were using depth 2 and it was drawing the game with its threefold repetition with knight and rook moves as at that time we didn't implement the positional scoring mechanism.

After we started to save the transposition dictionaries and merge them at the start of each game it went over 100MB with each depth increase we had to follow a different procedure to add it to the git hub which used GitHub large file storage which we didn't know how to use at that time.

Also, it was freezing after it realised it was going for its inevitable loss by checkmate we had to force the bot the choose a move from valid moves randomly.

Inspirations

Mahoraga: A character from a show called Jujutsu Kaisen who adapts to any challenges it faces.

Implementation

We ended up using Python since it was a language we were both comfortable working with and the Python chess library made writing the engine a much easier task. We first used a chess bot to move random moves from the available valid moves and then we went for the MinMax algorithm and then NegaMax after that we were more focused on how to improve the processing time because even if we improve the evaluation of the moves if we cannot go more into depth then evaluation is only halfhearted. We were able to increase the depth from 2 to 5 but at the moment it has a decent processing speed at depth 4 so we decided to keep it at that level for now.

Built With

Share this project:

Updates