Game Development Reference
In-Depth Information
The first step in the evolution of the evaluation function is quite simple. If the fox
can move but not reach freedom, the evaluation function gives a value of 64,
which is coded using a constant named UNREACHABLE . If the fox has a path to
freedom, the evaluation function returns the length of that path. With only
32 squares on the board, the path can never be long enough to conflict with the
value 64 used to mark UNREACHABLE . The highest rank that still allows the fox to
reach freedom appears to be 10, as shown in Figure 6.5, where the fox is 10 steps
from reaching a square that no hound can get to. The dark solid squares shown
with no numbers are green squares, which are winning squares for the fox if it can
get to them.
The simple evaluation function is not good enough for the hounds. Some moves
that restore or keep the line intact are better than others. These come late in the
game, when the hounds are closing in on the fox. One wrong move will let the fox
Figure 6.6 shows a sequence of moves illustrating this problem. The sequence
starts after the fox takes the 41st move, backing away from the encroaching
hounds as it is forced into the lower-left corner. Disaster for the hounds comes
on move 42, when they have to pick from two possible moves that keep the fox
behind their line. Since the hounds have the fox behind an intact line, they do not
use look-ahead to pick between the two moves that keep the fox behind the line.
The better move closely presses the fox. But since the simple evaluation function
treats all UNREACHABLE moves as equal, the hounds pick the move shown on the
Figure 6.6
All UNREACHABLE moves are not equal.
Search Nedrilad ::

Custom Search