The use of intelligent agents to

odecrackAI and Robotics

Oct 29, 2013 (3 years and 9 months ago)

83 views

James Foley
-

0604261

Page
1

of
17

University of Abertay

Dundee



School of computing & advance technology

April 2007







The use of intelligent agents to

perform terrain analysis in video games



James Foley

0602621






James Foley
-

0604261

Page
2

of
17

Table of Contents

PROJECT PROPOSAL DOCUMENT

RUNNING TITLE

4

1
INTRODUCTION

4

2 PROJECT AIM AND OVERVIEW

5


2.1 P
ROJECT
A
IM

5


2.2 P
ROJECT
O
VERVIEW

6


2.2.1 Benefits of terrain analysis

6


2.3 Methods

7


2.3.1 Methods of terrain analysis

7


2.3.2 Terrain Analysi
s method selection

8


2.3.3 Agent types

9


2.3.4 Intelligent Agents method selection

12


2.4 Evaluation of the effectiveness of intelligent agents for terrain analysis

12

3 PROJECT OBJECTIVES AND MAJOR TASKS

12


3.1

O
BJECTIVE

12


3.2 M
AJOR
T
ASKS

13

4 HOW EACH OBJECTIVE IS PLANNED TO BE ACCOMPLISHED

13

5 SPECIFIC RESOURCES REQUIRED

15

6 PROJECT SCHEDULE

1
5

7 OVERVIEW PROJECT PLAN

1
5

8 REFERENCES:

16

James Foley
-

0604261

Page
3

of
17

PROJECT PROPOSAL DOCUMENT


8.1

B
OOKS

16


8.2

W
ebsite
s

16


8.3

Additi
onal Material

16






















James Foley
-

0604261

Page
4

of
17

PROJECT PROPOSAL DOCUMENT


RUNNING TITLE

Investigation into the merits of using intelligent agents to perform terrain analysis in video games

1.0 INTRODUCTION


Terrain analysis is a technique first created for use
in real time strategy games. It was born of a need
to be able to supply information about the map to various systems in the game. Typically, the
terrain analysis will abstract information about the map into easily digestible chunks of data that
other game

systems can use to make decisions. [1]

This kind of information is obviously quiet useful in real time strategy games, as it allows the
overall commander AI to marshal their troops in an effective manner. However, terrain analysis is
not limited to the re
al time strategy genre. In action game, for example, creating intelligent agents
with the ability to analyse the surrounding terrain, would give them the ability to make their
decisions based on the context of the world around them.


By “analyse the surrou
nding terrain” we are referring to the agents ability to view it's
surrounding environment as a human player might. Instead of seeing a series of nodes, which it
must use to plot the shortest point from A to B, the agent will interpret these nodes and thei
r
positions to form a view of the world, seeing “high ground” or “narrow passageway” as opposed to
just another node.


With this information to hand, the agent can then reason how best to achieve it's current
goal. For example, if you were playing a squad

based tactical game, like serrias'
SWAT 4
, or
UFO:
aftershock

from Altar, you might ask some of the agents you control to lay down suppression fire
on a door where you suspect that some enemy agents may emerge. Without terrain analysis the
agents wouldn't

realise that the door was the target of the suppression fire, not the wall behind it.

Likewise, if the agent realises that the door is the target, when they make contact with the enemy,
James Foley
-

0604261

Page
5

of
17

they would be able to reason that a well placed grenade through the
door would help to kill any
agents that had retreated back inside the building.


In real time strategy games, this kind of awareness would have been provided by an
influence map, which would show the doorway in the above example to be an area the agents
sh
ould focus on, likewise if an area has been the site of many costly ambushes for the commander
AI, it would take measures to avoid this area.


This approach has two drawbacks in games from an action game perspective. Firstly,
the influence map assumes that

there is an omnipresent commander that would recognise the site of
previous encounters and their outcomes. This makes no sense in an action game, as any agents who
had previously encountered a good ambush would be dead, and unable to relay any information

on
to team
-
mates.


Secondly, while influence maps can have varying values, through techniques like
Influence Propagation and falloff [2], they tend to be somewhat static. By using intelligent agents to
infer knowledge from the game world and act on this
ads an element of unpredictability to the
agents’ actions, as two different actions could look at the same situation and come up with two
different plans.


