Chess application developed as a bonus project for Advanced Programming subject at TUM. GUI was implemented using SFML library.
- NEGAMAX (minimax variant) with Alpha-Beta pruning.
- Bit board approach.
- Iterative Deepening.
- Transposition Table (Zobrist Hashing).
- Move Ordering.
- MVV/LVA.
- Piece-Square Tables.
- Mop-up Evaluation.
- Quiescence Search.
- Pawn Shield.
- Opening Book (currently uses 4469 GM games parsed from PGNs: https://www.pgnmentor.com/files.html#openings).
- PERFT tests done on 132 different positions, evaluated to depth 5.
- CMake (minimum required VERSION 3.22) with Ninja generator.
- Compiler:
- MSVC with C++ 17 (Microsoft Visual Studio 2022 (MSVC 14.38.33130)),
- g++ with C++ 17 (gcc 11.4.0).
- SFML and spdlog are automatically fetched with this CMake configuration.
- Open a terminal and run:
call <path to vcvarsall.bat> x64 && cmd- For example run:
call "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" x64 && cmd.
- Alternatively, set up the environment using the Visual Studio Developer Command Prompt:
- Open the
x64 Native Tools Command Prompt. - Ensure the environment is initialized for
x64. If not, runvcvarsall.bat x64.
- Verify that the environment is set up by calling
cl. (This checks if the MSVC compiler is available.)
- Open the CMake project directly with Visual Studio.
Run the following commands in your terminal:
sudo apt-get update
sudo apt-get install \
libxrandr-dev \
libxcursor-dev \
libudev-dev \
libfreetype-dev \
libopenal-dev \
libflac-dev \
libvorbis-dev \
libgl1-mesa-dev \
libegl1-mesa-dev- If there is an issue with
ft2build.h, add the following directories to your$PATH:/usr/include/freetype/usr/include/freetype2
- Configure the project:
cmake --preset <Release/Debug>- Build the project:
cmake --build --preset <Release/Debug> --parallel- These instructions apply to all build configurations (Debug, Release).
- Warnings are treated as errors.
- Warning levels are increased (check
CMakeLists.txtfor compile flags).
- Navigate to the Build Directory:
cd build/<Release/Debug>- Run the Executable:
- On Linux:
./chess_ai- On Windows:
chess_ai.exe - Logging
- The logger file is created in the build directory.
Run tests with the following command:
cd build/<Release/Debug>
ctest -R ^<unit_tests/performance_tests>$- Use camel case.
- Use
.clang-formatto format code. - Set auto format on.
clang-formatminimum required version14.0.0.
- General: https://www.chessprogramming.org/Main_Page
- Overview of the minimax engine: https://www.youtube.com/watch?v=w4FFX_otR-4&list=LL&index=2&t=313s
- Bit Boards: https://ameye.dev/notes/chess-engine/
