Escolar Documentos
Profissional Documentos
Cultura Documentos
Jonathan R. Hicks
Department of Computer Science Middle Tennessee State University Murfreesboro, TN 37132 jh2f@mtsu.edu
Joseph A. Driscoll
Department of Computer Science Middle Tennessee State University Murfreesboro, TN 37132 driscoll@mtsu.edu
powerful environments for experimentation with a particular branch of AI: evolutionary algorithms (EAs). EAs are methods inspired by biological evolution [1] to obtain solutions to many
ABSTRACT
Modern video game software implements very immersive, simulated worlds. These worlds benefit from highly sophisticated graphics and physics simulations provided by the software. The experiments presented here show that these complex simulated environments can provide an attractive research platform for evolutionary algorithms, specifically for the task of artificial agent evolution.
types of problems [7]. Such algorithms obtain solutions by searching through the space of all possible solutions. The search is not exhaustive, but rather guided by promising candidate solutions. Section 2, below, provides an overview of EAs. The work presented here focuses on the AI-controlled bots that serve as additional players in a video game environment. Such bots are capable of complex behaviors, and these behaviors are coordinated through a set of configuration values called traits. To create a new and more interesting bot, a human must change these values manually and then test the altered bot. This tedious process is then repeated many times until a bot is found that exhibits the desired behaviors. An evolutionary algorithm is well-suited to this sort of process [3], [7], and is the approach taken in this paper. The question is not simply whether or not an EA can be implemented in a game environment. Rather, this work goes further to ask whether the unique characteristics of an EA will still be present in such an environment. In other words, does the EA still behave like an EA in such an environment? Such fidelity is required if the EA/game environment is to be used for real research. Through three sets of experiments it is shown that our system is able to exhibit characteristics of evolutionary algorithms, which demonstrates that the system used, and games in general, can provide powerful environments for EA research.
General Terms
Design, Experimentation
Keywords
Evolutionary algorithms, virtual environments, artificial agents
1. INTRODUCTION
Video game software is highly sophisticated, owing to the complex graphics, physics, and other techniques employed [5]. Many of these games immerse players in very realistic environments, often using complex models of physics to accurately depict the various aspects of gameplay. In many of these games human-controlled players interact with each other as well as with artificially-intelligent players called bots. These games therefore represent highly-realistic, multi-agent environments. With the ability to customize the bots, such game environments are ideal for experimentation in many types of artificial intelligence (AI) research [5], [6]. The use of an existing, realistic simulation environment such as a video game allows researchers to focus on designing experiments rather than designing simulators. The goal of this work was to show that video games can serve as
2. EVOLUTIONARY ALGORITHMS
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. ACM Southeast Conference 05, March 18-20, 2005, Kennesaw, AL, USA. Copyright 2005 ACM 1-59593-059-0/05/0003$5.00.
Evolutionary algorithms (EAs) are methods inspired by theories of biological evolution that are able to find solutions to a wide variety of problems. Example applications include oil pipeline layout [2], robot control [8], and computer program induction [4]. These algorithms obtain results by intelligently searching through the space of possible solutions. The search is neither exhaustive nor random; it is guided by promising candidate solutions in a manner that mimics biological evolution.
2-365
To use an EA, one must first create a data structure to represent the form of possible solutions. This data structure is called a genome and is the general structure shared by all candidate solutions in a particular EA application. The genome contains variables (genes) rather than specific values. A particular solution has specific values (alleles) in these variables. As an example, assume that an EA is being used to find a set of three numbers that optimize a function. The genome for this task can simply be a list of three variables, (x, y, z), where each variable can contain a number. A candidate solution to this problem has particular values for the three numbers, for example (0.1, 0.4, 0.2). Some solutions will be better than others, or more fit, in terms of the goal (i.e., to optimize the function). In this example, the EA searches through a three-dimensional space to find a good solution. The search through this space is not random. When good solutions are found, new solutions are generated by modifying those good solutions. In an evolutionary algorithm many candidate solutions, called individuals, are considered simultaneously. The complete set of individuals under consideration at a given time is called a population. In the example above, an individual is a specific list of numbers. The population is the collection of all the lists of numbers currently under consideration. An EA begins with a random initial population. This population contains individuals that were generated by selecting random allele values for the genes. Each individual in the population is evaluated by a performance metric called a fitness function. This function reflects how good, or fit, each individual is as a solution to the task at hand. A selection process uses the fitness values to decide which of the individuals in the population will be selected to become parents. Many selection methods exist, but most are similar in that individuals with higher fitness are chosen as parents more often than less fit individuals. One popular selection method (and the one used in the current experiments) is tournament selection. In tournament selection, parents are chosen by repeatedly sampling the population using tournaments. A number of individuals are chosen at random. The particular number of individuals chosen is called the size of the tournament. The best individual (in terms of fitness) present in the chosen group is said to have won the tournament, and is selected as a parent. These tournaments continue as long as more parents are needed. By altering the size of the tournament, one can adjust how difficult it is to be selected, which is called the selection pressure. The selected parent individuals are allowed to breed in order to produce new individuals, called offspring. This is done through the use of genetic operators such as crossover and mutation. The main idea behind crossover is that two parents may have good building blocks (sets of alleles) that contribute to their fitness in a good way [2], [7]. Imagine the parental allele sets as two lists of values. Crossover selects a point, called a crossover point, in the lists (the same location for both lists). Offspring are generated by copying these parent lists. When the copying process reaches a crossover point, copying switches to the other parent. For example, prior to reaching a crossover point, offspring 1 is identical to parent 1, and the same for offspring 2 and parent
2. After the crossover point, allele values from parent 2 are copied to offspring 1. Similarly, alleles from parent 1 go to offspring 2. By moving entire subgroups of allele values from the parents to the offspring, crossover may combine good building blocks into one or both offspring, in such a way as to make the offspring even more fit than the parents. Of course, often the offspring are less fit, since the choice of crossover point is often random. But if a better offspring is produced even occasionally, then its better fitness should allow it to be chosen as a parent and therefore propagate its favorable allele set to future generations. Reproduction and mutation each require only a single parent. Reproduction simply creates an identical copy of a parent to generate an offspring. Mutation takes a parent and randomly changes one or more allele values to new, random values. Mutation is often considered to be needed since it can introduce a new allele value for a gene into the population [7]. Crossover and reproduction cannot do this, as they simply copy from parents. Mutation is the source of new alleles, and so is an important component of the exploration of the search space. Each time an offspring is to be created, an operator is chosen at random (with a probabilistic rate) to generate the offspring. These rates define the probabilities of each operator being used to generate the offspring. Sometimes multiple operators are used simultaneously. For example, two offspring can be produce by crossover, and then these offspring can be subjected to mutation. The newly created offspring make up a new population. This new population replaces the old, and this completes one generation of the evolutionary algorithm. The process repeats until some userspecified termination criterion is met, such as the creation of an individual with some desired level of fitness. The diagram in Figure 1 summarizes this process.
Breed Parents to Produce Offspring NO YES End Evolution Termination Criterion Met? Offspring Become Next Generations Population
Figure 1. General evolutionary algorithm. A central component of EAs is that offspring resemble parents. If parents are highly fit, then offspring are often highly fit also. Sometimes the offspring are less fit, but other times they are even more fit than the parents. Individuals with higher fitness values are more likely to be selected as parents than those with low fitness values, and so highly fit offspring are likely to become parents themselves. In this way the fit individuals guide evolution toward increasingly good solutions.
2-366
3. EXPERIMENTAL METHODS
This section presents the experimental methodology used for this work. The simulation environment is described, followed by an overview of the particular evolutionary algorithm used. Finally the three sets of experiments are discussed. Experimental results are presented and discussed in the next section.
2-367
points (10) to distribute to the various traits. These experiments go beyond the first set, in that they show that the system is capable of performing constrained optimization, which is another important characteristic of EAs [2], [7].
The average best score was 70.27, and the average number of generations to reach the best individual was 43.07. The utility of these results is in their use as a basis of comparison with the other types of experiments. In addition, they confirm that the EA can at least optimize traits in a simple manner. The remaining experiments provide more insight on the EAs abilities.
4.2 Knapsack
The same two averages computed for the first set were also computed for this set: the average best individual score, and the average number of generations to reach a best individual. For this set, these numbers were 73.77 and 81.67, respectively. The average best scores for the first two sets are similar. However, the second set of experiments took more generations to produce such bots than the first set. This difference is significant (t-test with 95% significance level) and shows that the second set took longer to reach a similar level of performance. The second set of experiments used the knapsack constraint (but did not use the useless traits), and so allowed a more sophisticated form of evolution. Skilled bots were evolved, but evolution took longer than with the first experiments (which did not suffer from any constraints). This shows that the constraint made the problem more difficult, but the EA was still able to solve it. This success demonstrates the EAs ability to perform constrained optimization, which is further evidence of EA-like behavior. More evidence is provided by the final set of experiments, discussed next.
4. RESULTS
In this section the results of the three experimental sets are discussed. For statistical significance [10], each of the three experiment types was performed 15 times, for a total of 45 experiments performed. Other details of statistical methods are given in the following discussion.
4.1 Baseline
The 15 experiments in this group each had a best individual, which had an associated fitness score. By averaging this best score across the 15 trials, an average best score was produced for these experiments. In addition, the generation number at which the best individual was produced was recorded for each generation. These values were averaged, producing an average number of generations before the best individual was produced.
2-368
4.3.2 Introns
To determine if the EA adapted to use useless genes to protect against destructive crossover (i.e., using the useless genes as introns), the destructive crossover rates were examined for the second and third experimental sets. These sets differed only in that the second set did not use useless genes, while the third set did. Both of these sets used the knapsack constraint. For a given experimental set, the destructive crossover rates for each of the 15 experimental trials were averaged. This produced two averages: the average destructive crossover rate for the experiments without useless genes, and the average for the experiments with useless genes. See Table 1 for a summary of the results. With the useless genes, destructive crossover went down in frequency, as compared to the experiments without useless genes. In addition, the useless genes allowed the non-destructive forms of crossover (constructive and neutral) to increase in frequency.
useless genes themselves had an effect similar to that of introns, protecting against destructive crossover. Both features are indicators of evolutionary behavior, and so support the overall goal of this work: to show that the EA, as implemented in the video game, can exhibit complex evolutionary behaviors needed for EA research.
6. REFERENCES
[1] Darwin, C. R. (1859). On the Origin of Species. John Murray, London. [2] Goldberg, D. E. and Kuo, C. H. (1987). "Genetic Algorithms in Pipeline Optimization," Journal of Computers in Civil Engineering 1, 128-141. [3] Holland, J.H. (1975). Adaptation in Natural and Artificial Systems. University of Michigan Press. [4] Koza, J. R. (1992). Genetic Programming: On the Programming of Computers by Natural Selection. MIT Press, Cambridge, MA. [5] Laird, J. E. (2002). Game engines in scientific research: Research in human-level AI using computer games. Communications of the ACM, Volume 45, Issue 1.
Table 1. Effect of Introns on Crossover. Set 2 Constructive Neutral Destructive 12.1% 0.796% 87.1% Set 3 12.2% 0.899% 86.9%
[6] Magerko, B., Laird, J. E., Assanie, M., Kerfoot, A., Stokes, D. (2004). AI Characters and Directors for Interactive Computer Games. Proceedings of the 2004 Innovative Applications of Artificial Intelligence Conference, San Jose, CA, July 2004. AAAI Press. [7] Mitchell, M. (1996). An Introduction to Genetic Algorithms. The MIT Press, Cambridge, Massachusetts.
5. CONCLUSIONS
This work has shown that a video game environment can be successfully used as a research platform. These immersive, threedimensional worlds are an ideal environment for advanced software AI agents. The superior graphics and physics simulations lets researchers focus on the underlying research goals and not as much on how to create an environment for their research. The first set of experiments simply provided a basis for comparison, which was useful in later experiments. The second set of experiments demonstrated the EAs ability to perform constrained optimization in the game environment. The final experimental set shows that the EA was able to use the useless genes in two important ways. First, evolutionary adaptation reduced the number points wasted in those traits. Second, the
[8] Nolfi S. and Floreano D. (2000). Evolutionary Robotics: The Biology, Intelligence, and Technology of Self-Organizing Machines. MIT Press/Bradford Books, Cambridge, MA. [9] Id Software. Quake III. Company web site at http://www.idsoftware.com/ [10] Walpole, R. E. and Myers, R. H. (1993). Probability and Statistics for Scientists and Engineers, Fifth Edition. Macmillan Publishing Company, New York.
2-369