Skip to content
Fabian Fichter edited this page Oct 14, 2021 · 5 revisions

There are two main workflows for generation and filtering of opening books, although in principle they can also arbitrarily be combined.

Perft based generation + position score filtering

Perft based generation with subsequent absolute position evaluation filtering is mainly suitable for symmetric variants that are considered relatively balanced.

test example: 2 ply book for standard chess

This generates a small 2 ply book filtering at a depth of 8 to demonstrate the functionality, printing the size before and after filtering and printing the final book to the screen without writing it to a file.

uci
setoption name multipv value 4
ucinewgame
position startpos
generate 2 perft
size
filter depth 8

size
print

4 ply book for standard chess

Same generation and filtering methods as for 2moves_v1.pgn, see the forum post for details.

uci
setoption name multipv value 4
setoption name AbsMoveScore value true
ucinewgame
position startpos
generate 4 perft
filter depth 12

size
save

MultiPV based generation using move score filtering

For games where the evaluation might be unbalanced due to asymmetry in the starting position or a big first move advantage/disadvantage, multiPV based book generation usually is more robust, since it only considers relative changes in the evaluation, irrespective of the absolute value.

3 ply crazyhouse book

The following input generates and prints a small crazyhouse opening book of depth 3 ply, where a search of one second with multipv=5 is performed on each position. Only moves within a range of 50 * 0.9 ^ depth centipawns compared to the best move are considered during the generation of the book tree.

uci
setoption name MoveScoreRange value 50
setoption name DepthFactor value 90
setoption name MultiPV value 5
setoption name UCI_Variant value crazyhouse
ucinewgame
position startpos
generate 3 movetime 1000
print