Difference between revisions of "Opening Book"

From Chessprogramming wiki
Jump to: navigation, search
(Binary)
(4 intermediate revisions by 2 users not shown)
Line 7: Line 7:
 
=Purposes=  
 
=Purposes=  
 
* Save time: Chess programs could use [[Search|search]] from the beginning and look through all possible continuations in detail to find the best next move, but as this is quite time-consuming and there already exists a lot of [https://en.wikipedia.org/wiki/Chess_opening_book_%28literature%29 literature] about different opening lines, opening books save time.
 
* Save time: Chess programs could use [[Search|search]] from the beginning and look through all possible continuations in detail to find the best next move, but as this is quite time-consuming and there already exists a lot of [https://en.wikipedia.org/wiki/Chess_opening_book_%28literature%29 literature] about different opening lines, opening books save time.
* Provide a higher quality of play. Searching only can't deep tactics and strategy.
+
* Provide a higher quality of play: Searching only even with large depths can't see deep tactics, strategy, compensation, lose temporarily material for long term advantage.
* Provide variety, as book moves are usually chosen [[Pseudorandom Number Generator|randomly]], whereas searches are more or less deterministic.
+
* Provide variety: as book moves are usually chosen [[Pseudorandom Number Generator|randomly]], whereas searches are more or less deterministic.
 
 
  
 
=Types=
 
=Types=
Line 19: Line 18:
 
* [[EPD]]: They are the last positions of opening lines
 
* [[EPD]]: They are the last positions of opening lines
 
* [[PGN]]: Opening lines are stored as individual games
 
* [[PGN]]: Opening lines are stored as individual games
 +
<span id="BookBuilder"></span>
 +
* Special formats: In 1999, [[Marc-Philippe Huget]] published a '''Book Builder''' <ref>[https://www.stmintz.com/ccc/index.php?id=44407 Web site updated and new program Book Builder] by [[Marc-Philippe Huget]], [[CCC]], February 24, 1999</ref> in conjunction with his engine [[La Dame Blanche]], a standalone open source program <ref>[http://www.quarkchess.de/ladameblanche/ Book Bilder of La Dame Blanche] by [[Marc-Philippe Huget]], hosted by [[Thomas Mayer]]</ref> to convert a [[Portable Game Notation|PGN file]] into an opening book of the format proposed by [[Kathe Spracklen]] <ref>[[Kathe Spracklen]] ('''1983'''). ''Tutorial: Representation of an Opening Tree''. [[ICGA Journal#6_1|ICCA Newsletter, Vol. 6, No. 1]]</ref>:
 +
<pre>
 +
(e4(e5)(c5))(d4d5)) etc.
 +
</pre>
  
 
==Binary==
 
==Binary==
Line 29: Line 33:
  
 
==Handcrafted==  
 
==Handcrafted==  
If the opening database designer has some special preference of a certain opening line, he might create it fully manually. This is often the case if a chess program is about to play an important game against a grandmaster. Then the opening style will probably be chosen to be difficult and dangerous for the opponent. Another option is to first automatically generate a database and then fine tune it manually.
+
If the opening database designer has some special preference of a certain opening line, he might create it fully manually. This is often the case if a chess program is about to play an important game against a grandmaster. Then the opening style will probably be chosen to be difficult and dangerous for the opponent. Another option is to first automatically generate a database and then fine-tune it manually.
  
==Automated==  
+
==From game collection==  
Another option is to select a number of games (the type of which will effect the openings played: e.g. drawn games only, GM games only, etc) and then up to a certain depth store all positions in the opening database. It is true that by using this way of database generation some severe errors might by copied as well, but usually the chess programs are set to stop playing according from the book if a position occurred less than a certain number times before.  
+
Another option is to select a number of games (the type of which will affect the openings played: e.g. drawn games only, GM games only, etc) and then up to a certain depth store all positions in the opening database. It is true that by using this way of database generation some severe errors might by copied as well, but usually the chess programs are set to stop playing according to the book if a position occurred less than a certain number times before.
  
==Book Building Tools==
+
==By computing==
 +
Chess [[engines]] can be used to evaluate positions in a book opening tree to rank them, and/or decide to stop or expand.
 +
 
 +
=Book Building Tools=
 
* [[Bookbuilder]]
 
* [[Bookbuilder]]
 
* [[Bookup]]
 
* [[Bookup]]
 
* [[Chess Opening Wizard]] (COW)
 
* [[Chess Opening Wizard]] (COW)
<span id="BookBuilder"></span>
+
* [[Banksia GUI]]
==Book Builder==
 
In 1999, [[Marc-Philippe Huget]] published a '''Book Builder''' <ref>[https://www.stmintz.com/ccc/index.php?id=44407 Web site updated and new program Book Builder] by [[Marc-Philippe Huget]], [[CCC]], February 24, 1999</ref> in conjunction with his engine [[La Dame Blanche]], a standalone open source program <ref>[http://www.quarkchess.de/ladameblanche/ Book Bilder of La Dame Blanche] by [[Marc-Philippe Huget]], hosted by [[Thomas Mayer]]</ref> to convert a [[Portable Game Notation|PGN file]] into an opening book of the format proposed by [[Kathe Spracklen]] <ref>[[Kathe Spracklen]] ('''1983'''). ''Tutorial: Representation of an Opening Tree''. [[ICGA Journal#6_1|ICCA Newsletter, Vol. 6, No. 1]]</ref>:
 
<pre>
 
(e4(e5)(c5))(d4d5)) etc.
 
</pre>
 
  
 
=Quotes=  
 
=Quotes=  
Line 49: Line 51:
 
  To solve the opening problems of his chess machine, [[Belle]], [[Ken Thompson]] typed in opening lines from the ''[https://en.wikipedia.org/wiki/Encyclopaedia_of_Chess_Openings Encyclopedia of Chess Openings]'' (in five thick volumes). Religiously, he dedicated one hour a day for almost three years (!) to the tedious pursuit of entering lines of play from the books and having his Belle computer verify them. The result was an opening library of roughly three-hundred thousand moves. The results were immediate and obvious: Belle became a much stronger chess program, and Ken probably aged prematurely. Later Ken developed a program to automatically read the ''Encyclopedia'', allowing him to do in a few days what had taken him three years to do manually. <ref>[[Mathematician#HSBaird|Henry S. Baird]], [[Ken Thompson]] ('''1990'''). ''[http://doc.cat-v.org/bell_labs/reading_chess/ Reading Chess]''. [[IEEE#TPAMI|IEEE Transactions on Pattern Analysis and Machine Intelligence]], Vol. 12, No. 6, [http://doc.cat-v.org/bell_labs/reading_chess/reading_chess.pdf pdf]</ref>  
 
  To solve the opening problems of his chess machine, [[Belle]], [[Ken Thompson]] typed in opening lines from the ''[https://en.wikipedia.org/wiki/Encyclopaedia_of_Chess_Openings Encyclopedia of Chess Openings]'' (in five thick volumes). Religiously, he dedicated one hour a day for almost three years (!) to the tedious pursuit of entering lines of play from the books and having his Belle computer verify them. The result was an opening library of roughly three-hundred thousand moves. The results were immediate and obvious: Belle became a much stronger chess program, and Ken probably aged prematurely. Later Ken developed a program to automatically read the ''Encyclopedia'', allowing him to do in a few days what had taken him three years to do manually. <ref>[[Mathematician#HSBaird|Henry S. Baird]], [[Ken Thompson]] ('''1990'''). ''[http://doc.cat-v.org/bell_labs/reading_chess/ Reading Chess]''. [[IEEE#TPAMI|IEEE Transactions on Pattern Analysis and Machine Intelligence]], Vol. 12, No. 6, [http://doc.cat-v.org/bell_labs/reading_chess/reading_chess.pdf pdf]</ref>  
 
<span id="Formats"></span>
 
<span id="Formats"></span>
 +
 
=Formats=  
 
=Formats=  
 
* [[ABK]] - [[Arena|Arena's]] book format  
 
* [[ABK]] - [[Arena|Arena's]] book format  
Line 211: Line 214:
 
* [http://www.talkchess.com/forum3/viewtopic.php?f=2&t=71764 ChessDBCN] by [[noobpwnftw]], [[CCC]], September 09, 2019
 
* [http://www.talkchess.com/forum3/viewtopic.php?f=2&t=71764 ChessDBCN] by [[noobpwnftw]], [[CCC]], September 09, 2019
 
* [http://www.talkchess.com/forum3/viewtopic.php?f=7&t=72432 Polyglot FRC/960 Opening Book] by [[Dennis Sceviour]], [[CCC]], November 27, 2019 » [[PolyGlot]], [[Chess960]]
 
* [http://www.talkchess.com/forum3/viewtopic.php?f=7&t=72432 Polyglot FRC/960 Opening Book] by [[Dennis Sceviour]], [[CCC]], November 27, 2019 » [[PolyGlot]], [[Chess960]]
 +
==2020 ...==
 +
* [http://www.talkchess.com/forum3/viewtopic.php?f=7&t=75205 How many Elo points is a book?] by [[Chris Whittington]], [[CCC]], September 25, 2020 » [[Playing Strength]]
  
 
=External Links=  
 
=External Links=  

Revision as of 09:03, 27 September 2020

Home * Knowledge * Opening Book

Chess programs often look up the positions at the beginning of the game in an Opening Book. The opening database can then be used as long as the opponent plays a new move from the database, so usually more common opening lines will be stored to a much higher depth than the uncommon ones. As soon as the program is "out of book" it has to continue using the normal search routines.

Purposes

  • Save time: Chess programs could use search from the beginning and look through all possible continuations in detail to find the best next move, but as this is quite time-consuming and there already exists a lot of literature about different opening lines, opening books save time.
  • Provide a higher quality of play: Searching only even with large depths can't see deep tactics, strategy, compensation, lose temporarily material for long term advantage.
  • Provide variety: as book moves are usually chosen randomly, whereas searches are more or less deterministic.

Types

Opening books are typically stored in two formats:

Text

The most advantage is that by using text form they are readable, understandable, and editable by humans without any special software. However, the main disadvantage is that they may take too much space as well as time for searching since an item may take from 50 bytes (for FEN strings) to hundreds of bytes (for PGN text). If we store openings "continuously" (all possible opening positions) both data size and searching time become too huge and become unacceptable for playing. In practice, those opening books are usually very small with some lines or positions only, they cannot be used for real game playing but for testing.

They are stored in typical ways for games and positions:

  • EPD: They are the last positions of opening lines
  • PGN: Opening lines are stored as individual games

(e4(e5)(c5))(d4d5)) etc.

Binary

Binary books have some important advantages, especially for computer chess engines. Opening databases built on all positions are usually more space-efficient and overcome the problem of transpositions. Often these positions are stored as hash values to allow fast access. Some opening database formats store with each position as well as some information about it. (e.g. number of times occurred, number of games won by white/black / drawn with this position, average/maximum Elo of players playing to this opening position, chess program's success with the position). So when a chess program has to decide on a move, it will look up all positions that could arise after moving in the database and then make a decision upon the information given with each position. Depends on designs, an item may take 10 - 16 bytes. To build and/or edit those opening books, users need to use special software.

The most popular format is PolyGlot.

Generation

All in all the information stored in an opening database should guide the chess game into a type of middle game in which the chess program proves itself most successful. But to achieve this there are two main ways.

Handcrafted

If the opening database designer has some special preference of a certain opening line, he might create it fully manually. This is often the case if a chess program is about to play an important game against a grandmaster. Then the opening style will probably be chosen to be difficult and dangerous for the opponent. Another option is to first automatically generate a database and then fine-tune it manually.

From game collection

Another option is to select a number of games (the type of which will affect the openings played: e.g. drawn games only, GM games only, etc) and then up to a certain depth store all positions in the opening database. It is true that by using this way of database generation some severe errors might by copied as well, but usually the chess programs are set to stop playing according to the book if a position occurred less than a certain number times before.

By computing

Chess engines can be used to evaluate positions in a book opening tree to rank them, and/or decide to stop or expand.

Book Building Tools

Quotes

Jonathan Schaeffer in One Jump Ahead [5] :

To solve the opening problems of his chess machine, Belle, Ken Thompson typed in opening lines from the Encyclopedia of Chess Openings (in five thick volumes). Religiously, he dedicated one hour a day for almost three years (!) to the tedious pursuit of entering lines of play from the books and having his Belle computer verify them. The result was an opening library of roughly three-hundred thousand moves. The results were immediate and obvious: Belle became a much stronger chess program, and Ken probably aged prematurely. Later Ken developed a program to automatically read the Encyclopedia, allowing him to do in a few days what had taken him three years to do manually. [6] 

Formats

Classification of Chess Openings

Book Issues

See also

Selected Publications

1974 ...

Я.Ю. Гольфанд, А.Л. Футер (1974). Реализация дебютной справочной для шахматной программы./ Сб. Проблемы кибернетики №29, стр. 201-210

1980 ...

1990 ...

2000 ...

2005 ...

2010 ...

2015 ...

Forum Posts

1990 ...

1995 ...

2000 ...

2005 ...

Re: Opening books format by Jury Osipov, CCC, April 15, 2008 » ABK
Re: Opening books format by Richard Pijl, CCC, April 15, 2008
Re: Opening books format by Dann Corbit, CCC, April 15, 2008

2010 ...

2013

Re: 2 Moves Engine Book by Miguel A. Ballicora, CCC, December 08, 2013 » Ruby

2014

2015 ...

2016

2017

2018

2019

2020 ...

External Links

Engine Books

Online Opening Tree

Misc

References

Up one level