This question already has an answer here:
- How do chess engines “think”? 5 answers
How do chess engines actually evaluate a position? I am looking for a technical answer, not a general summary of how minimax works, I already know how minimax and alpha-beta, etc, work, so please do not reiterate generalities. I am interested specifically in the evaluation function.
My understanding is that the evaluation of a position is the same as evaluation of the leaf of the decision tree given best play by both sides. So, the problem then is how is each leaf evaluated? Obviously, whatever algorithm is used must be very fast because millions of leafs are evaluated. So, if this is right, then evaluation simply reduces to how a leaf position is evaluated.
The two methods for leaf evaluation that I know of are material balance and king safety. However, I suspect that it must be more complicated than this, otherwise evaluations would not have such fractional values. For example, there are many positions where both sides have the same material and perfectly safe kings. So, in those cases we would expect an evaluation of "0.00". However, in actuality the engine I use (Rybka) never has such an evaluation (unless it is a draw). It's evaluation of such positions is always something like "0.13" or "-0.05" or "0.07". So, obviously it is doing something more than just material+king safety. How does it come up with the number?