Computer Chess Club Archives


Search

Terms

Messages

Subject: Bitboard board representation

Author: Eric Oldre

Date: 14:18:46 01/13/05


I have a rotated bitboard based engine. (Latista)

My board representation looks like the following.

//piece types
typedef enum {
	PIECEEMPTY,
	PIECEWPAWN, PIECEWKNIGHT, PIECEWBISHOP, PIECEWROOK, PIECEWQUEEN, PIECEWKING,
	PIECEBPAWN, PIECEBKNIGHT, PIECEBBISHOP, PIECEBROOK, PIECEBQUEEN, PIECEBKING,
	};


struct chessboard {
public:
	/* other stuff */

	U64 bb_pieces[13]; //bitboards of piece locations

};

I noticed while reading the crafty source that Crafty uses a structure more like
this.

struct chessboard {
public:
	/* other stuff */
	//bitboards of piece locations
	U64 wPawns;
	U64 wKnights;
	U64 wBishops;
	U64 wRooks;
	U64 wQueens;
	U64 wKings;

	U64 bPawns;
	U64 bKnights;
	U64 bBishops;
	U64 bRooks;
	U64 bQueens;
	U64 bKings;
};

so Prof. Hyatt can then use the following

board->wPawns;
instead of the equiv. in my engine
board->bb_pieces[PIECEWPAWN];

I've also noticed that Crafty is much faster than my engine, Although I'm sure
that there are MANY MANY reasons for Crafty's better speed, I'm considering
trying a switch to a board format similar to Crafty's.

I know you can't perfectly predict what type of gain/loss I'd get, but I thought
I'd ask if anyone thought It might be worth it.

Or maybe you can tell me that it shouldn't make much difference and I'll save
myself some time.

Thanks for any advice you have,
Eric



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.