Hi -
I'm working on a chess engine with MagicBitBoard move generator. I have a question about BishopMask. I have seen that for this mask (as well as RookMask), we turn off the bits at the edge of the board. My question is, if we do that, bishops at opposite corners of the board will have the same Mask - for example a bishop at A1 or H8 will have the same Mask (or am I missing something?) - which is going to be a problem. So -
1. Is this expected?
2. Am I doing the BishopMask wrong?
Hope someone who knows this stuff can clarify. Thanks!
Jayakiran
BishopMask for MagicBitboard Implementation
-
- Posts: 190
- Joined: Sun Jul 14, 2013 10:00 am
- Real Name: H.G. Muller
Re: BishopMask for MagicBitboard Implementation
Indeed, the masks are the same. Why do you think that would be a problem?
-
- Posts: 1242
- Joined: Thu Jun 10, 2010 2:13 am
- Real Name: Bob Hyatt (Robert M. Hyatt)
- Location: University of Alabama at Birmingham
- Contact:
Re: BishopMask for MagicBitboard Implementation
jayakiran wrote:Hi -
I'm working on a chess engine with MagicBitBoard move generator. I have a question about BishopMask. I have seen that for this mask (as well as RookMask), we turn off the bits at the edge of the board. My question is, if we do that, bishops at opposite corners of the board will have the same Mask - for example a bishop at A1 or H8 will have the same Mask (or am I missing something?) - which is going to be a problem. So -
1. Is this expected?
2. Am I doing the BishopMask wrong?
Hope someone who knows this stuff can clarify. Thanks!
Jayakiran
Remember that a bishop attacks the last square on a diagonal if the dragonal is open, or if the corner squares are occupied. The attacked squares are the same.
Re: BishopMask for MagicBitboard Implementation
Hi guys -
Thanks for the confirmation/explanation.
I initially thought that the mask should be different for different bishop/rook positions... Now that I think about it, there is no reason for that to be the case. What should be unique (ignoring good collisions) is the hash of each possible occupancy for a given rook/bishop position. Mixed them up.
Jayakiran
Thanks for the confirmation/explanation.
I initially thought that the mask should be different for different bishop/rook positions... Now that I think about it, there is no reason for that to be the case. What should be unique (ignoring good collisions) is the hash of each possible occupancy for a given rook/bishop position. Mixed them up.
Jayakiran