TalkChess.com
Hosted by Your Move Chess & Games

Author Message
Edmund Moshammer

Joined: 03 Dec 2007
Posts: 598
Location: St. Gallen, Switzerland

Post subject: Re: Database storage methods    Posted: Sun Mar 11, 2012 9:21 am

 diep wrote: Note that to store FENs, you can store chesspositions pretty compact. A simple method is to use say for example: 64 bits : bitmap that basically says whether a piece is on a square or not now we have for 32 pieces at most which can have 12 values, so with arithmetic encoding that's : log 12 / log 2 = 3.58 bits So for 32 pieces that's 114.7 = 115 bits. So we have 147 bits for the position. now let's store also its properties. side to move is 1 bit , we are at 148 now. we know we have at most 5 pawns we can capture en passant. that's 2.32 bits. That bad luck so far is that added up with the pieces that's 117.04 bits so doesn't fit in 117 bits yet. So we are at 151 now. Then for each side we must store 2 bits for castling rights of the rook at most. So we end at 155 bits for a position. Now Bob will probably post something about repetitions and stuff like that, but he isn't hashing that into crafty either and he is hashing en passant and castling rights, so 155 bits it is

you are missing the 7 bits needed for the 50-move counter; this counter can be combined with the ep squares because it has to be 0 in case of ep possibilities.

You are missing out on some gains from restrictions due to chess rules. Pawns may occupy only 3/4 of the board, there is exactly one king per side, the kings may not be on neighboring squares and side to move may not give check.
There are some more, but the gains would probably not justify the efforts.
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First
Subject Author Date/Time
david nash Thu Mar 08, 2012 10:56 am
Ed Schroder Thu Mar 08, 2012 11:59 am
Julien MARCEL Thu Mar 08, 2012 12:33 pm
david nash Thu Mar 08, 2012 12:43 pm
Martin Sedlak Thu Mar 08, 2012 1:00 pm
Julien MARCEL Thu Mar 08, 2012 1:13 pm
david nash Thu Mar 08, 2012 1:32 pm
Martin Sedlak Thu Mar 08, 2012 1:45 pm
Julien MARCEL Thu Mar 08, 2012 1:51 pm
Ed Schroder Thu Mar 08, 2012 3:42 pm
Ed Schroder Thu Mar 08, 2012 3:46 pm
Robert Hyatt Thu Mar 08, 2012 10:54 pm
Julien MARCEL Thu Mar 08, 2012 11:53 pm
Robert Hyatt Fri Mar 09, 2012 12:18 am
Edmund Moshammer Fri Mar 09, 2012 12:51 am
H.G.Muller Fri Mar 09, 2012 9:29 am
Don Dailey Sat Mar 10, 2012 10:25 pm
Edmund Moshammer Sun Mar 11, 2012 12:27 am
Don Dailey Sun Mar 11, 2012 5:25 am
Don Dailey Sat Mar 10, 2012 10:44 pm
Ronald de Man Sat Mar 10, 2012 11:45 pm
david nash Thu Mar 08, 2012 12:40 pm
H.G.Muller Thu Mar 08, 2012 4:36 pm
david nash Thu Mar 08, 2012 5:03 pm
H.G.Muller Thu Mar 08, 2012 5:28 pm
david nash Thu Mar 08, 2012 8:48 pm
Harald Lüßen Thu Mar 08, 2012 8:45 pm
david nash Thu Mar 08, 2012 8:51 pm
Nguyen Pham Thu Mar 08, 2012 10:39 pm
Vincent Diepeveen Sun Mar 11, 2012 6:41 am
david nash Sun Mar 11, 2012 4:49 pm
Vincent Diepeveen Sun Mar 11, 2012 4:58 pm
david nash Sun Mar 11, 2012 5:51 pm
Vincent Diepeveen Sun Mar 11, 2012 7:03 am
Vincent Diepeveen Sun Mar 11, 2012 7:21 am
Re: Database storage methods Edmund Moshammer Sun Mar 11, 2012 9:21 am
Vincent Diepeveen Sun Mar 11, 2012 3:41 pm
david nash Sun Mar 11, 2012 5:08 pm

 Jump to: Select a forum Computer Chess Club Forums----------------Computer Chess Club: General TopicsComputer Chess Club: Tournaments and MatchesComputer Chess Club: Programming and Technical DiscussionsComputer Chess Club: Engine Origins Other Forums----------------Chess Thinkers ForumForum Help and Suggestions
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum