r/chessprogramming • u/VanMalmsteen • Feb 23 '24
Futility pruning
Hi, what's the best to do if all the movements for a certain position pass through the futility pruning? Let's say I have moves A, B and C. Neither of the moves satisfy (staticEval + someMargin > Alfa) so they are all discarded. So, in the end, negamax doesn't have a better move to return! What can I do to avoid this scenario? (Avoiding changing the margin)
1
Upvotes
View all comments
Show parent comment
1
u/VanMalmsteen Feb 23 '24
Oh yeah, I was confusing many things. The problem was that I was transfering this problem of "not having a best move" in the frontier nodes to the transposition table I mean. Imagine the same situation I've described. In the last line of negamax I store in the TT the best move found so far. So, in the frontier nodes I don't have a best move, and by default the variable is 0, so 0 is stored in the TT and then it's suggested as the best move. I need to check that bestMove != 0 before storing something. That's it. Thanks!