|
|
It is easy to assign a score to checkmate -- it's just a large positive number, and if you are getting mated it's just a large negative number. It is harder to decide what value to assign to a draw. A draw can be something that a program should be happy with, if for instance it is playing against something stronger than it is, but it can also be a sort of defeat, if for instance the program is playing against a very weak player. A contempt factor is just another name for a draw score, with the implication that the draw score is adjusted in order to reflect the desirability or undesirability of a draw. It is typical to use a contempt factor that is slightly negative, so the program will attempt to win even if it is slight worse, but some programs don't use a contempt factor at all, and return zero as the draw score. I think that it may make sense to return a different contempt score depending upon what is going on in the game. If it is a tough middlegame that the program is doing a little worse in, which is often the case when the program is playing black, it may make sense to use a larger negative value, so the program will play for a win under these conditions. In endings with even material, zero is probably fine. The only trick I can think of to implementing a contempt factor is that the value must be negated in some cases, depending upon who is to move. If it's not, the score can have the wrong sign when it's returned up the alpha-beta tree. I think a good opening-phase contempt value is -0.50 pawns. A good general-purpose contempt factor is -0.25. In endgames, 0.00 is suitable, or a value that is not very negative at all. It is a bad idea to play into a pawn ending with a negative evaluation. |
Send mail to
brucemo@seanet.com with
questions or comments about this web site.
|