Game Development Reference
In-Depth Information
hopefully be more fit than any of their parents. The best are emphasized for
further improvement, possibly along with a small number of less-fit individuals
in order to keep the diversity of the population high. The best need not be
restricted to children of the current generation; it could include members from
older generations as well. We continue until we have a good reason to stop. Let us
expand on the concepts of this paragraph in detail.
In programming terms, our variables to tune are the characteristics of our
individuals. Each of the angles used in wheel alignment is a characteristic. The
braking proportion is another. For production vehicles, you might think that
these values have already been optimized by the factory, but the factory settings
may degrade lap times to decrease tire wear or increase stability. Even relatively
uncompromising road-legal sports cars such as the Lotus Elise are specified for
road use and need to be tuned for optimal track handling; specialized vehicles
also offer room for improvement on the track.
Selection requires a way to tell which individual is more fit than another. At first
blush, we can pick lap time as the fitness function. Why would lap time not be the
best fitness function? Most races run more than one lap. One of the compromises
in street specifications for wheel alignment is a trade-off between handling and
tire wear. Do racers care about tire wear? Racers care about the lowest total time
to complete the race (or the farthest distance traveled in a given time period in
endurance racing). There is more to it than stringing together a sequence of fast
laps. Time spent changing tires might or might not have an impact. Autocross
racers have trouble keeping their tires warm between runs and might not wear
out a fresh set of tires in an entire day's competition. Things are very different in
NASCAR, especially at tire-hungry tracks such as Talladega. The point is that
great care must be taken in selecting a fitness function for a genetic algorithm, or
your system will tune for the wrong situation. In motorsports games, as in real
life, vehicles are often tuned to individual tracks.
Hidden in the selection criteria is the cost of the fitness function. In our
motorsports case, we have to simulate a lap or possibly an entire race with each
member of the new population that we want to evaluate. In our case, not only do
we have to run a simulated race, but we need a good driver AI. We are going to
optimize the car not only for a particular track but also for a particular driver.
The cost to mix and match characteristics is typically quite modest when com-
pared to the cost to evaluate them. Not only do we have to select for the right
thing, but the very act of measuring for selection must have a reasonable cost.
Search Nedrilad ::

Custom Search