22
A.M. Mora, M.A. Moreno, J.J. Merelo, P.A. Castillo, M.G. Arenas, J.L.J. Laredo Dpto. ATC University of Granada CIG2010

Evolving the Cooperative Behaviour in Unreal Bots

Embed Size (px)

DESCRIPTION

This work presents a research of the improvement of the Team AI in Unreal Tournament Bots by means of a Genetic Algorithm, which evolves the set of parameters that determines the behaviour of a bot inside a team. Presented at IEEE Computer Intelligence and Games (CIG 2010). IT University of Copenhagen, Denmark. -------------------------------------------------- Este trabajo presenta la investigación llevada a cabo para mejorar la IA de los Bots en Unreal Tournament cuando éstos están dentro de un equipo. Para ello se ha utilizado un Algoritmo Genético que evoluciona el conjunto de parámetros de los que depende el comportamiento de un Bot dentro de un equipo. Presentada en el IEEE CIG 2010 (ITU, Copenhague, Dinamarca).

Citation preview

Page 1: Evolving the Cooperative Behaviour in Unreal Bots

A.M. Mora, M.A. Moreno, J.J. Merelo, P.A. Castillo, M.G. Arenas, J.L.J. Laredo

Dpto. ATC

University of Granada

CIG2010

Page 2: Evolving the Cooperative Behaviour in Unreal Bots

CIG2010

Unreal? GAs? Teams? Results? Conclusions? That’s all?

· · · · · · · · · · · · · · · · · ·

·

Page 3: Evolving the Cooperative Behaviour in Unreal Bots

It is a First Person Shooter (FPS): Very famous since 1998, because it had an excellent enemies’ AI, so it was (and is) a very good game for multiplayer battlematches between users and the so-called Bots (authonomous players).

CIG2010

· · · · · · · · · · · · · · · · · ·

·

Page 4: Evolving the Cooperative Behaviour in Unreal Bots

It offers the Unreal Editor (included with the game): It is easy to create Mods:

CIG2010

· · · · · · · · · · · · · · · · ·

·

Page 5: Evolving the Cooperative Behaviour in Unreal Bots

There is an own language (UnrealScript). The editor is also an IDE, since it is possible to access the whole tree of classes, and write and compile new code inside it. But it has some flaws such as a limited size for arrays, its is slower than other languages, or the dificulty to debug the code.

CIG2010

· · · · · · · · · · · · · · · ·

·

Page 6: Evolving the Cooperative Behaviour in Unreal Bots

It is based on a Finite State Machine:

CIG2010

· · · · · · · · · · · · · · ·

·

Exa

mpl

e: S

tate

Roa

min

g

Page 7: Evolving the Cooperative Behaviour in Unreal Bots

A Bot decides what to do (changing between the states and substates) in the FSM depending on some parameters or thresholds. For instance: (in Roaming state)

IF distance_to_enemy() < MIN_DIST_SHOOT THEN

go_to_state(Attacking)

In addition, there are some values used to calculate others, such as penalties, multiplication factors, etc.

CIG2010

· · · · · · · · · · · · · ·

·

Page 8: Evolving the Cooperative Behaviour in Unreal Bots

Put them into

an array

CIG2010

· · · · · · · · · · · · ·

·

Identify the ‘main’

set of parameters

Evolve it with an Evolutionary Algorithm

(Genetic Algorithm)

Page 9: Evolving the Cooperative Behaviour in Unreal Bots

CIG2010

· · · · · · · · · · · ·

·

Created by Johann Dréo

Page 10: Evolving the Cooperative Behaviour in Unreal Bots

CIG2010

· · · · · · · · · ·

·

Genetic Algorithm

based bot (GA-Bot)

GA

EVOLUTIONARY

PROCESS

Std

AI

population

Std

AI

Std

AI

FITNESS EVALUATION

Page 11: Evolving the Cooperative Behaviour in Unreal Bots

Put them into

an array

CIG2010

· · · · · · · · ·

·

Identify the ‘main’

set of parameters

(for a Team)

Evolve it with an Evolutionary Algorithm

(Genetic Algorithm)

Page 12: Evolving the Cooperative Behaviour in Unreal Bots

CIG2010

· · · · · · · · ·

·

Genetic Algorithm

based team of bots

(GT-Bot)

GA

EVOLUTIONARY

PROCESS

population

FITNESS EVALUATION

Std

AI Std

AI

Std

AI

vs

OR

Page 13: Evolving the Cooperative Behaviour in Unreal Bots

CIG2010

· · · · · · · ·

·

cr-Team All the bots in the team have the same chromosome.

cr-Bot Every bot in the team has a different chromosome. A shape of co-evolution.

Page 14: Evolving the Cooperative Behaviour in Unreal Bots

The set of thresholds and parameters to consider in a Team evolution is:

CIG2010

· · · · · · ·

·

Page 15: Evolving the Cooperative Behaviour in Unreal Bots

The real-coded GA we have used in this work considers: Chromosome Lentgh 40 Population size 30

Number of Generations 30 Simple Gene Mutation

Mutation probability 0.01 Two point crossover Crossover probability 0.6 Time per chromosome 90 seconds

CIG2010

· · · · · ·

·

Page 16: Evolving the Cooperative Behaviour in Unreal Bots

And the Fitness Function: Each team is evaluated after 90 seconds The fitness is a sumatory considering the bots’ results: - number of frags - times defeated - number of items collected - weapons collected - power of weapons

CIG2010

· · · ·

·

Page 17: Evolving the Cooperative Behaviour in Unreal Bots

1 cr-Bot based Team (2 Bots) vs 3 standard 2-bots teams

CIG2010

· · · ·

Page 18: Evolving the Cooperative Behaviour in Unreal Bots

1 cr-Team based Team (2 Bots) vs 3 standard 2-bots teams

CIG2010

· · · ·

Page 19: Evolving the Cooperative Behaviour in Unreal Bots

1 cr-Team based Team (4 Bots) vs 3 standard 4-bots teams

CIG2010

· · ·

Page 20: Evolving the Cooperative Behaviour in Unreal Bots

1 cr-Bot based Team (2 Bots) vs 1 cr-Team based Team (2 bots) vs 2 standard 2-bots teams

CIG2010

· ·

vs

Page 21: Evolving the Cooperative Behaviour in Unreal Bots

We have improved the AI of Unreal Bots using a Genetic Algorithm, so they can behave better in a team. We have implemented 2 approaches:

• one based in having a different set of parameters per bot (co-evolution) – cr-Bot • another based in sharing all the bots in the team the same set of parameters – cr-Team

The results show that both approaches performs better than the standard bots and the cr-Team is the best of them. FUTURE WORK: - perform more experiments - improve the FSM of the AI for teams (sets of rules)

CIG2010

Page 22: Evolving the Cooperative Behaviour in Unreal Bots

CIG2010

Questions?

Contact: [email protected]