Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Evaluating Mobility

Author: KarinsDad

Date: 14:25:32 10/21/99

Go up one level in this thread


On October 21, 1999 at 16:38:39, Scott Gasch wrote:

>Hello,
>
>I've been analizing games my engine lost and noticed a common problem -- it gets
>a piece stuck with terrible mobility and subsequently can't defend itself (or
>attack the enemy).
>
>So I have been trying to come up with a cheap way to factor piece mobility into
>the eval.  I thought of this: put counters in the move generation routine that
>reflect the number of valid moves for piece X... each time I call GenerateMoves
>these all get reset to zero and then incremented every time, for instance, a
>bishop has a valid move... etc.
>
>So then QSearch will make one of the moves returned by NextMove (affecting one
>piece's mobility) and then, maybe, call Eval.  Eval can then use the counters to
>give bonuses for piece mobility pretty accurately (one piece -- the last one
>moved -- may have increased or decreased mobility but most are accurate).
>
>My question is this: from your experience is this approach cheaper than adding
>mobility code to Eval?  There are a lot of times the moves are generated that we
>do not care about this data (any ply where we still have depth).  But it seems
>like a waste of instructions to do a conditional just to save one increment...
>and it seems like a waste of code to duplicate the move generation routines
>(version 1 has increment counter code and version 2 does not).  I am really
>worried about slowing the engine down too much with this code.  I am already
>down to about 80k NPS (mainly because of the size of a move, I've decided, but
>that's another story).  I am afraid that if I improve Eval but slow it down too
>much I will start not getting very deep... and performing worse for my change.
>
>Thanks,
>Scott

I'm not sure how well this will work.

The problem is not one of how many squares can a piece move to, but rather how
many squares can a piece move to safely. Additionally, if you analyze GM games,
you will notice that a square that does not really look safe, is safe due to
some condition of the board. However, I just let the search engine take care of
that one.

So, what I do is have square safety info per piece which gets factored into the
eval. And, since I do delta calculations (based off the parent), it is in the
eval as opposed to the move generator (although I guess it could go into the
move generator).

KarinsDad :)



This page took 0.01 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.