Author: Anthony Cozzie
Date: 16:02:42 07/12/03
Go up one level in this thread
On July 12, 2003 at 18:42:51, Rick Bischoff wrote:
>Hi all,
>
>First time poster, long time listener(reader) :-) Anyway, I am busy away
>implementing my chess engine and have a question about killer moves-- first some
>background:
>
>My move structure has a "score" field that is used to sort the moves in
>descending order after generation. This score is simply 0 for no captures,
>PieceValue(Captured) - PieceValue(MyOwnPiece) + PieceValue(QUEEN) +
>PieceValue(PROMOTION).
>
>Ok, so now I have an array somewhere called : int killerMoves[MAX_PLY][64*64]
>
>and my idea is this--
> A) After a "real" move is made, zero out the entire array
> B) During move generation, for each move M, if
>killerMoves[ply][M.from*64+M.to]>0, M.score = that value
> C) During the search...
>
>... if (val >= beta) { killerMoves[ply][currentMove.from * 64 + currentMove.to]
>= M.score + 1; return beta; }
>
>.... }
>.... killerMoves[ply][bestMove.from*64 + bestMove.to] = bestMove.score+1;
>.... return alpha;
>
>Is this the "proper" way to implement killer moves? Would it be better to set
>the score of the move to +INF after a cutoff? Is there a better structure I
>can use other than an int array?
>
>Thanks,
>Rick
A couple points:
What you have described is usually called history tables, except that most
people don't have a ply index (just 64x64).
Killers are usually organized as 2 per ply per side, and the actual moves are
stored (e.g. Kb1).
Killers/history are usually updated on successful moves (i.e. > alpha).
My suggestion is that you download crafty and take a look at next.c. [WARNING:
it takes a bit of time to get a feel for the crafty source. EVERYTHING in there
is a macro. And I do mean everything. An example is WhiteKnights ->
tree->white_knights_bitboard.]
anthony
This page took 0 seconds to execute
Last modified: Thu, 15 Apr 21 08:11:13 -0700
Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.