How to make an opening book like performance.bin

Programming Topics (Computer Chess) and technical aspects as test techniques, book building, program tuning etc

Moderator: Andres Valverde

How to make an opening book like performance.bin

Postby ChessKnight » 03 Jan 2009, 04:04

I have a good collections of PGN files.

How can I make an opening book like performance.bin out of these PGN files to be used with winboard compatible chess engines?

Is there any utility available?
ChessKnight
 
Posts: 48
Joined: 26 Dec 2008, 06:37

Re: How to make an opening book like performance.bin

Postby Marc Lacrosse » 03 Jan 2009, 09:55

ChessKnight wrote:I have a good collections of PGN files.

How can I make an opening book like performance.bin out of these PGN files to be used with winboard compatible chess engines?

Is there any utility available?


Polyglot.exe has all required book-making functions
They are deteiled near the end of the excellent readme file that comes with it. You should have a look :-)

The most simple way is to do something like :

Code: Select all
polyglot.exe make-book -pgn MyGameCollection.pgn -max-ply 50 -min-game 3 -min-score 30 -bin MyPolyglotBook.bin


This means that your book :
- goes 50 plies deep
- will only include moves that have been played at least three times in the underlying PGN base.
- will only include moves leading to a global score superior to 30% for the side to move.

When there are several candidate moves fulfilling these conditions for a given position, polyglot will choose more often those that had better results and/or were played more often.

This is only the basis : a book made with these parameters should be good (if the choice of games is good) but not excellent.

Then there is the most powerful book-making feature of Polygot : the possibility to combine several elementary books made with different parameters into one (supposedly) better book through the book-merge feature.

Performance.bin was made from six such books.

Then you may tune the book by hand, changing the "weight" of candidate moves in the SCID database program. SCID does not allow to add a new move in a book. In case you wish to, you may use the ad hoc utility by Michel Van den Bergh (see his posts mainly on the Winboard forum and also on the CCC).

Marc
Marc Lacrosse
 
Posts: 116
Joined: 29 Jan 2005, 09:04
Location: Belgium

Re: How to make an opening book like performance.bin

Postby ChessKnight » 04 Jan 2009, 06:59

Marc Lacrosse

Thanks for information.

I guess, I have to work a lot for selections of PGN files before making a book.

Tks n reg
ChessKnight
 
Posts: 48
Joined: 26 Dec 2008, 06:37

Re: How to make an opening book like performance.bin

Postby ChessKnight » 06 Jan 2009, 04:44

Hi Marc Lacrosse

According to your suggestion, i have started organizing PGN files.
I have following questions for you.

1) The pgn for draw games should be excluded?
2) in the code given by you

The most simple way is to do something like :
Code:
polyglot.exe make-book -pgn MyGameCollection.pgn -max-ply 50 -min-game 3 -min-score 30 -bin MyPolyglotBook.bin
Can you explain min-game and min-score parameters?
What are the best settings for above command?
3) I have made a tiny book just to test above mentioned code. The code worked fine.
What is the exact procedure for tuning an opening book?
4) Is there any easiest way to check if opening book created is enough good?
5) When a fresh newly made opening is linked with any chess engine is there certain amount of games needs to played to auto-tune opening book?
6) Up to how many initial moves normally a chess engine depends on an opening book?

Thanking you for your time and assitance.
ChessKnight
 
Posts: 48
Joined: 26 Dec 2008, 06:37

Re: How to make an opening book like performance.bin

Postby Marc Lacrosse » 10 Jan 2009, 13:33

ChessKnight wrote:Hi Marc Lacrosse

According to your suggestion, i have started organizing PGN files.
I have following questions for you.

1) The pgn for draw games should be excluded?


I do not think so. In fact, discarding drawn games may have a paradoxical consequence : the book itself will be drawish!
See here :

http://rybkaforum.net/cgi-bin/rybkaforu ... 100608;hl=

ChessKnight wrote:2) in the code given by you

The most simple way is to do something like :
Code:
polyglot.exe make-book -pgn MyGameCollection.pgn -max-ply 50 -min-game 3 -min-score 30 -bin MyPolyglotBook.bin
Can you explain min-game and min-score parameters?


I repeat my recommendation : do read polyglot's manual !

