Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: questions about dynamically updating attackboards

Author: Gerd Isenberg

Date: 02:20:55 08/24/03

Go up one level in this thread


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

Hi Uri,

Depends on your data structures.

I my former Dos-IsiChess i used following data structure,
updated incrementally during make/unmake move:

A) 64 piecesets for each square:

PieceSet attackedBy[64];

A pieceset is a 32-bit or 2*16-bit integer for each side:
15-8 - eight pawns (or promoted pieces)
 7,6 - two knights
 5,4 - two bishops
 3,2 - two rooks
   1 - queen
   0 - king

There where even several Pieceset Masks for each kind of piece.

B) A redundant array of 32 Bitboards for all possible pieces.

BitBoard attackTo[32];

C) Some 64-byte arrays to map Pieceset indizies to board coordinates and vice
versa. And a "normal" 64-byte board representation.

---

During makemove i had to figure out a set of squares with changed attacks - and
to consider only these squares to update attackedBy[64]. It was quite nice and
relative fast.

But the drawback was, that depending on state of the game (closed, open,
endgame), the popularty of the changeset varies a lot. If you push a rook pawn,
may be only two squares change, but doing a queen move in endings, you may
handle more than 40 squares! I did even pinned and en-prise state update.

Currently i use only bitboards and prefere attack generation on the fly.
There are a lot of terminal and cut nodes, where the whole attack information is
not needed at all.

In the meantime the next paradigm shift is on trial.
Doing some Kogge Stone stuff once a node, even in futile ones.

Gerd





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.