Chris Pollett >
Students > [Bio] [Del1] [Del2] [Del3] [Del4] |
Extension to Chess game database lookup logicDescription: GNU chess program's game database (book) lookup logic was enhanced such that the lookups were made much faster and efficiently.
Anytime GNU chess program tries to lookup moves from the game database (book.dat) if has to do the following: Currently bookpos stores the following:
As an extension to this book lookup logic I modified the information that is stored in bookpos such that for each white move read from the game database I store all the winning next black moves with the total number of wins. Assuming user is playing white and computer is playing black.
With this extension when the game starts, the book lookups will be faster because now the program has to only generate current board's HashKey, find the matching HashKey from the book and then look at the next black winning moves and pick the one with highest number of moves. Information stored in book.dat will also be similar format. Thus we can skip generating the legal moves and calculating Hash Key and doing a lookup each time. Example 1: GNU Chess with original logic:
Example 2: GNU Chess with Book Extension:
Without the extension the GNU chess program had to generate following number of moves, calculate HashKey for each of those moves and had to search the book for the number of slots mentioned below for just first five moves. BookQuery: Legal moves generated = 20, Number hash slots searched = 13 All these were skipped in the extension where we stored the 4 possible next black winning moves. As the game progress, the number of legal moves will increase and so the book search will take more time without the above extension. GNU chess program when run with -B option run the program with this extension. Book Extension Code:
|