Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Bitboard engines

Author: Miguel A. Ballicora

Date: 22:23:28 08/03/02

Go up one level in this thread


On August 03, 2002 at 13:57:37, Russell Reagan wrote:

>On August 03, 2002 at 06:47:20, Bo Persson wrote:
>
>>I have no real use for AllPieces in my program,
>
>I am testing out different ideas, and the only use I can see for all pieces
>bitboard would be to determine if a square is occupied or not.

Is it not requirement for rotated bitboards to have an allpieces bitboard?
This is one of the rotations, isn'it?
I do what I believe is "rotated bitboards", but since I did my own
implementation I might be doing something very different, but I doubt it.

>>so I don't store that.
>>Occationally, I need its complement EmptySquares which is then computed as
>>
>>~(LitePieces | DarkPieces)
>
>This is one thing I was thinking about. How do you determine when it's better to
>have a bitboard and incrementally update it, and when it's better to compute a
>bitboard from the ones you incrementally update?
>
>It seems like it would be best to have as few bitboards to incrementally update
>as possible, since you will be updating them over and over and over, and then
>when you get to evaluation, it only costs a small amount to compute one compared
>to all of the incremental updating you did to get there.
>
>>I also don't have bitboards for the kings. As there will always be just a single
>>bit set in these anyway, I just store the bit index/square number for the kings.
>
>Why don't you have a bitboard for kings? How do you detect if a king is in
>check? I would think that you would do:
>
>if (whiteKing & blackAttacks)
>    // then king is in check

something like:

if ((blackAttacks >> wking_square) & 1) {
     /* king is in check */
}

Anyway, this is not the most common case in the search and most of the time you
do not even need to calculate Blackattacks (which I believe is expensive but
YMMV) to determine that there is a check or not. Most of the moves cannot
possibly be checks. For instance, your king is in g1 and the opponent plays
e7-e6.

Regards,
Miguel

>How do you do this if you don't have a king bitboard?
>
>>An array of pieces is a quick way to find what pieces is on a gives square.
>>Basically it is a map from Square to Piece, while the bitboards are mapping from
>>Piece to Square. You might have use for both.
>
>I am toying around with bitboard approaches, 0x88 approaches, and also hybrid
>approaches. I'm not done yet, but I have a feeling that a hybrid will produce
>the best results when I'm through.
>
>Russell



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.