Finally, as pointed out by William van der Sterren [3], a large amount of time is spent
tweaking le
vel nodes, and other items that give information to AI agents in games. If the AI capable
of automatically annotating the level itself will save the level designer time and effort.

2.

PROJECT AIM AND OVERVIEW


2.1
P
roject aim

The aim of this project is to in
vestigate methods to allow intelligent agents to analyse the terrain
around them, and to use this information to plan their moves in the game world. The methods
chosen will then be compared against more traditional methods, like influence maps and waypoint
s
for effectiveness, both in terms of processing power and the illusion of intelligence.

James Foley
-

0604261

Page
6

of
17


2.2
P
roject overview

As processors increase in power it becomes possible to move away from pre
-
computed solutions to
creating the illusion of intelligence in your gam
es and more towards dynamic, intelligent agents.
However the use of intelligent agents is not a solution in itself, these must be tempered with an
understanding of the benefits of these solutions, and what level of granularity will be necessary for
the typ
e of game it's being applied to.

2.2.1
B
enefits of terrain analysis

Among the benefits of using intelligent agents with terrain analysis in games are



Understanding the terrain as a human player would


With terrain analysis it becomes possible for agents to

make the kind of distinctions
about terrain that human players do instinctively. As in the previous example, understanding that
the point to lay covering fire on is a doorway, as opposed to a set of world co
-
ordinates allows the
agents to react to the si
tuation that they have been presented with, as opposed to just blindly firing
until they are told to stop



Being able to recognise the

tactical advantages of terrain


Using the terrain to your advantage is something human players do instinctively, for
examp
le, ambushing from areas of good cover, and waiting until their victim is caught out in the
open. An AI agent that displays these traits when positioning itself comes across as being
intelligent.



Easing t
he workload of a level designer


Without some method

of being able to recognise the terrain around it, an agent must get
its information about the terrain from information contained within waypoints. The tweaking of
these waypoints is time consuming for level designers [3]. By introducing agents that are ab
le to
infer this information on their own, it takes a great deal of the burden of the level designers.


James Foley
-

0604261

Page
7

of
17



Incorporating the terrain into tactical plans


Having an agent recognise the terrain and position itself accordingly is not the full
extent of terrain a
nalysis. Incorporating the same information into an agents plan for advancing and
attacking would allow for a fully rounded agent, displaying the kind of environmental awareness
that most human players do

2.3
Methods

2.3.1
M
ethods of terrain analysis

Terra
in analysis consists of two parts, firstly is terrain representation. This is the method of taking a
human friendly view of the game world, such as a “doorway” or “open plain” and expressing it in a
way that an agent can understand. Given the volume of raw

data that a single level contains, it isn't
feasible to represent this in terms of geometries, or a rule bases or neural nets. An often used
method of describing a level are way points. Waypoints represent a subset of the overall terrain, and
the paths be
tween them represent valid paths of movement. These waypoints can be annotated by
the presence of powerups, or be grouped into larger areas (see waypoint volumes). Waypoints are
quite common on most action games, but are usually not referred to for anythin
g more than simple
navigation. Terrain analysis uses and expands the information held by a waypoint to allow agents to

reason about terrain and use this information to achieve its goals.


The second part of terrain analysis is the use of functions to crea
te, manipulate and
query the terrain as represented by the waypoints. Some of the techniques that can be used are




Waypoint Evaluation

Waypoint evaluation is the technique to calculate certain properties of a waypoint. For example
how many other nodes can
see the current node point, which relates to how exposed this node point
is. If a low number of nodes can see the current node point, then it has a low visibility, and the
opposite holds true. A node point that can be seen by a large number of neighbouring

nodes would
be highly visible.

James Foley
-

0604261

Page
8

of
17







Fig 1: The Unevaluated nodes (left) and the evaluated for visibility (right) [4]

This can also be used to calculate choke or pinch points in the game world, as detailed by linden
[4]. These kinds of calculations are
expensive, but thankfully, can be pre compiled off
-
line before
the game is loaded.



Waypoint graphs

While waypoints have the ability to show the shortest point between A and B, they have other, less
immediately apparent uses. For example, but graphing the w
aypoint in an area, you get rough map
of the surrounding area. This will allow the agents to establish the layout of the level, and if coupled
with line of sight and line of fire algorithms will help to form the basis of tactics.

Fig 1: Waypoints expressi
ng the shape of the level (left) and the same waypoints ingame (right) [3]



