MyChess
Engine: None Developed: Solo Language: C++, GLSL Graphics API: OpenGL
A chess app and engine built from the ground up using the OpenGL graphics API with C++. Capable of playing local multiplayer sessions as well as playing against the computer.
Check out the Github repository here.
After finishing an online course on OpenGL, I decided to create a chess application as my first OpenGL solo project over the summer.
This application uses the GLFW library for window creation and processing input, irrklang for audio management and the stb_image library for image reading and texture creation.
The computer AI was implemented using a backtracking algorithm and a points value system based on each piece type. After deciding how many moves in the future to look (depth), the computer evaluates all possible positions that can be reached. It then selects the position with the best value for its team and plays the according move.
Currently the speed of this search algorithm is the bottleneck for evaluating the board position. I plan to improve this by implementing a min-max algorithm which would result in the AI not searching paths which lead to positions worse than the current best found position. For more information about this algorithm, see this article from the Chess Programming Wiki. Increasing the speed of the search algorithm would allow for the computer to look more moves into the future in the same amount of time, increasing its move accuracy and adding to the challenge.
Mouse picking was implemented to allow the user to move pieces with the mouse, as well as interacting with any buttons on the screen.
Graphics shaders were coded in GLSL, including vertex and fragment shaders.
OpenGL debugging was carried out using apitrace, an open-source graphics API debugger.
In the future I would like to refactor the search and evaluation functions into async functions, allowing for parallel execution of the search while still rendering the live board to the screen.