Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Extensions

Author: Matthias Gemuh

Date: 05:34:49 04/23/04

Go up one level in this thread


On April 23, 2004 at 06:17:57, Andrew Williams wrote:

>On April 23, 2004 at 06:01:05, Jeff GAZET wrote:
>
>>>>Good morning,
>>>>i'm trying to add extensions to my engine. I'm using a classical alphabeta
>>>>function :
>>>>int alphabeta(int depth, int alpha, int beta)
>>>>depth is dicreased 1 by 1 :
>>>>eval=-alphabeta(depth-1,-beta,-alpha);
>>>>
>>>>At the beginning at the function alphabeta(), if king is incheck, i do
>>>>++depth. This works fine.
>>>>
>>>>In the main move loop, if do a ++depth on a promoting move, juste before
>>>>calling -alphabeta... the engine searches for ever when the first promoting
>>>>move is found. Then, if i add "if depth<1" or <2, i don't see any
>>>>improvment.
>>
>>
>>>Maybe a stupid question, but you do remember to do depth-- after your call to
>>>alphabeta(..)? Otherwise you could be extending *every* move in positions where
>>>a promotion is available.
>>
>>Yes, depth is dicreased each call to alphabeta :
>>eval=-alphabeta(depth-1,-beta,-alpha);
>>
>
>That's not what I meant. This is what I understand you are doing:
>
>mv = get_next_move();
>make_move(mv);
>if(it_is_a_promotion_move(mv)) {
>    depth++
>}
>score = -alphabeta(depth-1, -beta, -alpha);

if(it_was_a_promotion_move(mv)) {
    depth--;     // DO YOU HAVE THIS LINE?  Or am I messing it up?
}

>
>
>
>The last line (depth--) is VERY important. Otherwise, you're not just increasing
>depth for mv, which is a promotion move, but also for the next move you try,
>which could be anything. Then if you got another promotion move, you would
>increase depth again, and you would then be searching non-promotion moves TWO
>plies deeper than you want to. Note that because of the way you did the check
>test, this problem doesn't apply there.
>
>If I've misunderstood, let me know.
>
>Cheers
>
>Andrew
>
>>>>I don't understand how engines like GnuChess can write : depth+=DEPTH when
>>>>extending.
>>>>(DEPTH is 12).
>>>>
>>>>Could someone give me some explanations, please ?
>>>>
>>>>Regards.
>>>
>>>Andrew



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.