Game Development Reference
In-Depth Information
Figure 6.4
Squares showing their numbering.
hound's move, we get six more boards for a total of 12. In our case, 12 is small
enough that we can ignore it, but the back-of-the-envelope check is always a
good idea.
The speed consideration can be dealt with by a time-honored method: ignoring
it unless it proves to be a problem. Unlike the space consideration, where the
numbers are trivial, our AI will take the time needed to create over a quarter-
million boards. The time required to make determinations about those boards is
the concern, not the time spent copying them; modern hardware copies memory
extremely rapidly. Ignoring potential speed issues is easy, and the use of the
profiling tools needed to find problem areas is beyond the scope of this topic.
Programmer time must be mentioned as a third vital resource. Time and care
spent along the way that prevent the program from wasting resources are an
investment. Time spent trying on early optimizations is wasted. Wasted time has
direct costs in terms of money and opportunity costs in terms of features that
cannot be added and deadlines that cannot be met. ''Premature optimization is
the root of all evil.'' [Knuth74]
 
Search Nedrilad ::




Custom Search