Tool for Polyglot opening books?

Discussion of anything and everything relating to chess playing software and machines.

Moderator: Ras

User avatar
PeterO
Posts: 218
Joined: Sun Jul 31, 2016 6:35 pm

Tool for Polyglot opening books?

Post by PeterO »

Hi friends,

I want to create my own Polyglot opening books - .bin format.

1. Is there a SIMPLE tool for WINDOWS 10 I can use?
2. What are the „normal“ settings (ply …) to use?

Thanks for help!!

Peter
User avatar
phhnguyen
Posts: 1526
Joined: Wed Apr 21, 2010 4:58 am
Location: Australia
Full name: Nguyen Hong Pham

Re: Tool for Polyglot opening books?

Post by phhnguyen »

If you mean SIMPLE is to control the tool in a visual way, using mainly the mouse to click and drag-drop you may try Banksia GUI.

Below is the dialog box of BSG just after creating a Polyglot from a 3.45-million-games PGN file. The user just needs to drag-drop the PGN file (or an OCGDB database file) into the input path, enter a path for the book, and select the format Polyglot. He may let all other fields be untouched, using their default values since they are fine for the first time. Then just click on the button "Process" and wait for a bit then all done.

BSG can work very fast because it has a very good PGN parser (it is an open source, we have discussed on a topic about OCGDB) and multi-threats. So far, all older Polyglot tools can't compare with Banksia's one on speed.

All information the user set (paths, parameters) are automatically stored, thus he doesn't need to remember or reset every time. That is good if he wants to try-error to find a good configuration to create a book.

Image

After creating the book, he could view it in the form of a tree, to check or just enjoy by dragging-dropping the book into BSG :D

Image
https://banksiagui.com
The most features chess GUI, based on opensource Banksia - the chess tournament manager
User avatar
PeterO
Posts: 218
Joined: Sun Jul 31, 2016 6:35 pm

Re: Tool for Polyglot opening books?

Post by PeterO »

Hi,

YES I mean control the tool in a visual way, using mainly the mouse to click and drag-drop!!!
This looks realy interesting! :D :D I will definitely give it a try!

I just miss one thing - I can NOT merge 2 opening books with it. :(

Peter
User avatar
phhnguyen
Posts: 1526
Joined: Wed Apr 21, 2010 4:58 am
Location: Australia
Full name: Nguyen Hong Pham

Re: Tool for Polyglot opening books?

Post by phhnguyen »

PeterO wrote: Wed Oct 26, 2022 1:54 pm I just miss one thing - I can NOT merge 2 opening books with it. :(
I used to have the merge feature and it is easy to add it back. However, you should not merge two Polyglot books since that format doesn't store their scale factors (used to scale all weight numbers to fit 2-bytes integers). It means we missed a very important piece of information. If we insist on merging we have to guess or assign some random factors for them but the new one has very little chance to work correctly.

That is one of the reasons we have created a new format OOBS (Open Opening Book Format). All information is stored. You may merge, edit then use them directly or export them to Polyglot ones.
https://banksiagui.com
The most features chess GUI, based on opensource Banksia - the chess tournament manager
User avatar
hgm
Posts: 28426
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Tool for Polyglot opening books?

Post by hgm »

WinBoard can convert PGN files to Polyglot book. Just click 'Save Games to Book' in the File menu after you have loaded the PGN ('Load Game', also in the File menu). But it is not very fast, so for huge PGN files it might not be the best tool.

Also no book merging, though. You can continue to load PGN files and convert those; within one WinBoard session they would just add to the book.
User avatar
PeterO
Posts: 218
Joined: Sun Jul 31, 2016 6:35 pm

Re: Tool for Polyglot opening books?

Post by PeterO »

Hello,

I have decided to use the great Banksia GUI for creating my own polyglot books.

Question: If I want to make a Kasparov opening book: kasparov.bin that plays his openings with white and black that plays the first 10 moves like kasparov.
1. I make a pgn with ALL Kasparov games.
2. I choose 20 plies - because I want it to play 10 moves like Kasparov

3. Which score factors do I use? Win: Draw: Loss: ???? :?:
4. Did I forget something??? :?:

Peter
User avatar
phhnguyen
Posts: 1526
Joined: Wed Apr 21, 2010 4:58 am
Location: Australia
Full name: Nguyen Hong Pham

Re: Tool for Polyglot opening books?

Post by phhnguyen »

A few notes:
- The original Polyglot book builder has a fixed/hard coded factors 2:1:0 for WDL
- Qualities and the number of games are important. A game will be used as a vote for the favourite of an opening. More good games involving could reduce some bad effects from random/bad votes
- You may consider lengths of games too. Typically longer is better. If a game is too short, the quality of the game is a question since it has more change players have an agreement or someone lost by accident, time out. All are not reflexed the quality of the opening. However, if you set the min length too high, the numbers of games may be too small
- Min repeat may need to consider too. A node of a building tree will be stored into the book of its number of games (hit) from that limit. Higher limit will help to reduce bad/random nodes but may reduce the size/cover range of the book too

If you are building a new book for human vs human or computer or for your software to vs another one via Internet (thus you can use the book for yourself and rivals uses their own books), it is worth to invest labour to create a good collection of games and to find a good set of parameters (factors, min length, min repeats). All are an art and you may need try-error. The book viewer as a tree is a very good tool to check, add traps since users can view and edit weights.

However, if you are building a new book for a local chess engine tournament (all engines use only one book), just do whatever from games to parameters. A pair of engines should play an opening twice with their sides changed to make sure fair and all are done.
https://banksiagui.com
The most features chess GUI, based on opensource Banksia - the chess tournament manager