Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Attack table

Author: Bert van den Bosch

Date: 12:37:40 10/17/05

Go up one level in this thread


On October 17, 2005 at 14:20:38, Scott Gasch wrote:

>On October 16, 2005 at 06:29:21, JW de Kort wrote:
>
>>Hi,
>>
>>Is there some where on the internet a site were i can find information on how to
>>quickly generat attack tables in a 0x88 chess program. I have been looking but
>>could not find anything.
>>
>>regards
>>
>>Jan Willem
>
>Attack tables meaning this piece is attacking that square?  As far as I know
>there are two ways to do it: incrementally and at the leaves.
>
>I do the latter -- in eval when I am computing piece mobility I also toggle a
>bit per piece type in the attack table.  I also toggle on xray bits in these
>same mobility loops.  Once all pieces have had their mobility computed I have a
>full attack table generated.  Also, in eval I score pawns first, then minors,
>then rooks, then queen and finally kings.  The bonuses are:
>
>    1. When you're doing piece X's mobility you know what squares it will be
>       instantly taken by a lower-valued piece (because you already did the
>       lower valued piece mobility code)
>    2. By the time you are ready to consider king safety you have a bunch of
>       attack table bits around the king that tell you what enemy pieces are
>       pointed near it.
>
>I don't know who does incremental attack table generation -- I thought about it
>for a while but I never gave it a try because it seems like a big mess.  Every
>time you move a piece you basically turn off all attack table bits from where it
>was and turn on all attack table bits from where it went.  If this was all it
>would not be so bad.  But consider: every time you move a piece you can
>potentially "expose" other piece's attacks.  So once you fixed up the from/to
>attack table bits you then need to go identify what other pieces you may have
>uncovered and fix up their attack bits.
>
>All in all I don't know which is faster -- incremental or reconstructing the
>table at every eval call.  I guess it depends on how often you call eval (any
>internal nodes?).  Maybe someone who has written an incremental attack table
>engine can speak to this.
>
>Also, check out Ed Schroder's "Programmer Stuff" page for an idea for a basic
>data structure for attack tables.
>
>Good luck,
>Scott

Incremental attack tables is what I use in my engine. And it is indeed a bit of
work but once you have the move generator working this way, you do have a lot of
benefits all over the search tree. I originally wrote it incrementally to
implement SEE. I also thought about how much overhead in move generation I would
have using this approach but I figured there is not too much. If you just
imagine a very simple engine searching only one ply, no quies, and evaluating
the position simply by the value of your pieces, you wouldn't even have to
generate a single move, simply loop over your attacktables and evaluate the
position. Also I use it to quickly see cutoffs one ply ahead in qsearch.

greetings Bert



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.