Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: questions about dynamically updating attackboards

Author: Uri Blass

Date: 14:12:32 08/23/03

Go up one level in this thread


On August 23, 2003 at 17:00:29, Uri Blass wrote:

>On August 23, 2003 at 16:24:28, Andrew Williams wrote:
>
>>On August 23, 2003 at 15:23:45, Uri Blass wrote:
>>
>>>I am afraid that I did not understand it.
>>>I remember claims that it is possible to do it fast.
>>>How is it possible?
>>>
>>>Suppose that you find that the white rook stops attacking a square.
>>>
>>>If you remember only that a white rook attacked the square without remembering
>>>more information then how do you know that there is not another rook that is
>>>attacking the same square?
>>>
>>>If you check that there is not another white rook that is attacking the same
>>>square before updating the attack array then it does not sound so cheap to do
>>>it.
>>>
>>>Uri
>>
>>When *I* talk about attackboards, I mean that every square has a 32-bit unsigned
>>integer associated with it. Each bit in one of these unsigned integers
>>represents one piece. If the bit is 1, it means that the piece represented by
>>that bit attacks the square.
>
>I have the following piece list
>
>int queens[9][2];
>int rooks[10][2];
>int bishops[10][2];
>int knights[10][2];
>int pawns[8][2];
>
>There is no meaning for piece number 23 so I do not see how can I tell my
>program that each bit represent a piece.
>
>I understand that you cannot know if a square is attacked by a rook based on
>your information because it only tell you that it is attacked by pieces 12,23
>and you need to look at pieces 12,23 to find the value of the attackers.
>
>
>
> You are never going to be able to update this
>>structure very quickly. The issue is, can you justify the time it takes to
>>update this structure with the benefits you get from the information in it?
>>
>>When I make a move, I do this (note that promotions, enpassand and castling are
>>a bit different):
>>
>>1. Create a 32-bit uint which has a bit set for the moving piece, the captured
>>piece (if any) plus any piece which attacks the from square or the to square.
>>
>>2. Go over all 64 squares, masking out the attacks identified in (1) above.
>
>I think that most squares are not affected so I guess that it can be done
>faster.
>
>>
>>3. Go through all the pieces that were affected (not the captured piece of
>>course) and generate their attacks and mask them into the 64-uint array.
>>
>>I would re-iterate that since I do this on every make-move, this is not an
>>efficient use of time, *unless* I use the information I get from it wisely.
>>However, another reason for doing it might be that I put a *lot* of time and
>>effort into getting it working properly; there's an element of pride that would
>>prevent me from ditching it, even if I were convinced that it is a bad idea.
>>Since I'm an amateur at this, I can afford this luxury.
>>
>>Andrew
>
>I believe that more information is a good idea.
>Dan said that it can be done relatively fast.
>
>I thought he meant to different information than the information that you
>describe.
>
>Uri

Here is my post

http://www.talkchess.com/forums/1/message.html?312005

I understood that he practically have only 1 bit to tell if the square is
attacked by white pawn,1 bit to tell if the square is attacked by white
knight,...and one bit to tell if the square is attacked by white king and the
same for black.

It does not cover all the 32 bits so I tried to ask what he does with the other
bits(I said that I guess that he has more information because it seemed to me
that he does not need 32 bits for the information that he described).

It seems based on the answer that he did not understand the reason that I
guessed that he has more information.

Note that I do not like a piece list of 32 squares because it means that even
after having the attack information I cannot get the information if the square
is attacked by a rook directly and I need to look at the squares of the
attackers to see the type of the piece.

I like more attack information that give me directly the information if a square
is attacked by a pawn,knight,bishop,...

Uri



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.