Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Killer Moves

Author: Robert Hyatt

Date: 19:28:53 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


Killers are actually easier to implement than that.  When you get a fail
high, or back up a score > alpha (that means this is _not_ a fail low node,
store the best move if it is not a capture.  If the best move is a capture,
you will search it before killers anyway so there is no reason to dislodge a
non-capturing killer with a killer that will have already been searched by
the time you get around to trying "killer moves".




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.