How to Make a .BIN opening book (for non programmers?)

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

Moderators: hgm, Rebel, chrisw

BrendanJNorman
Posts: 2526
Joined: Mon Feb 08, 2016 12:43 am
Full name: Brendan J Norman

How to Make a .BIN opening book (for non programmers?)

Post by BrendanJNorman »

Hey guys,

Wondering if such a tutorial or click and save type of software can accomplish this?

I want to make dedicated opening books based on historical players' repertoires.

Thanks for any help. :lol:

P.S Condescending "don't you know anything?" type of answers not welcome.
User avatar
hgm
Posts: 27789
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: How to Make a .BIN opening book (for non programmers?)

Post by hgm »

If you have a file with all the lines you want to be in the book, you can load it in WinBoard, and then select "Save Games to Book" from the File menu. The book will be created with the name you specified for the GUI book (in the Common Engine Options dialog). So you better set that to a name that does not exist yet, or the existing book will be overwritten (if you ignore a warning). In the Common Engine options you can also specify the 'Book Depth', i.e. how many moves at the start of the games should be considered.

The 'Save Games to Book" action adds the currently selected games (by default all games, but you can select sub-sets by text matching of the title line, or through position search) to its internal buffer before saving the latter on the file, and it only clears the buffer at the start of a session. So you can combine games from several PGN files by just repeating the procedure (and ignoring the overwrite warning you get after the first time).

The WinBoard game parser is not super fast, so for making extremely large books (millions of games) there probably exist more convenient tools.
BrendanJNorman
Posts: 2526
Joined: Mon Feb 08, 2016 12:43 am
Full name: Brendan J Norman

Re: How to Make a .BIN opening book (for non programmers?)

Post by BrendanJNorman »

hgm wrote:If you have a file with all the lines you want to be in the book, you can load it in WinBoard, and then select "Save Games to Book" from the File menu. The book will be created with the name you specified for the GUI book (in the Common Engine Options dialog). So you better set that to a name that does not exist yet, or the existing book will be overwritten (if you ignore a warning). In the Common Engine options you can also specify the 'Book Depth', i.e. how many moves at the start of the games should be considered.

The 'Save Games to Book" action adds the currently selected games (by default all games, but you can select sub-sets by text matching of the title line, or through position search) to its internal buffer before saving the latter on the file, and it only clears the buffer at the start of a session. So you can combine games from several PGN files by just repeating the procedure (and ignoring the overwrite warning you get after the first time).

The WinBoard game parser is not super fast, so for making extremely large books (millions of games) there probably exist more convenient tools.
Thanks that sounds useful regardless.

Any idea how to differentiate between white and black repertoires in the book?
User avatar
hgm
Posts: 27789
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: How to Make a .BIN opening book (for non programmers?)

Post by hgm »

In Polyglot books the weight the moves get is the number of half-points scored with them, and moves with zero weight are not stored in the book. So to make a book with only white moves you should use a set of games all won by white.

Note that you can select all white wins as a subset by making sure the game result is selected as one of the tags presented in Game List (using the View -> Game List Tags dialog), and, with the 'Filter' entry of the Game List, filter on the text '1-0'. Then only white wins from the currently loaded PGN file will be shown in the Game List, and saved in the book. For the black repertoire you then similarly filter on '0-1'.

Note you can always change the weights afterwards with the aid of the Edit Book dialog, to tune the frequecy with which the various main opening lines will be played.
BrendanJNorman
Posts: 2526
Joined: Mon Feb 08, 2016 12:43 am
Full name: Brendan J Norman

Re: How to Make a .BIN opening book (for non programmers?)

Post by BrendanJNorman »

hgm wrote:In Polyglot books the weight the moves get is the number of half-points scored with them, and moves with zero weight are not stored in the book. So to make a book with only white moves you should use a set of games all won by white.

Note that you can select all white wins as a subset by making sure the game result is selected as one of the tags presented in Game List (using the View -> Game List Tags dialog), and, with the 'Filter' entry of the Game List, filter on the text '1-0'. Then only white wins from the currently loaded PGN file will be shown in the Game List, and saved in the book. For the black repertoire you then similarly filter on '0-1'.

Note you can always change the weights afterwards with the aid of the Edit Book dialog, to tune the frequecy with which the various main opening lines will be played.
Ahh interesting, that helps. Thanks.
User avatar
Steve Maughan
Posts: 1221
Joined: Wed Mar 08, 2006 8:28 pm
Location: Florida, USA

Re: How to Make a .BIN opening book (for non programmers?)

Post by Steve Maughan »

I did a video a couple of years ago:

https://www.youtube.com/watch?v=rskcUNoirPU

Hope it helps,

Steve
http://www.chessprogramming.net - Maverick Chess Engine
Ferdy
Posts: 4833
Joined: Sun Aug 10, 2008 3:15 pm
Location: Philippines

Re: How to Make a .BIN opening book (for non programmers?)

Post by Ferdy »

I am trying to create one because even me is also tired of that command line :).

No need to do preliminary filtering by extracting wins of a particular player by white and black sides,
and no need to create white and black bin books separately and then run again to merge the two books to get a single polyglot bin book.
Now all will be done automatically.

Image
BrendanJNorman
Posts: 2526
Joined: Mon Feb 08, 2016 12:43 am
Full name: Brendan J Norman

Re: How to Make a .BIN opening book (for non programmers?)

Post by BrendanJNorman »

Ferdy wrote:I am trying to create one because even me is also tired of that command line :).

No need to do preliminary filtering by extracting wins of a particular player by white and black sides,
and no need to create white and black bin books separately and then run again to merge the two books to get a single polyglot bin book.
Now all will be done automatically.

Image
Oh my! That's exactly what I need. Care to share buddy? :)
User avatar
hgm
Posts: 27789
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: How to Make a .BIN opening book (for non programmers?)

Post by hgm »

Ferdy wrote:I am trying to create one because even me is also tired of that command line :).
Well, WinBoard is not exactly command line.
No need to do preliminary filtering by extracting wins of a particular player by white and black sides,
and no need to create white and black bin books separately and then run again to merge the two books to get a single polyglot bin book.
Now all will be done automatically.
There is never any need to do that if your PGN file contains both the white and the black games. Both Polyglot and WinBoard convert the entire file. Creating books for both colors separately is only needed when you want the repertoires to come from different PGN files.
BrendanJNorman
Posts: 2526
Joined: Mon Feb 08, 2016 12:43 am
Full name: Brendan J Norman

Re: How to Make a .BIN opening book (for non programmers?)

Post by BrendanJNorman »

Steve Maughan wrote:I did a video a couple of years ago:

https://www.youtube.com/watch?v=rskcUNoirPU

Hope it helps,

Steve
I actually watched your video about a year ago before making a .bin book, so thanks mate!

But I was wondering (hoping) that there was a simpler way to do it by now. :?