Aloril got ICCF database files for the purpose of displaying data in tcec and suggested it be included in the tcecevalbot. You can ask him for the link to the data.
This PR introduces a database proxy for interaction with existing chess_pos_db compatibile databases. ChessPosDbQueryCommand encapsulates the database proxy with a constantly running chess_pos_db.exe in the background as a database service (closed automatically on graceful exit). Queries are performed over TCP with the connection parameters passed to ChessPosDbQueryCommand on creation. The settings can be specified per command instance, this allows multiple databases to operate in parallel. Currently includes settings for the ICCF database in appsettings.json with the localhost ip, path left empty, and a default port. A server should disallow remote access to the ports used by chess_pos_db.exe as it's not secure enough and is prone to DoS attacks.
The second part cannot be contained in this PR and involves creating a chess_pos_db database from .pgn files. This either has to be performed on the server or copied from a different machine. This is easiest done with chess_pos_db_gui (required v0.2.2 release here in a graphical user interface.
To create a database from ICCF .pgn files one has to:
run chess_pos_db_gui.exe from the release linked above
navigate to Database -> Create
Select an empty destination folder
Select schema (db_delta_smeared is best here)
In the "Engine" tab add all .pgn files with ICCF games.
Hit "Create".
Wait for completion
Close everything.
The process should take less than a minute and create some files in the specified destination directory with ~1GB in total size. The path to this directory has to be set in appsettings.json's property "IccfDatabasePath". It is best if the database sits on an SDD, otherwise individual queries can take about a second.
The !iccf command currently is very bare bones. It outputs +=- for the root along with white, black, result and date. Also displays 3 children moves with the highest count along with +=-. Much more is possible with this database server. For example moves that never were played but result in transpositions could be highlighted differently. Average elo delta between the players in a given positions could be displayed or taken into account for more ordering. It's also possible to change it to only display continuations (without transpositions).
Aloril got ICCF database files for the purpose of displaying data in tcec and suggested it be included in the tcecevalbot. You can ask him for the link to the data.
This PR introduces a database proxy for interaction with existing chess_pos_db compatibile databases.
ChessPosDbQueryCommand
encapsulates the database proxy with a constantly running chess_pos_db.exe in the background as a database service (closed automatically on graceful exit). Queries are performed over TCP with the connection parameters passed toChessPosDbQueryCommand
on creation. The settings can be specified per command instance, this allows multiple databases to operate in parallel. Currently includes settings for the ICCF database inappsettings.json
with the localhost ip, path left empty, and a default port. A server should disallow remote access to the ports used by chess_pos_db.exe as it's not secure enough and is prone to DoS attacks.The second part cannot be contained in this PR and involves creating a chess_pos_db database from .pgn files. This either has to be performed on the server or copied from a different machine. This is easiest done with chess_pos_db_gui (required v0.2.2 release here in a graphical user interface.
To create a database from ICCF .pgn files one has to:
The process should take less than a minute and create some files in the specified destination directory with ~1GB in total size. The path to this directory has to be set in
appsettings.json
's property "IccfDatabasePath". It is best if the database sits on an SDD, otherwise individual queries can take about a second.The !iccf command currently is very bare bones. It outputs +=- for the root along with white, black, result and date. Also displays 3 children moves with the highest count along with +=-. Much more is possible with this database server. For example moves that never were played but result in transpositions could be highlighted differently. Average elo delta between the players in a given positions could be displayed or taken into account for more ordering. It's also possible to change it to only display continuations (without transpositions).