Xiangiqgame
AI engine for Xiangqi
|
This project consists of a C++ Artificial Intelligence (AI) engine and a Python outer layer for the board game Xiangqi (also known as Chinese chess) and supports playing games in AI vs. AI, AI vs. Human, and Human vs. Human modes.
The AI utilizes the Minimax algorithm enhanced by Alpha-Beta pruning to select moves. A transposition table based on Zobrist hashing is implemented for storage / retrieval of board state evaulation results and prevents re-calculation of previously seen board states.
The AI engine is designed around a plug-in architecture, enabling easy integration and swapping of components without affecting the core functionality. Major components are isolated from each other by interface classes that employ the Curiously Recurring Template Pattern (CRTP). This approach allows for compile time polymorphism and avoids the runtime overhead associated with more traditional virtual class interfaces.
The C++ core is integrated with an outer Python layer using pybind11. The Python layer:
This project prioritizes the ability to explore inner-workings of the AI engine with flexible engine settings and in-game data collection.