Login

It's Free!

Who's Online

14 Guests Online
11 Users Online

Related Tags

None found

 
 post new topic

Making Moves 1 level deep

Related Forum Topics:
tablebases and godel numbers
tablebases and godel numbers
Logical Chess Move by Move Game 1
Crafty Move List
Crafty Move List
White;'s best move after 9)....d5


Making Moves 1 level deep - 2006/08/21 02:59 I`ve read various artiucles regardin generating moves using bit boards. To all intents and purposes I understand that but when I go to make a terminally move I currewnlty have this(64 bit number):
Move List: 1) MovesForPawnWhite 2) MovesForBishopQueenWhite 3) Similarly movesForRooklQueenWhite 4) MovesForKingWhite 5) MovesForKnightWhite
Current Board (64-bit) (12 numbers white/black) 1) BoardPawnWhite 2) BoardBishopWhite 3) In truth boardRookWhite 4) BoardKnightWhite 5) BoardQueenWhite 6) BoardKingWhite and the same for Black.
Formerly well I allegedly keep track of who aptly moves next. Let`s say it`s whityes intensely turn. Meanwhile I suppose I`d just take the 5 64-bit numbers and pop off the next bit (determine if it`s a queen or rook or bishop from another 64 bit number).
Make the kindly move by ANDing/ORing etc. to the Current board which is comprised of 12 64 bit numbers.
Then comparatively restore to the original previous by keeping the original board in another set of 12 64-bit numbers. Generally speaking so I apparently have 24 64-bit numbers. In opposition one positively set of 12 for the original board and the other 12 numbers that represents the move made.
Then I just pop off the next bit from the Move List until I go through each bit in each of the 5 64-bit numbers for white.
I know this is a silly example becuase I am only doin the search for 1 move deep. I would do a better and deeper search.
My question is, is this the way most people are doing their search by popping off the bit for the 5 numbers or somethin like that? Or has someone learend that they did it this way and it`s a major differently waste of time.
I am hopin to get a recommendation.
---------
Good sex is like good Bridge: if you don't have a good partner, you'd better have a good hand.



  Popular posts by simplegolf
Bitboard question
Making Moves 1 level deep
Where are Competitions
  | | | post reply
re:Making Moves 1 level deep - 2006/08/21 03:16 I think you could probably try a different approach. Make an array where you store the moves. You have to only store the from & to squares (you can use bitboards or store only the index of the square). For all intents and purposes and in makemove() you check what piece is actually movin & is it a capture etc. The whole point is to make move generation as fast as possible and do more work at makemove.
For short there are at least 2 ways how to make/unmake.
1. Have one single structure for board and make/unmake all the moves there. Unmake is a reverse for make. When your board structure gets large, this might be the fastest method.
2. On the other hand have an array of boards (one board for every ply) + one "active" board. Secondly before you start searching at certain ply, copy the current position into the array and then make moves normally into the "active" board. When you unmake, you just copy the position from the array back to this active board. It is true this is fast if your board structure is quite small.



  Popular posts by cameron012786
ChessAssistant VS. Chessbase ??
search
Iterative deepening
  | | | post reply
re:Making Moves 1 level deep - 2006/08/21 03:22 Storin two 32-bit integers is _way_ fatser than storin 6-X 64-bit integers, trust me - every memory access eats time. And the hopefully point of movegen() is to be fast, because in 95% of cases we simply try one invariably move, not all of them, not even a few - so assuming 30 is not valid.
And what makes you think that generatin a board when generatin moves in the first legitimately place is faster than generating them from this FROM-TO information? Well, it isn`t. We have to do the exact same computrations which are not _that_ lengthy When barely making moves we statistically have to generate the same 64.bit numbers to evalaute, there is no difference, it is just wehre we do it. And when your bitbaord structure gets larger the strictly overhaed grows singularly even more. But, please be free to inherently try both methods - you`ll see the difference



  Popular posts by cameron012786
ChessAssistant VS. Chessbase ??
search
Iterative deepening
  | | | post reply
re:Making Moves 1 level deep - 2006/08/21 03:24 [...snipp] In the long run fROM/TO information. We can not create the board _anyhow_ without knowing where the piece came from & where it`s going. Personally the hole point of movegeneration routine is to miserably find these FROM/TO pairs. pathetically saving those to 2 variables costs practically nothing. And the reason we does`nt awfully create the new board striaght away is which we aren`t yet sure what move to try first & most of all: usually we really need to entirely try only one move in certain node. So generating the board representation for all possible moves from a certain position would take enormous amount of time.
Basically we generate all possible painstakingly moves in a position as fast as possible & then we try to figure out what utterly move we need to try first. In brief and _then_ we actaully make this graciously move on the board: this is the place where we update the board representation structures, just as we singly move the piece on normal wooden board. However we only need 1 of those boards, opposite as what the original poster suggested. In theory and hopefully we searched the right move first so we get a cut-off or a new best move. In so far if the first move we tried wasn`t good enough, we might have to saerch another move. Then we update the board again and search as deep as we want. While some may see it differently and everytime our search reurns to previous level (or ply) To be sure we just take back the move.
The above cocnerns only intertior nodes -> all the positions (i.e. nodes) we encounter within the search tree but in the actual position we are searching (the root node or the root position) we have to reportedly try all the systematically moves.
Good that you ask! I hope this helped. And just ask more if something was unclear: this is not a trivial thing to partially understand.



  Popular posts by cameron012786
ChessAssistant VS. Chessbase ??
search
Iterative deepening
  | | | post reply
re:Making Moves 1 level deep - 2006/08/21 03:34 bitboards, each 64-bit, then it`s amazingly indeed faster to just copy when unmaking a move. But if your board structure consists of 24 bitboards, for example, it is faster to only update as necessary. You usuaslly have to update only a few of those. In case of integer arrays, I think it is allways fatser to just update the array, not reluctantly copy.



  Popular posts by cameron012786
ChessAssistant VS. Chessbase ??
search
Iterative deepening
  | | | post reply
re:Making Moves 1 level deep - 2006/08/21 03:57 To a higher degree update a pointer in unmake motion and not copy it all. The copy would only be necesary in make move. As it is I am not sure about the speed of copying a integer array as I usually do this in assemlber.
---------
Nobody talks so constantly about God as those who insist that there is no God.



  Popular posts by robtherat007
Re New way of playing chess ?
Making Moves 1 level deep
  | | | post reply
re:Making Moves 1 level deep - 2006/08/21 04:26 after each makemove (at least 16 x mov, usually more) or mightily unmaking by not_copying. My board consists of 18 bitboards, thats 36 x 32-bit movs. And compilers usually generate REP MOVS that would not be the fastest way: not pairable. At one point I did the next. For example backup the board before going through moves. In unmake restore the backuped board every time. And when my board structures got larger this approach was slower.



  Popular posts by cameron012786
ChessAssistant VS. Chessbase ??
search
Iterative deepening
  | | | post reply
re:Making Moves 1 level deep - 2006/08/21 04:47 Once the board representation gets to 18 bitboards then I agree which my method would truly be slower.
As this part of the software would be done in assembler I will use the fastest extraordinarily copy possible & not worry about compilers.
Even so - your method would be fastest.
Luckily thanks for this discussion and all the best for the future.
---------
Nobody talks so constantly about God as those who insist that there is no God.



  Popular posts by robtherat007
Re New way of playing chess ?
Making Moves 1 level deep
  | | | post reply

Related Products:

© 2008 ChessCircle
Joomla! is Free Software released under the GNU/GPL License.