I've been working on a rewrite on my engine. It's in working condition and plays just fine. I've been trying to get LMR added, but nothing I do adds any improvement; Every change I try results in a small loss at best. I've looked at and tried things from the CPW and various engines. I've played around with most of the factors I can (as in, which moves to reduce and which not to). All that to say, I'm not just copying code from somewhere and wondering why it's not working. I've spent a few weeks, on and off, messing around with LMR at this point.
In general, I'm doing something like so (though I've also tried completely different blocks than the below):
Code: Select all
if (legalMoves === 0) {
// Full search
score = score = -this.Negamax(depth - 1, ply + 1, -beta, -alpha, childPVMoves);
}
else {
let R = 0;
// I've tried different things in this `if` condition
if (depth >= lmrDepthLimit && legalMoves >= lmrLegalMovesLimit && moveIsNotCapture && moveIsNotPromotion) {
// Reduced search
score = -this.Negamax(depth - 1 - R, ply + 1, -alpha - 1, -alpha, childPVMoves);
if (score > alpha) {
// Full search
score = -this.Negamax(depth - 1, ply + 1, -beta, -alpha, childPVMoves);
}
}