I want to implement a handicap for my engine and I'm struggling with it. I using alpha-beta pruning.
In my current approach I set a variance variable in centipawns and let the engine choose a move in the variance range. An example with white to move and variance = 5;
25 d2d4 d5d7 ... 23 e2e4 e5e7 ... 20 b1c3 e5e7 ... 18 g1f3 d5d7 ... ...
In this case the engine can choose between the first three moves cause they are all in range of 20-25. A random move of those three is picked, all other moves are ignored.
I implemented this and let it run against my "best move engine". To my surprise in 200 games the "best move engine" wins like 95% of the time. Which is in my opinion way to high.
As I dove deeper I realized that the "variance engine" picks sometimes totally blunder moves. Like sacking a queen without any compensation. I triple checked the code for picking the "random" move in the variance range. Its perfectly fine. So I think my alpha-beta is the problem here. Some questions:
- Should alpha-beta in general be capable of implementing something like variance picking. If so, what could I have done wrong or what am I missing?
- Is there another way of implementing a handicap for an engine. Couldn't really find anything on the internet.