Computers and Chess Annotation
[What to comment on]
[Using existing evaluations]
[Making annotations readable]
[New evaluation procedures]
[Implementation and Examples]
Computers play chess by creating trees of possible moves and evaluating
the resulting positions to determine which move (with best play by both
sides) leads to the best position. The evaluation functions used assess
various factors (material, King safety, etc) but typically return a
single score. The best programs can now compete with the best human
Most chess programs also offer an "analysis" facility which given a game
compares the moves played with the best move possible, displaying
the corresponding scores and move continuations. This is useful to
dedicated players but isn't like the annotated games seen in books
and newspapers. Annotation styles vary greatly, ranging from the
textless analysis of international journals like Informator,
to the wise-cracking style seen in some Sunday papers. We are hoping
to produce automated annotations that in style are between these 2
Some of the above annotations can be executed by making use of the
evaluation information calculated but then thrown away by programs.
Useful information can be gained both by looking
depth-wise and width-wise at the evaluation results
It would be easy, though boring, to have a Best was ... comment
after each sub-optimal move. The reader wants a variety of types of
comments, a variety of phrasing and few passages of silence. This can be
achieved by recording the types of comments made about each move and
trying not to repeat the type too soon. Randomly selecting from lists of
phrases with the same meaning will add interest.
- width - It's useful to look at the best 8 (say) moves and how good they
are. This will help characterise the position. For example
De Groot suggested that on average there were 2 good moves per position
on average (often 1, seldom more than 5) but initially players (especially
bad players) might consider far more moves.
- there may only be one good move
- there may be several moves that are equally good
- depth - It's useful to see how the goodness of a move varies according
to the depth of analysis. A move that shallowly is good could be
but if deeper analysis shows it to be bad then it's a tempting mistake.
A move that shallowly is bad but turns out good on deeper analysis might
be worth a !. So if the shallow and full-depth goodness of the best few
moves were known for each position then already some interesting
conclusions could be drawn
For example, suppose a histogram of a position's moves came out like this
(i.e. there's only one good move, but it's an obvious move). This is an
easy position! Alternatively, consider this situation
Here there's one good, 3 average moves and 2 bad moves. Unfortunately,
the bad moves are the most obvious ones to make. This is a difficult,
Experts and beginners might prefer a different balance between comments
and hard analysis. There may also be a need to treat games between
beginners differently to games between grand-masters.
Most computer programs annotate games move by move, missing out on
the chance to be wise after the event. Even humans, if forced to
annotate move-by move a game they're playing, can begin to look a bit silly.
Because of the horizon effect,
it's not uncommon for a program to assess a position as suddenly improved
even though the expected moves were played. By with-holding comment on
a move one can use hindsight or maybe moving averages to give better
Whole-game annotating may also make possible the retrospective identification
of plans and motives.
Eventually annotation-specific routines will be useful
Annotating, by providing methods to identify traps and difficult positions,
may lead to more interesting playing styles by programs.
We used crafty as a foundation
because it's a strong program that already
has an annotate facility. We've tried to disturb as few files as possible
(currently only annotate.c) even at the expense of efficiency. Some
old code is online - a newer version still under development is online too. Here are some
example games and implementation details.
Some terms and symbols that are commonly used in annotations can be translated into
- Use of an alternative evaluation function that returns an array of
- Pins, forks and skewers could be identified.
- The ability to create a list of positional strengths and weaknesses would
- Sometimes pattern-matching is a good way to identify "obvious" moves.
For example, if there are black pawns on c5 and d6, then black plays
e5, white might instinctively play Nd5.
- Unclear or sharp positions are important to identify. Some players
will steer towards them, others will accept a slightly inferior position
rather than have to face them. A routine to map out the 2D space of the
move-tree in terms of "turbulence" might be useful.
- Investigate "chessmaps" (July 2000 issue of Artificial Intelligence, p.235-250).
Back to the Computers and Chess page.
Updated: January 2003