Created a chess game in c++ using sfml and stockfish engine, where you can play against the computer.
c++, sfml, stockfish
Used SFML for graphics, which provides a simple interface to the various components of your PC, to ease the development of games and multimedia applications. It is composed of five modules: system, window, graphics, audio ,and network.
How does the computer play?
There are 2 game modes when competing against the computer. One of them uses stockfish, which is one of the best machine learning chess engines, and was connected using python. The other one was implemented by us and described below.
About our game engine
Even though our game engine does not use any related machine learning algorithm, the computer moves the pieces based on a selection algorithm (greedy) as follow:
- Searches for the best piece that can be remove
- Searches the best peace under attack that can be moved
- Searches the position that can lead to check
- Based on an evaluation scheme (determined for each piece, based on the position where that piece should be on the table)
- Moves to a random position
What can be improved?
As mentioned, a related machine learning algorithm would improve the thinking process by far, and that could be accomplished by using a min-max tree which is best described here. But since this is just a colleague project, it's easier to leave it like this (for the moment).
- Buhai Darius - design and functionality
- Ioan Savu Daniel - patterns and actions
- Ciorica Vlad - chess master
See the app on github
Want more details? The app is open source