Author: Dan Homan
Date: 11:40:39 11/05/98
Go up one level in this thread
On November 05, 1998 at 14:21:39, Will Singleton wrote:
>All,
>
>My program Amateur has been in development for more than a year, and does pretty
>well on the servers. But it's an outgrowth of an old approach to chess
>programming, and needs a modern search algorithm. In my old method, I manually
>negate alternate ply scores, using a single bound for cutoffs, and therefore
>must distinguish between shallow and deep cutoffs. This causes all kinds of
>complications and inefficiencies. Don't ask me why I stuck with this old
>method; something to do with being stubborn and wanting to do it "my way."
>
>So now I've implemented a standard alpha-beta negamax search, and am in the
>process of reworking the rest of the code to work with this search. And it's
>running now in a basic mode, with most extensions, nullmove, and hashing
>disabled.
>
>Now for the odd question: it seems I still have to negate the value from eval()
>on odd plys to get the thing to work! Here's a *very simplified* bit of code to
>explain the problem:
>
>
>int ab (alpha, beta)
>
>if (depth==0) return (eval());
>score = -9999;
>gen_moves();
>for all moves
> value = -ab(-beta,-max(alpha,score));
> if (value > score) score = value;
>end for
>return score;
>
>Now assume you are doing a 1 ply search, and the eval score is 100. Since the
>score is negated upon return, value == -100. But that's obviously not correct,
>since the smallest value will be selected, not the largest. But it works if
>eval() negates the score on odd plies before return.
>
>I know I'm missing something simple, but what is it?
>
>Will
Hi Will,
I think you function above is fine for all plies (even and odd), assuming
that the score you return from eval() is really the score for the side
that is on-move at depth = 0. Naturally the score should be negated for
the depth = 1, because the other side on move at depth = 1.
Now, for a one ply search, you are calling your function (with depth = 0)
from some sort of driver... maybe like this -
void interative_deepening() {
...
for(depth = 0; depth < MAX_DEPTH; depth++) {
...
search_score = ab(alpha, beta, i);
...
}
}
So at this top level, you don't negate the score returned because you
haven't changed the side to move. Everything should be consistent
this way.
- Dan
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.