Game Development Reference
In-Depth Information
the fox in a worse position, the hounds are fine. As we shall see, this was not
always the case; the hounds pruned potential fox moves that the hounds needed
As it turned out, fixing the problem had an impact on the style of play shown by
the hounds. The hounds like it when the fox has fewer moves available to it. So
when reforming their line, their look-ahead could see a sequence of moves that
reformed the line quickly and a different sequence of moves that reformed the line
a few moves later. The first option left the fox more room than the second option.
Early versions of the evaluation function preferred the second option because it
hemmed in the fox better, which is closer to the winning condition of hemming in
the fox completely. As long as the fox took the shortest path, the hounds would
''toy'' with the fox and slam the door at the last possible moment. It worked fine
when the fox behaved as predicted, but could be made to fail if the fox took a
different path than expected. The fix meant that the hounds prefer moves that
reform their line as soon as possible, with ties broken by how hemmed in the move
leaves the fox. The fix makes for more effective but less flashy play by the hounds.
There are two heuristics involved here. One says, ''Reforming the line is good'';
the other says, ''Hemming in the fox is good.'' A few chapters earlier, we solved
the issue of ambiguous transitions in FSM by prioritizing them. Here, we have a
similar issue with competing heuristics that also require proper prioritization.
Both heuristics apply; neither is broken, but we have to be intentional about
which takes precedence.
Both Tic-Tac-Toe and Fox and Hounds benefit from having discrete moves.
While this is true of many computer games, it is not true for an even larger
number. American football is played in discrete turns, but soccer and hockey
feature nearly continuous play. When we have to deal with continuous games, we
transform the complex possibilities into as few discrete buckets as we can get
away with because we know that the number of buckets is going to get multiplied
many times. Terrain is often treated this way. Continuous terrain gets imple-
mented as a set of discrete tiles. All the different possible movements to different
points on a given tile can be reduced to a single move, ''Move to this tile.'' The
tiles provide our buckets. Sometimes the tiles are even grouped into regions to
keep the number of buckets manageable. A small number of buckets is in conflict
with the richness of the possibilities; too few, and the AI appears dumb. But too

Custom Search