Dann Corbit wrote:The magic of the zobrist hash is that it uses xor.
Since you are using xor, the same operation that added a chessman on a square is the operation to subtract the chessman.
Actually I have always considered that a weakness of the Zobrist scheme: for no clear advantage you cannot see the difference between two pieces on the same square or zero. So in my engines I always use additive Zobrist keys. Then I can place as many pieces as I want on the same square, without creating any ambiguity.
That way I need no kludges to hash the holdings of a Crazyhouse or Shogi game. In micro-Max an additional reason was that +- have better operator priorities than ^, so that they would not have to be protected by parentheses everywhere (saving some characters).
@Erick:
MVV sorting in QS (or something at least as good) is way more important than hashing, but it is not always obvious. When you play without something (LVA is a nice refinement, but not essential.) Without it, initially you hardly won't notice anything, perhaps a slowdown of 50% f you are lucky. But almost every game will go through a stage where you get a tremendous search explosion, when you don't sort the captures. You will then see the search depth drop from its normal 11 ply (say) to 3, 2 or sometimes even 1 ply. At that point the engine will play a horibleblunder, of course, so you basically lose every game.
Sorry for the formatting, not sure how to make it better. You can clearly see that the MVVLVA made a pretty drastic improvement on the time to search to a depth of 4 and the number of nodes searched to do it.
Weird thing is that playing a 40/3 Tourney The old one seems to hold his own say within 10 elo using Bayeselo stuff. Now granted I don't really have enough games yet, but I thought it would be more apparent. Oh well.
So now I'm going to look into null move pruning and then work on some eval tuning. I have the TT started and I'll go back to that when I run out of easier things to implement.
OK so remember when I said my evaluation was "pretty minimal". Well it turns out it was pretty bad too. I changed it and ran against my previous version and was 157-17-27!
I've now pitted myself against the bottom 4 int the 40/4 CCRL, trying to replicate their test conditions and that is running now. So the engines I'm going against are. ALChess 1.5b (1745), Zotron 4.4.6 (1683), Piranha 0.5 (1608), and MiniMardi 1.3 (1528).