Code: Select all
// Start generating and searching moves
while(generationState < GEN_END)
{
switch(generationState){
case GEN_HASH: // Get the hash move
case GEN_CAPS: // Generate captures
case GEN_KILLERS: // Get killer moves
case GEN_NONCAPS: // Generate non captures
case GEN_LOSINGCAPS: // Get losing captures
}
boolean fprune = false;
if(generationState == GEN_NONCAPS && depth <= 2 && !isInCheck){
eval = evaluate();
if(depth == 1 && (eval+200) <= alpha){
fprune = true;
}
else if(depth == 2 && (eval+500) <= alpha){
fprune = true;
}
}
while(stillMoves){
board.makeMove();
if(fprune && !isInCheck(board)){
unmakeMove();
continue;
}
// Continue with search as usual
}
generationState++;
}
This may be theoretically sound or not, but at the very least I thought there whould be fewer nodes searched with this than without. However depending on the position this results in either a small decrease in visited nodes or a huge increase.
In self-play this results in about 70-80% losses as well.
I'm just stumped, what am I doing wrong here?