BrettVsop wrote:Current Code with Move Generator Evaluate
nodes 498139
time 43078
average 11.5
Without Move Generation Evaluate
node count 165033
time 10500
average 15.7
As you can see the node count for the commented out Move Generation Evaluate has alot less nodes. So this means for some reason Alpha Beta works better on this evaluate. The problem, of course, is that the moves kinda suck a little. Maybe I can replace it with something else that isn't as expensive?
I guess these figures are now from a 5-ply search from initial position, and still without QS, am I right?
Leaving out your mobility term seems not to give the nps speedup one might have expected at a first glance (15700 vs 11500 = +37%), so this was probably not the major performance bottleneck. On the other hand, as you stated, the pure material-only based search results in even worse play. So I would leave mobility in, although it is quite expensive.
Reduced number of nodes with material-only eval is not unexpected for me. A possible explanation would be that now there is a higher probability that many nodes get an identical evaluation, so the number of early cutoffs increases because many moves get refuted simply due to not winning material.
Nevertheless the branching factor seems to be quite high.
Examples for adding cheap evaluation terms are a piece-square table and the distance of each piece to the enemy king. Detecting whether the king is protected well by own pawns is also quite simple, and if he is not, you might penalize a king on e1/e8 when both castle rights are lost. Possessing the pair of bishops, or a Rook or Queen on 7th rank are cheap terms, too. All these should have different weights depending on game phase (opening/endgame).
A more detailled analysis of king safety, pawn structure and especially passed pawns might become necessary to become competitive somehow, but evaluating these terms is a bit more expensive.
Btw another question, how do you implement the legality check within your move generator? Do you make/unmake each single move and determine whether the king is left in (or put into) check, or do you restrict legality tests to king moves, moves when being in check, and moves of pinned pieces?
Sven