Author: Carlos del Cacho
Date: 05:55:49 10/19/00
Go up one level in this thread
On October 19, 2000 at 06:02:33, Rafael Andrist wrote:
>On October 19, 2000 at 05:36:14, Tony Werten wrote:
>
>>On October 19, 2000 at 03:12:43, Rafael Andrist wrote:
>>
>>>I'm actually writing a little chess program and want to detect pinned pieces in
>>>the evaluation function because i do calculations, how often a piece is attacked
>>>and "defended". If it's now attacked by 3 and defended by 3, but one of them is
>>>pinned, the search needs 5 or 6 ply to detect the pinned piece. Has someone an
>>>idea how to solve this problem in eval or is it only possible in search?
>>
>>After the normal search, you do a quiscence search, ie only capturing moves (and
>>the abbility to stop and accept the current score). This search takes care of
>>your problem, since the pinned piece will not recapture.
>>
>>Tony
>
>I know how this problem is solved in search. But my question was, if it is
>possible to do this in the position evaluation.
I don't think there's any way of detecting this in the evaluation function. I
mean you don't only have to take care of pins, there' are also forks and mate
threats in there. Too difficult for a static eval.
I do use some kind of pinned piece detection in eval, though because my program
used to lose games because of this. When you see the tactical winning move it's
too late and your position already sucks. For example, when I find a rook I
search for any bishop in the same diagonals (easy with bitboards, just an &). If
one is found I check if there are pieces in between. Something like this:
if (BISHOP_ATK[sq] & Bishops[opponent])
{
bitboard t = BISHOP_ATK[sq] & Bishops[opponent];
while (t)
{
bsq = Lsb(t);
t ^= LSB[bsq];
if (PopCnt(BETWEEN][sq][bsq] & ocuppied) <= 1)
... // pinned or hung
}
}
Greets,
Carlos
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.