Download artificial intelligence for 3d path finding

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Minimax wikipedia , lookup

The Talos Principle wikipedia , lookup

History of artificial intelligence wikipedia , lookup

Existential risk from artificial general intelligence wikipedia , lookup

Computer Go wikipedia , lookup

Artificial intelligence in video games wikipedia , lookup

Transcript
ARTIFICIAL INTELLIGENCE FOR 3D PATH FINDING(1-4)
ARTIFICIAL INTELLIGENCE FOR 3D PATH FINDING
1
1
Pranavkumar Pathak , 2Dr. Dipti Shah
College of Computer and Information Sciences, King Saud University, Riyadh, KSA, [email protected]
2
G H Patel Post Graduate Department of Computer Science and Technology, Sardar Patel University,
Vallabh Vidyanagar, Email: [email protected]
Abstract- The role of Artificial Intelligence (AI) in games is gaining importance and often affects the success or failure of a game.
In this paper, we investigate the use of AI in game development. Research is done on how AI can be applied in games, and the
advantages it brings along. As the fields of AI in game development are too wide to be covered, the focus of this project will be
placed on certain areas. Two programs are implemented through this project – (i) an intelligent camera system, and (ii) pathfinding in a 3D application
Keywords-Provenance, Open Provenance Model(OPM), Search Engine(SE)
1.
INTRODUCTION
The use of Artificial Intelligence (AI) has a long
tradition in game applications [4,5,7,13-15,17]. This is
likely due to the fact that problem definitions of games
are often of high variability and scalability. Furthermore,
the problems are processed in a restricted domain and
the results are generally easy to evaluate. Not only has
AI found its way into computer games, the way it is
being incorporated in games has becomes different over
the years too. Traditionally, AI was always left till the
last stage in a game’s development cycle as most
programmers know that it is almost impossible to
develop game AI until one knows how the game is going
to be played. As the use of AI in games matures, more
time and energy were spent on developing AI system.
This project involves the study of existing use of AI in
games, the concepts behind them and how they are
applied into games.
2.
LITERATURE SURVEY OF AI IN G AMES
2.1 ROLE OF AI DEVELOPMENT IN GAMES
The rampant advances of technology today has makes
almost every new game that is developed, to be a new
challenge. Though some basics of the game engine will
probably remain the same during the game’s
development process, some features/subsystem such as
the AI factor is needed to make a game stands out [1.3].
2.2 PATH F INDING
Path-finding is one of the most visible types of AI in
computer games. Intelligent path-finding for a good
route is applicable for any game in which the computer
is responsible for moving things around, for example, to
move a person, vehicle or combat unit around; from here
to there.games. Intelligent path-finding for a good route
is applicable for any game in which the computer is
responsible for moving things around, for example, to
move a person, vehicle or combat unit around; from here
to there.
Avoiding Obstacles Along The Way: One of the typical
problems encountered in path-finding is obstacle
avoidance. While there are a few strategies to deal with
this, the simplest method would be to keep going until
actual collision with an obstacle. The information needed
here are the relative position of the entity and the goal,
and whether its immediate neighborhood is blocked. The
algorithm is shown below: while not at the goal pick a
direction to move toward the goal if that direction is
clear for movement move there else pick another
direction according to an avoidance strategy Moving in
Random Directions: This strategy would work well with
small and convex obstacles. When an obstacle is
encountered along the way, the entity can shift its
position a little to get past the obstacle and continues
until the goal is reached. However, with bigger and
concave obstacles, the entity would risk getting stuck
and a lot of time may be wasted in its attempts to move
out. Going Around the Obstacle: This strategy suggests
following the outline of the obstacle to get around it and
away when encountered with one. The difficulty lies
with knowing when to stop tracing the obstacle to
prevent going round and round it. Plan Before Move:
Rather than having to follow some strategies to get past
obstacles when one is encountered, a more intelligence
approach to this would be to plan the entire route first
and find the path according to some algorithms. In some
cases, the objective would be to find the cheapest paths
among several choices, while others include searching
for the shortest path or taking the first path (solution)
found. Some conventional AI algorithms are described in
the following sections.
Breadth-First Search: Breadth-first search (BFS) as
shown in Fig. 1 is a simple algorithm in which the root
INTERNATIONAL JOURNAL OF RESEARCH IN COMPUTER SCIENCE AND MANAGEMENT
Vol. 1(2), July 2014 (ISSN: 2321-8088)
Page 1
ARTIFICIAL INTELLIGENCE FOR 3D PATH FINDING(1-4)
node is expanded first, followed by all the successors of
the root nodes, then their successors, and so on until a
goal node is found. In general, all the nodes are
expended at a given depth in the search tree before any
many levels), a cutoff must be added at some depth to
make sure that the search terminates.
nodes at the next level are expanded.
Bidirectional Breadth-First Search: Bidirectional BFS
(see Fig. 2) is an enhancement of the simple BFS by
starting two simultaneous breadth-first searches from the
start and goal node and stopping when the two searches
meet in the middle. The figure above shows a schematic
view of a bi-directional search that is about to succeed,
when a the goal node. branch from the goal node.
Dijkstra’s Algorithm: E.Dijkstra developed this classic
algorithm for traversing graphs with edges of different
weights. At each step, the search looks at the
unprocessed node closest to the start node, looks at the
node’s neighbors, and sets or updates their respective
distances from the start.
Depth-First Search: Depth-first search (DFS) always
proceeds to the deepest level of the search tree (Fig. 3),
where the nodes have no successors. After expanding
these nodes, the search “backs up” to the next shallowest
node that still has unexplored successors. This is unlike
the BFS, which visits all the siblings of a node before
any children. In cases where the tree is very deep (has
Iterative Deepening Depth-First Search: Iterative
deepening depth-first search is a general strategy, which
is often used in combination with DFS that finds the best
depth limit. This is done by gradually increasing the
depth limit until a goal is found. A goal is found when
the depth limit reaches the depth of the shallowest goal
node. This combines the benefits of DFS and BFS.
Natural Paths: With a suitable path-finding algorithm to
obtain the route to be taken, the next challenge in game
applications would be to create a natural looking path.
Dealing with realistic turns is an important AI topic, and
for game characters to avoid taking robotic paths. In
general, splines are often employed to make the path
looks more natural. Figure 4a and 4b illustrates the
advantage of using splines[16] in path:
2.3
BEZIER CURVE
The Bezier curve is a mathematically defined curve by
four points: the initial position and the terminating
position (which are called “anchors”) and two separate
middle points (which are called “handles”). The shape of
a Bezier curve can be altered by moving the handles.
With this knowledge of Bezier curve, the next step
would be to build a Bezier curve from the points on the
final curve to attain a more realistic path.
2.4
FINITE STATE MACHINES AND DECISION TREES
Finite state machines (FSMs) describe under which
INTERNATIONAL JOURNAL OF RESEARCH IN COMPUTER SCIENCE AND MANAGEMENT
Vol. 1(2), July 2014 (ISSN: 2321-8088)
Page 2
ARTIFICIAL INTELLIGENCE FOR 3D PATH FINDING(1-4)
events or conditions a current state is to be replaced by
another. For example, switching from an attack mode to
an escape mode if a non-player character is hit. FSM is
mostly only a design concept, realized by scripts and
simple if-then statements. Figure 5. shows an example of
an FSM. The boxes represent states, which involve
specific scripts, animation schemes, etc. The starting
state is "searching for player." The arrows show
conditions under which the state of the non-player
character is changed, such as an incoming event when
the player is sighted
environments in 3D worlds, or simply the idea of playing
in a 3D virtual environment.
While there are many game AI problems in the industry,
pathfidning is probably the single most popular and
potentially frustrating one among them. The goa of pathfinding is to find a way to get from one place to another(
referred to as the start and the goal, respectively). Most
algorithms are based on maps ( grids of data), which
store the cost of each node, or point on the grid.
These algorithm try to find a path along the grid. There
are many path-finding algorithms that are commonly
known and used. But which would be the best to use is
usually problem specific. While some work to find the
path with lowest total cost( or distance) some algorithm
do not rely on any cost information of the path in its
expanding process. Hence, the aim is to explore pathfindig, a seemingly common yet challenging problem,in
3E game world. Actual implementation of the stated
difficulties in solving the problem, and also to uncover
the resulting effects.
A 3D path-finding problem can be defined as four
components:
An FSM is a simple and powerful tool for modeling a
non-player character’s behavior. There are extensions to
cope with more complex behaviors, such as Hierarchical
FSMs, as well as non-deterministic variants to introduce
random elements.
Conceptually, decision trees are slightly simpler than
FSMs and represent branching structuers that are often
used to make high level strategic decision. For example
in a strategy game, it is needed to decide if a computer –
guided opponent should prepare an attach or concentrate
on resource gathering. The nodes in the tree are test
conditions, which lead to different sub-trees. A final leaf
node contains a resulting decision. Similar to FSMs,
decision trees are conceptual tools and can be realie by
simple if-them statements.
3. PATH FINDING AI IN 3D
From the evolution of the 3D gaming universe within the
past decade, it is not hard to see that the gaming industry
is placing more focus in 3D games. In popular games
such as Wolfenstien, Doom, and Quake 3 Arena, gamers
can visit and explore worlds on their computer screens
that are increasingly dramatic and realistic. Gamers are
attracted to the idea of walking through theatrical
1. The initial state that the agent starts in.
2. A description of the possible actions available to the
agent.
3. The goal test, which determines whether a given state
is a goal state.
4. A path cost function that assigns a numeric cost to
each path.
With this the 3D path-finding problem is as follow:





4.
States : The nodes on the terrain map differing by
height values.
Initial state: As stated in the problem (Any state can
be designated as the initial state).
Successor Function : The legal states that can result
from moving around the terrain map. The red arrows
in the below example shows the possible actions
that can be taken in each node.
Goal test : Checks if the designated goal is reached.
Path cost : The terrain height values.
SUMMARY
Game AI aims to improve and enhance game experience.
Besides adding realism of game experience, the use of
AI can make a game more meaningful. Not only can AI
cleverly control characters in game, it can also be used in
implementing an intelligent camera system that is
capable of handling a diverse and dynamic three-
INTERNATIONAL JOURNAL OF RESEARCH IN COMPUTER SCIENCE AND MANAGEMENT
Vol. 1(2), July 2014 (ISSN: 2321-8088)
Page 3
ARTIFICIAL INTELLIGENCE FOR 3D PATH FINDING(1-4)
dimensional environment, as illustrated in the middle
parts of the report. Some of the “clever” things that the
camera system can do include capturing the 3D
environment in different types of view that is meaningful
to users, and following a terrain of varying heights.
REFERENCES
[1]
[2]
[3]
[4]
[5]
[6]
[7]
[8]
[9]
Tariq Mahmood, Syed Imran Jami, Zubair Ahmed
Shaikh, Muhammad Hussain Mughal, Towards the
modeling of data provenance in scientific
publication, Computer Standards & Interfaces,
Volume 1,Issue 1, Jan-2013.
Luc Moreau, Juliana Freire, Joe Futrelle, Robert E.
McGrath, Jim Myers, and Patrick Paulson, The Open
Provenance Model: An overview, IPWA 2008,
LNCS 5272, pp.323-326 2008.
Andre freitas, Tomas Knap, Sean O'Riain, Edward
Curry, Future Generation Systems, Volume 27, Issue
6, June 2011, Pages 766-774.
Jingwei Hiang and Mark S. Fox, Uncertainty in
Knowledge
Provenance,
Mar-2004,
http://www.eli.utoronto,ca/km/papers
Chunhyeok Lim, Shiyong Lu, Artem Chebotko,
Farshad Fotouhi, Andrey Kashlev, Data &
Knowledge Engineering (2013),
http://openprovenance.org/tutorial/
Foundations of Computer Science, 1985., 26th
Annual Symposium on, Portland, OR, USA ,
ISSN: 0272-5428 , 21-23 Oct. 1985
Enhanced-robustness Dijkstra algorithm for control
of routing in the IP-networks , N. A.
Kuznetsov and V. N. Fetisov pp.1-4.
Knuth, Donald E. (1997), The Art Of Computer
Programming Vol 1. 3rd ed., Boston: AddisonWesley, ISBN 0-201-89683-4
AUTHORS
Dr. Dipti Shah is working as a
faculty member at G H Patel P G
Department of Computer Science
& Technology, Sardar Patel
University since 1989 and currently
serving as a Professor. She received
her Ph.D (Computer Science)
degree
from
Sardar
Patel
University, Anand, Gujarat.
Her area of interest includes Computer Graphics, Image
Processing, Decision Support Systems, Artificial Intelligence
and Meta Search Engine Optimization. She is member of the
Board of Studies in Computer Science at S. P. University. She
has published 52 research papers including 45 in International
Journals & 7 in National Journals. She has guided 3 Ph. D.
(Computer Science) students and presently guiding 4 Ph. D.
(Computer Science) scholars. She is member in editorial board /
review committee in various International Journals. She has
served as program committee member for international
conference & various National level conferences. She has been
awarded Hari Ohm Ashram prize for best research paper in
Computer Science and Computer Engineering (2008-09).
Mr. Pranavkumar Pathak is
working as lecturer at College
of Computer and Information
Sciences,
King
Saud
University, Riyadh, KSA.
He received his M.Sc.( IS)
Degree from Sardar Patel
University, Anand, Gujarat. His
research
interest
includes
Game AI, is search algorithm
and Data mining ..
INTERNATIONAL JOURNAL OF RESEARCH IN COMPUTER SCIENCE AND MANAGEMENT
Vol. 1(2), July 2014 (ISSN: 2321-8088)
Page 4