Waypoint Volumes

This is the grouping of series of similar waypoints into a high level abstraction, such as a room,
corridor or enemy base. These allow for high level decision makin
g, for example, if the agent
comes across a group of nodes designated as a tunnel, near a larger group designated as enemy
base, it can reasonably infer that this tunnel is controlled by the enemy, and that they should
proceed with caution, or retreat.

James Foley
-

0604261

Page
9

of
17



Env
ironment information

The waypoint can also be used to record information about the environment at that point, for
example, the lighting levels, the presence of water or other obstacles, and the presence of world
entities, like doors.


Using these methods o
f quantifying the terrain and inferring from it, we can then begin to see how
an agent would use this information to analyse and interact with the terrain. For example, if an
agent wishes to ambush anyone exiting from a building. The agent will check all n
earby nodes for
their suitability as an ambush position, using the criteria of the waypoint having a low visibility,
having a line of sight and line of fire on the exit from the building. Other factors would be
environmental conditions that would help to c
onceal the player from others, such as low light.


If a point meets these criteria, then the agent will lay in wait for their prey, if there are
none nearby the agent will either expand its search criteria, or re evaluate its original plan.


2.3.2
Terrain
Analysis method selection

Of the four methods above, two of them, Waypoint Evaluation and graphs, are essential. They form
the backbone of terrain analysis by providing essential information to an agent about the world
around it. After those two, waypoint
volumes, while not essential, does provide useful information
when dealing with long term goals, and the environment information is the least important of the
four techniques, but as games become graphically more impressive and environment effects become
m
ore commonplace, having IA being able to distinguish between shadows and light and other
environmental concerns would be a desirable ability.

With this in mind, the project will use three of the four techniques, that is Waypoint Evaluation,
graphs and volu
mes, and only the most vital parts of environment information will be used, such as
the presence of natural obstacles like water or doors.

This level of terrain analysis should be sufficient for this project as it will supply ample information
James Foley
-

0604261

Page
10

of
17

to the IA ab
out the surrounding game world as to allow for effective reasoning.


2.3.3
Agent types


There are four basic groupings which most intelligent agents fall under



simple reflex/
Reactive Agents

agents

[5][6]

Simple reflex agents acts only on the basis of th
e current percept, as in it operates on a series of
condition
-
action rules
. This approach works only when the environment is fully observable.

The agent’s goals are only implicitly represented by the rules, thus making it inflexible and unable
to deal wi
th situations that may have been overlooked by the programmer. The main advantage of
reactive agents is that they react very fast, but this reactive nature makes long term planning
impossible.

In general this kind of agent isn't much use in video games, bu
t makes a good base case for testing
other agent types against



model
-
based reflex/
Triggering

agents
[5][6]

Triggering agents can handle partially observable environments. Its current state is stored inside the
agent maintaining some kind of structure which

describes the part of the world which cannot be
seen. This
behaviour

requires information on how the world behaves and works. This additional
information completes the “World View” model. Triggering agents are the most common type of
agents used in games
today, where FSM are used to implement this
approach
.

However this still shares the same weakness of simple reflex agents that it cannot work beyond the
rules that have been hard wired into it by programmers, or previously learned by the agent via
neural
networks.



Deliberative Agents

[6]

Deliberative agents

are model
-
based agents which store information regarding situations that are
desirable.
The goals and a world model containing information about the application requirements
James Foley
-

0604261

Page
11

of
17

and consequences of actions

are represented explicitly. An internal refinement
-
based planning

system uses the world model’s information to build a plan that achieves the agent’s goals.
Deliberative agents have no problems planning for long term goals, and the restrictive rule based
system can be abandoned, as the plan system can create goal based actions on its own.

The downside of this approach is the heavy cost of constantly reforming plans to deal with every
occasion where the situation is different to the one that was anticipate
d by the planning process.

This kind of process heavy approach is not viable for real time environment like video games



Hybrid Agents

[6]

Hybrid agents, as the name suggests, combines two planning methods to achieve its goals. These
are a traditional off
-
l
ine deliberative planner
for higher
-
level planning and leave decisions about
minor refinement alternatives of single plan steps to a reactive component. This approach has a
distinct separation of high level planning (off
-
line) and hard
-
wired reactions. Ho
wever this
approach isn't suitable for video games due to the fact that the off
-
line planning is still too slow for
a dynamic real
-
time world. Off
-
line planning would, if given enough computation time eventually
lag behind events to the point where plans w
ould be made for situations that had already passed.



