Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Question: Evaluation( )

Author: Colin Frayn

Date: 03:15:02 01/30/00

Go up one level in this thread


On January 29, 2000 at 00:47:06, TEERAPONG TOVIRAT wrote:

>Hi ,
>How to encourage the program to do some exchanges of pieces
>when materials are ahead and avoid when behind ?

This is how I did it;

ypts=total point value of your pieces, opts=opponent's pieces.
gamestage is sum of all pieces on board (ypts+opts)

 if (ypts!=opts && gamestage>20) {
    sdiff=((78-gamestage)*2);
    if (ypts>opts) sc+=sdiff;
    else sc-=sdiff;
  }

I'm not sure if this is a very good method, but it seems to work and it avoids a
divide, and the *2 can be optimised to <<1.  Note that 78 is the total sum of
all the piece values before captures.

Using this method, exchanging minor pieces (value 3) when a pawn ahead (1 point)
will score an effective bonus of 12 extra points (which, in the evaluation
routine, is 0.12 pawns).  I don't make any distinction between being a pawn
ahead and being a queen ahead.  I'm not sure if this would help - perhaps
someone could comment?  The main reason why not is because against another good
player it would never get that far ahead, and against a poor player it might get
that far ahead, but shouldn't have any problems winning anyway :)  In
grandmaster games, a pawn is worth a game effectively (unless it's a cunning
sacrifice), so if you're two pawns up, you should be able to win quite easily
without exchanging off.

I put in a lower limit (i.e. don't trade off if there are less than 21 pts worth
of pieces on the board) to stop my program exchanging off from won endgames into
drawn ones.

Cheers,
Colin



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.