-min-game 3 : in a given position, only the moves that have been played in at least three games will be included in the book. A move that has been played only in one game will not be included in the book even though this precise game has been won by the side to move.

-min-score : similar to the min-game parameter, but deals with global results : only thoses moves that have achieved an overall result superior or equal to your given value for the side considered (in percents) will be included in the book.

ChessKnight wrote:What are the best settings for above command?

It depends on what you are trying to achieve with your book.
Some people have worked for years in book making and tuning ...

ChessKnight wrote:(...)What is the exact procedure for tuning an opening book?
ChessKnight wrote:4) Is there any easiest way to check if opening book created is enough good?

Same answer as former one.
Basically do have your engine(s) play lots of games with your book and do try to correct under-performing lines. There is no published automated way to achieve this, so it is still a matter of knowledge, feeling and experience supported by many many hours of "manual" analysis mixed with many many hours of testing.
This is a point where the better chess player has still an enormous advantage over a weak one. But there are well-known grandmasters who are credited with engine opening books of rather mediocre quality.

ChessKnight wrote:5) When a fresh newly made opening is linked with any chess engine is there certain amount of games needs to played to auto-tune opening book?

Polyglot books do not auto-tune.
The more the games the more you will have stuff for improving the book.
ChessKnight wrote:6) Up to how many initial moves normally a chess engine depends on an opening book?

This is very controversial.
If your goal is to have better results in typical online engine play (blitz on Playchess ...), the simple answer is "longer is better", because as long as your engine is in his book, it does not consume any time and will get more time kept for when it will begin to think on its own.
But if you push it to the extreme your engine won't play at all.
So if you are comfident that your engine is superior to his opponents in early middle game you should not make a too long book. Recent posts by Jeroen Noomen and Vas Rajlich explain how on this precise ground they decided to go for shorter competition books for Rybka avoiding overanalysed main opening variations ...
If your goal is not "results, better results, always better results" in a very limited set of conditions (playing blitz with rybka 3 against other rybka 3 on Playchess) then there is no possible general answer.
You could also have a look at this thread here :
http://www.open-aurec.com/wbforum/viewt ... highlight=
ChessKnight wrote:Thanking you for your time and assitance.


You are welcome

Marc
Marc Lacrosse
 
Posts: 116
Joined: 29 Jan 2005, 09:04
Location: Belgium

Re: How to make an opening book like performance.bin

Postby ChessKnight » 11 Jan 2009, 03:14

Marc Lacrosse

Thanks for replying me in details as needed.

By the way, I recently came to know you are the author of great opening book "performance.bin".

At present I am in the process of selecting excellent PGNs which is in fact tedious and lengthy job. Plus I need to enlarge my collection of PGNs coz 20000+ PGNs BIN book shrinks to size smaller than 500kB.

Thanks n regards,
ChessKnight
 
Posts: 48
Joined: 26 Dec 2008, 06:37

Re: How to make an opening book like performance.bin

Postby ChessKnight » 16 Jan 2009, 12:45

Marc Lacrosse and H.G.Muller:

Thank you for assistance.

I have successfully made tiny polyglot book sized less than 400kb out of my collection of PGNs coz 20000+ (ABSTRACTED) PGNs. I have made two
tiny but strong opening books one with default -max-ply 50 -min-game 3 and other with -max-ply 50 -min-game 3 - uniform option. Enlargement of good PGN collections is going to take some time!

I personally found them giving good results when it is merged with performance.bin by Marc Lacrosse.

If anybody is interested, please let me know where can I upload it, so interested person can download and merge with any other polyglot book per their wish.

Thanks n regards,
ChessKnight
 
Posts: 48
Joined: 26 Dec 2008, 06:37

Re: How to make an opening book like performance.bin

Postby ChessKnight » 19 Jan 2009, 17:36

Marc Lacrosse and H.G.Muller:


Toga-II Opening Book : Learning Purpose can be dowloaded from following link:
Toga-II Opening Book

I am sincerely thankful to continuous support from Marc Lacrosse (author of performance.bin) and H.G.Muller (no need for introduction -tiny uMAX).

Thanks n regards,
ChessKnight
 
Posts: 48
Joined: 26 Dec 2008, 06:37


Return to Programming and Technical Discussions

Who is online

Users browsing this forum: No registered users and 7 guests

cron