I've looked through the other posts about counting nodes and the consensus seems to be that you should do it after each make move in your alpha beta/qsearch.
The problem I've found in my code is that I'm inconsistent whether nodes get counted when the move is pruned.
My move loop in alphabeta looks like this:
Code: Select all
for (each move) {
if (history pruning conditions) {
continue;
}
if (SEE pruning conditions) {
continue;
}
makeMove(move);
nodesSearched++;
if (futility pruning conditions) {
unmakeMove(move);
continue;
}
score = -alphaBeta(...);
unmakeMove(move);
// rest of move loop
}
The reason I have to check futility pruning after making the move is because I can only see if a move gives check after making the move.
It seems that nodes shouldn't get counted if they're pruned, so should I be adding nodesSearched-- when the futility pruning condition holds?