Chess tournament manager, standard C++ 11
Banksia (the name after an Australian native wildflowers) is an open source tournament manager for chess engines, written in C++11. It can be compiled and run on some popular platforms such as Windows, macOS, Linux.
The project is an attempt to fulfil my dream about creating a chess tournament manager: small, fast, portable, easy to use, easy to integrate to other systems, resumable, able to automatically generate all configurations, files which are needed for tournaments.
Basically from nothing, a user can configure automatically within few minutes then he can start running a total new tournament.
About design: To manage engines, games and the complicated events / relationships between them, the app uses a timer with few c++ callback functions. I believe it is one of the simplest methods. The code is not hard for programmers to follow, understand, maintain and modify.
(Banksia)
There are some project files for building by Visual Studio or Xcode.
If you want to compile those code manually, use g++ to compile and link as below:
g++ -std=c++11 -c ../src/3rdparty/process/process.cpp ../src/3rdparty/process/process_unix.cpp -O2 -DNDEBUG
g++ -std=c++11 -c ../src/3rdparty/json/*.cpp -O2 -DNDEBUG
g++ -std=c++11 -c ../src/3rdparty/fathom/*.cpp -O2 -DNDEBUG
g++ -std=c++11 -c ../src/base/*.cpp -O2 -DNDEBUG
g++ -std=c++11 -c ../src/chess/*.cpp -O2 -DNDEBUG
g++ -std=c++11 -c ../src/game/*.cpp -O2 -DNDEBUG
g++ -std=c++11 -c ../src/*.cpp -O2 -DNDEBUG
g++ -o banksia *.o
In MS Windows, the first line needed to change to:
g++ -std=c++11 -c ../src/3rdparty/process/process.cpp ../src/3rdparty/process/process_win.cpp -O2 -DNDEBUG
You can also use CMake (at least version 3.7 is required) to build banksia:
mkdir build
cd build
cmake ..
make -j4
Banksia requires two JSON files to work. Almost all fields in those files are self-explanation via meanings of their names. If you generate them automatically (read next sections) they may have some fields "tips" as short guides how to use, which values to fill.
Configuration of each engine may include options thus users can control all details.
Some important fields:
type: type of tournament
time control: second is the unit for all value fields. You can use fractions (such as 1.5 as 1.5 second) for being more precision.
players: names of players will participate in the tournament. They must be listed in JSON file 1.
"players" : [ "stockfish", "gaviota", "fruit" ]
Run the app in a console as bellow:
banksia -jsonpath c:\tour\tour.json
There are two JSON files come with the project as an example.
When working, the app may display some information into screen as well as saving into some log files (controlled by tournament's JSON file 2):
Bellow is the screen of a tournament between 3 chess engines:
If Banksia runs with profile mode (for Windows only), it could provide some useful information about engines such as memory and cpu usages, number of threads.
Banksia can resume a tournament from where it stopped. That function can be enabled/disabled via field "resumable" in control JSON file (default is on). When playing Banksia will store all necessary information into file playing.json, save it in current working folder then uses it to resume the tournament.
If you don't want to resume the previous uncompleted-tournament, type "no" when Banksia asks, or add parameter -no to the command line, or delete that file.
You may also create a total new tournament as your desire (you may change openings, time control...) or even generate it completely for fully controlling.
A chess tournament may have tens or even hundreds of chess engines. Each engine has name, command line, working folder and may have tens parameters. Any wrong in data may cause engines to refuse to run, crash or run with wrong performances. However, writing down manually all information into a command line and/or some JSON files is so boring, hard job and easy to make mistakes (from my experience, it is not easy to find and fix those mistakes). Banksia itself has tens of parameters to control everything of matches such as type, time control, concurrency, opening... and even those parameters can explain meaning themselves, users need to consume its documents to know about them.
Depend on experience, it may take from hours to days to create a runnable configuration for a new tournament. Furthermore, new engines may frequently add or change parameters without notice to users and make the situation worse.
Banksia can help to solve the above problems by generating/updating automatically all data needed for a tournament. If the old data exists, Banksia can update it without erasing nor modifying non-involving information. Thus users can update frequently their data.
What a user should do to generate or update JSON files:
For example:
banksia -u -c 4 -d c:\allenginefolder
Banksia scans that given folder, including subfolder for all executable files, then runs them to detect if they are chess engines, what their chess protocols and options are. Banksia can run and test concurrently (the parameter -c 4 means that is concurrency of 4) to speed up the process (for a tournament within 20 engines, 4 concurrencies all may take about 1 - 5 minutes). All information is saved or updated into two key JSON files (if their paths are not specified, they will be created in the current working folder).
If users don't want Banksia to scan (or engines are not scannable, or located in different folders/drivers) or run not-involving executable files, they can create a simple and short JSON file (file engines.json) with commands of engines they need (and don't use parameter -d). Banksia will verify and fill in all other information.
[
{ "command" : "d:/stockfish/stockfish.exe" },
{ "command" : "c:/match/crafty25.3" }
]
Right after generating JSON files, users can start their tournaments:
banksia -t c:\tour.json
Of course, users can edit those JSON files such as removing redundant, unused fields, re-order them to be easier to read! Some data fields are written down in empty forms (such as opening book folders) and need to fill in.
Tips:
If you download and use Banksia you already help me. All bug reports, suggestions, contributions are more than welcome!
Below are some features/functions we need someone helps too:
I started working on a graphic user interface app based on Banksia. It can be downloaed at https://banksiagui.com
All codes and data in the folder 3rdparty are 3rd party libraries, copyrighted by them and under their terms of use. Banksia code and data are released under the GPLv3+ license.
Banksia was written by Nguyen Hong Pham (axchess at yahoo dot com).