This project implements a Gomoku AI ("Brain") in C++ designed to communicate with the liskvork game manager. It also includes a Python visualizer for real-time game monitoring.
src/main.cpp: The C++ source code for your Gomoku AI.Makefile: Used to build the C++ AI.pbrain-gomoku-ai: The compiled executable of your AI.liskvork-x86_64-linux-0.6.1: Theliskvorkgame manager (pre-compiled binary).config.ini: Configuration file forliskvork.visualizer.py: A Python script to visualize the game in real-time.requirements.txt: Lists Python dependencies (currently none beyond standard library).board.log: Log file generated byliskvorkcontaining game states.
- C++ Compiler:
g++(or compatible) for building the AI. - make: For using the Makefile.
- Python 3: For running the visualizer.
tkintermodule (usually included with Python).
Navigate to the project root and compile your C++ AI:
make reThis will create an executable named pbrain-gomoku-ai in the project root.
The config.ini file needs to be updated to tell liskvork where to find your AI. The provided setup assumes your AI executable (pbrain-gomoku-ai) is in the project root.
The path for player1 and player2 in config.ini should point to your compiled AI:
[player1]
path=./pbrain-gomoku-ai
[player2]
path=./pbrain-gomoku-aiThe board_color setting should be false for the visualizer to work correctly:
[log]
board_file=./board.log
board_color=falseThese changes have already been applied by the AI.
To run a game between two instances of your AI using liskvork:
-
Start
liskvork(Manager): It's recommended to clear theboard.logfile before each new game to avoid mixing logs from different sessions.rm -f board.log && ./liskvork-x86_64-linux-0.6.1If
liskvork-x86_64-linux-0.6.1is not executable, runchmod +x ./liskvork-x86_64-linux-0.6.1first. -
Start the Visualizer: In a separate terminal, navigate to the project root and run the Python visualizer:
python3 visualizer.py
The visualizer window will appear, displaying the game in real-time. You can use the "Live (Auto-follow)" checkbox to toggle between real-time updates and manual navigation through game history using the "Prev", "Next" buttons, or the slider.
- The
board.logfile is continuously updated byliskvork. - Your C++ AI can send debug messages using
std::cout << "DEBUG Your message" << std::endl;. These messages will appear in the terminal whereliskvorkis running. - Use the visualizer's replay features (
Prev,Next, slider) to analyze specific moves or game states.
Next Step: Implementing the Minimax algorithm and evaluation function in src/main.cpp to make your AI smarter.