Any time Agents

[6]

Any time
agents work

by a cycle of continuous transition from reaction to planning. No matter how

much the agent has already computed, there must always be a plan available. This can
be achieved
by improving the plan iteratively. When an agent is called to execute its next action, it improves its
current plan until its computation time limit is reached and then executes the action.

For short term goals, very primitive plans are created

such as “
Walk over to the door
” while longer
computational cycles are used to refine the overall plan. The more time that is available for
computations the more intelligent the agent will be, and it's iterative method of refining plans
means that it can
adapt to situations quite easily. This class of agent are becoming very important in
video games, as it offers the illusion of intelligence and flexibility that triggering agents cannot
match.

James Foley
-

0604261

Page
12

of
17

2.3.4

Intelligent Agents method selection

For this project, the

agent that will be used will be a triggering agent. While the anytime agent is far
more flexible and has greater potential for games, this is countered by the fact that given the time
-
scale of the project implementing anytime agents would take far too muc
h time and lower the
overall quality of the project.


Also, despite its advantages, anytime agents are not as prevalent within games as
triggering agents yet. With this in mind, it makes more sense to pair terrain analysis with a tried and
tested agent m
ethod rather than a newer technique.


2.4
Evaluation of the effectiveness of intelligent agents for terrain analysis

In order to measure the effectiveness of intelligent agents for terrain analysis, two kinds of
intelligent agents will be available for te
sting. The first will be a simple reactive agent, while this is
too limited to be a viable option for games development, it provides a base case for comparing other
forms of agent against. The type of agent that will be compared against this base case is
going to be
a triggering agent.


These agents will be compared on the basis of the resources they use, their effectiveness
at achieving goals set out for it, and on how well it portray
s the illusion of intelligence.

3.0 PROJECT OBJECTIVES AND MAJOR TASKS


3.1
Objectives

The objective of this project is to investigate the technique of terrain analysis by intelligent agents,
to analyse its strengths and weaknesses and then to create a program to demonstrate this technique.
Building this demonstration program

should help improve my understanding of the subject matter,
while investigating the background material will allow me to gain experience in scientific research.

At the end of this project the most appropriate methods of terrain analysis and intelligent ag
ents will
be presented and discussed

James Foley
-

0604261

Page
13

of
17

3.2

M
ajor tasks

The project involves completing the tasks below:



Reviewing any relevant papers on the subject of terrain analysis in video games



Comparing the methods for gathering, inferring and manipulating terrain da
ta on the basis of
suitability. Some methods suit fast paced DeathMatch games better, while others will suit
slow paced tactical shooters



Identify the methods that suit the needs of the demo program



Decide how to create the program, will it be a modificati
on of an existing game, or
something built from scratch



Plan the implementation of the requirements of the project, with regard to the previous
decision



Create first prototype of the demo, showing basic proof of concept



Implement the demo fully



Present a w
ell documented and explained final demo


4.

HOW EACH OBJECTIVE IS PLANNED TO BE ACCOMPLISHED


The plan for achieving my objectives will be based on the task defined in section 3.2

of this document as follow:

Step 1:


This step will involve the collection of
web articles, books and journals that are related to the area
of terrain analysis and intelligent agents in video games. These will then be checked for current
relevance, and the author checked to see what articles published before or industry experience t
hey
have. Finally the relevant data will be grouped together and the ideas within ranked based on their
merits.

Step 2 & Step 3:

James Foley
-

0604261

Page
14

of
17

This step will be in two parts, firstly a decision will have to be made as to the kind of action game
that will be demonstrated
, a fast paced DeathMatch game, or a tactical shooter. This will be based
on the data collected from step one.

Once that’s done, the techniques from step one will be examined for their suitability for the selected
style of game, with particular attention b
eing paid to any industry experience with the techniques
and the chosen genre.

Step 4:

Once the genre and techniques have been decided, the technologies needed to realise them will have
to be looked at. The main choice here is to decide between modding an

existing game, or creating
an example from scratch. The merits of each will have to be examined, with special attention being
paid in the case of mods to any previous AI work done with that engine.

Step 5:

