target of others to get score points.
The health of a fighter is displayed as a number.
Health is lost if a combatant is wounded or fragged
and can be regained by running through the health
bonus in an arena. The game ends when the time
limit has been reached, or if a combatant reaches a
specified score.
A character may have its own strategies, such as
attack or retreat in the game. Some tactics may be
self-preservative or aggressive. Each tactic consists
of a few behaviors. Finding suitable parameters for
an intelligent character’s strategies and behaviors is
of major interest in this paper. These parameters
include attitudes used in fighting, offense or defense,
attack or ambush, vengefulness or frag easy target,
etc. The released Quake III source codes are used for
modification. The favorite goals, tactics, and
behaviors of a character can be altered in external
files. These files will be loaded prior to a game so
that the character’s actions in the game can be
changed accordingly.
3 THE EVOLVING METHOD
This section introduces a strategy of evolving an
intelligent gaming character which is able to win in
the first-person shooter, Free for All in the Quake III
Arena.
3.1 Designing the Behaviors
An AI mechanism is available for players to create a
character. The Dynamic Linking Libraries (DLLs)
consist of bot AI open source and bot AI library,
which can be called by the main program of the
Quake III during a game. The external bot files,
which specify a character’s name, weights setting,
and so on, will be loaded by programs of bot AI
library before a character joins the game.
The bot AI library is responsible for loading the
external bot files, perceiving and acting of a bot, and
controlling of certain bot’s behaviors. The bot AI
open source controls most of a bot’s behaviors. In
addition, a strategy and an action will be also
determined according to the description of a bot’s
behaviors and parameters in the external bot files.
3.2 Evolution of a Character
A bot’s abilities, behaviors, etc. are described in
parameters in the external bot files. A genetic
algorithm is applied to modify those parameters
described in the external bot file based on the
progress of a game.
Initial values are randomly generated for those
parameters before optimization begins. The
character is then allowed to play in a game; at the
end of the game, the performance of the character is
evaluated and a new set of parameters is decided
accordingly. The optimization process is repeated
until a stopping rule is met. The behavior parameters
are adjusted by the GA approach dynamically to
yield the best solution.
3.3 Evolution in the Game
Genetic algorithm is applied to search for an optimal
solution. The best agent evolves from inheritance,
selection, crossover, and mutation after generations.
Initially, randomly-selected individuals, which are
possible solutions to the best strategy in a game, are
created. Their performance is evaluated based on a
preset fitness function after a generation.
The goal in the game is to kill as many bots as
possible while trying not to be fragged. The fitness
function for bot i is defined as:
dkf
i
(1)
where k is the number of bots killed by bot i, d is the
number of times bot i was fragged to death, and α
and β are the weights of kill and death, respectively.
Agents with high fitness values can breed their
offspring. The evolution process is repeated until an
optimal solution is found or a maximum number of
generations is reached.
The strategies of an agent's behavior are encoded
in a character string. Thus, the chromosomes, which
are the behavior in a game, for bot i in generation j
are
ji
B
,
. The proposed method first generates n
agents in which chromosomes are given randomly.
Each one then takes turns playing against a built-in
bot, which is controlled by the Quake III AI. The
performance of all agents is then evaluated
according to Eq. (1). The chromosomes of b best-
performing agents are stored in a gene pool. The
chromosomes of v new bots are generated by
selecting these chromosomes in the pool randomly,
and proceeding to a crossover operation. A mutation
is completed by changing t of the chromosomes
generated from the crossover in each bot. The v
worst-performing bots in the generation are replaced
by the new offspring agents. Thus, the bots of the
next generation are bred by inheriting the best-
performing agents’ chromosomes, as well as their
crossover and mutation.
IJCCI2012-InternationalJointConferenceonComputationalIntelligence
266