Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: SEE Function

Author: Robert Hyatt

Date: 20:06:17 04/04/00

Go up one level in this thread


On April 04, 2000 at 10:52:25, KarinsDad wrote:

>On April 04, 2000 at 09:08:57, Robert Hyatt wrote:
>
>[snip]
>>
>>
>>The simple way is to do this:  produce a stack of scores, showing the material
>>score after each capture.  for example, I want to play e8=Q, and see the
>>following possible outcome according to SEE:
>>
>>e8=Q  800  (add queen, lose pawn)
>>Rxe8 -100  (remove queen, -900)
>>Rxe8 +400  (remove rook, +500)
>>Bxe8 -100  (remove the rook, -500)
>>Nxe8 +200  (remove bishop, +300)
>>
>>start at the end.  White asks the question "do I stand pat at -100, or do I
>>take the bishop and take +200.  No brainer, we capture and back up +200 to the
>>previous level.  At that point, black asks "do I stand pat at +400 (remember
>>this is black, so +400 is bad for black and good for white) or do I play Bxe8
>>and drop the score to +200.  Again, no brainer, and we back up the 200.  White
>>now asks "do I stand pat at -100, or capture and bring score to +200".  Answer
>>is capture.  And finally black asks "do I stand pat at +800 or capture and drop
>>the score to +200?"  The final score is +200.
>>
>>The idea is that after enumerating all captures, either side can choose to
>>stop rather than capturing further if it worsens the score...
>
>
>Good example.
>
>This is what I was missing. Check +400 vs. +200.
>
>However, wouldn't you check the smaller pieces first? And wouldn't you also
>check knights before bishops of the same color since the knights are not on one
>of the 8 directions and hence, you may not need to even check a given direction
>(some potential bitmap work as opposed to a simple comparison) if both sides
>agree to stop trading before then?
>

Yes.  and Yes.  :)

if you look at swap you see I do both of those, for the reasons given.  Always
use the cheapest piece you can to make the next capture, and prefer knights
over bishops as the knight might end the capture sequence if the opponent has
no more pieces bearing on the square, and the slightly more expensive x-ray
test can be avoided.



>So, your example would become:
>
>e8=Q  800  (add queen, lose pawn)
>Bxe8 -100  (remove queen, -900)
>Nxe8 +200  (remove bishop, +300)
>Rxe8 -100  (remove knight, -300)
>Rxe8 +400  (remove rook, +500)
>
>Where the answer would still be 200 (effectively, losing a pawn for a bishop),
>but it is arrived at "earlier" in the list. It would seem that there should be a
>way to not enumerate the entire list at some point where both sides have equal
>material remaining or something. Is there a way to optimize this?
>
>KarinsDad :)



It is not easy to stop 'early'.  IE it is easier to go to the end and 'minimax'
the score backward (which is why we do this in minimax/alpha-beta searches as
well.

the list is usually very small anyway, when you think about all the squares you
are testing.  Most have one (or fewer) attackers most of the time.



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.