A detailed plan will have to be created based on
the information gathered in previous steps, paying
special attention to any advice that was present in the articles from step one, or if the mod route is
chosen, the forums for the game to be modded.

Step 6:

Once the plan has been finalised, development s
hould begin at this point, with a clear first
milestone to work towards

Step 7:

At this stage, the final implementation will be carried out, with testing and data collection starting at
this point, for use in the final presentation.

Step 8:

This involves

the writing of the dissertation, however this process should start early in the project
lifecycle, and be refined and added to as time goes on



James Foley
-

0604261

Page
15

of
17

5. SPECIFIC RESOURCES REQUIRED


This project will require a C++ IDE, such as visual studio, DirectX9 SDK and,

if the mod route is
chosen, the SDK for whatever game as been selected for modding. None of these are a problem,
as
Visual

Studio 2005 is already installed on

university machines as is the D
irectX
SDK.
In the case of
modding a game, the only outlay will b
e the expense of buying a legitimate copy of the game.


6. PROJECT SCHEDULE


Steps 1, 2 & 3 should take no more than two weeks. Research into this area has already begun, and
will continue to do so over the summer break. This should help this phase to pa
ss quickly. Step 4
should take five days to a week, while not a step with allot to do on the surface, the choices made
here will impact the entire project, and time must be taken so that the best choice is made.

Step 5 should only take a day or two, if the

previous steps have been carried out correctly.

Step 6 & 7, should take about 6 weeks in total, from the beginnings of the waypoint system, to the
final version, this time also covers testing, and gathering of data for the dissertation.

From that point t
he dissertation has
about 6

weeks in which it must be finished, but the actual time
involved will be allot more, as the dissertation and note keeping will start early in the projects life,
so as not to forget or omit any data, as well as having a constant
process of refinement on the
dissertation throughout the projects life cycle.


7. OVERVIEW PROJECT PLAN


See attached Gantt
chart



James Foley
-

0604261

Page
16

of
17

8. REFERENCES:


8.1

B
ooks

[2]

I
nfluence Mapping,

Paul Tozour
, 2001,
In M. Deloura (Ed.), Game Programming Gems 2,

Charle
s River Media

8.2
W
ebsites

[1]
Terrain Analysis in Realtime Strategy Games,
Dave C. Pottinger, 2000, Game Developers
Conference,
Available at:
http://www.gdconf.com/archives/2000/pottinger.do
c

(Last Accessed 22
April, 2007).

[3]
Terrain Reasoning for 3D Action

Games,

William van der Sterren, 2001 , CGF
-
AI, Veldhoven,
the Netherlands, Available at
http://www.cgf
-
ai.com/docs/gdc2001_p
aper.pdf
. (
Last Accessed 22
April, 2007).

[4]
The Use of Artificial Intelligence in the Computer Game Industry
,

Lars Lidén
, 2001 , Game
Developer Conference, Available at
http://ai.eecs.umich.e
du/people/laird/game
-
seminar/Liden.ppt
.
(
Last Accessed 27 April, 2007
).

[5]
Enhancing Computer Science Education with a Wireless Intelligent Simulation Environment

Cook, Huber, Yerraballi, and Holder, 2004 , Journal of Computing in Higher Education, Avail
able
at
http://ranger.uta.edu/~cook/pubs/che03.pdf

[6]

Intelligent Agents for Computer Games
, Alexander Nareyek. 2002,

In Marsland, T. A., and Frank, I. (eds.), Computers and Games, Second Internat
ional Conference,
CG 2000, Springer LNCS 2063, 414
-
422.

8.3

Additional Material

Case
-
based plan recognition for real
-
time strategy games,

Cheng, D.C., & Thawonmas, R. (2004),
Proceedings of the Fifth Game
-
On International C
onference (pp. 36
-
40). Reading,
UK: University
of Wolverhampton Press.


James Foley
-

0604261

Page
17

of
17

Learning models of intelligent agents,
D. Carmel and S. Markovitch. . AAAI/IAAI, 1:62

67, 1996.


Serious games for language learning: How much game, how much AI?

Johnson, W.L.,
Vilhjálmsson, H., and Marsella, S. (200
5). Proc. of the 12
th

Int. Conf. on AI in Education.


Intelligent agents: Theory and practice.

M. Wooldridge and N. R. Jennings.

The Knowledge Engineering Review, 10(2):115{152, 1995