SlideShare ist ein Scribd-Unternehmen logo
1 von 97
Downloaden Sie, um offline zu lesen
1Fanafzar Game Studio
• How do you think about AI?
What is AI
2Fanafzar Game Studio
• The field of AI research was founded at a conference on
the campus of Dartmouth College in the summer of 1956
• “The science and engineering of making intelligent
machines” -- John McCarthy 1956
• The study and design of intelligent agents -- Russell &
Norvig
What is AI
3Fanafzar Game Studio
• The Imitation Game (1950)
• A man (A), a woman (B), and an interrogator (C) who may
be of either sex.
Turing Test
4Fanafzar Game Studio
• The Imitation Game
• We now ask the question, What will happen when a
machine takes the part of A in this game?
Turing Test
5Fanafzar Game Studio
• Turing conjectured that, by the year 2000, a computer
with a storage of 10^9 units could be programmed well
enough to pass the test.
• The Turing test does not directly test whether the
computer behaves intelligently
– Some human behavior is unintelligent
– Some intelligent behavior is inhuman
• Real intelligence vs. simulated intelligence
Turing Test
6Fanafzar Game Studio
• The Chinese room is a thought experiment by John Searle
which first appeared in his paper "Minds, Brains, and
Programs", published in Behavioral and Brain Sciences in
1980.
Chinese room
7Fanafzar Game Studio
Chinese room
8Fanafzar Game Studio
• Searle argued that software could pass the Turing Test
simply by manipulating symbols of which they had no
understanding.
• Searle concludes—the Turing Test cannot prove that a
machine can think.
Chinese room
9Fanafzar Game Studio
• According to Strong AI, the correct simulation really is a
mind.
• In 1931, Kurt Gödel proved that it is always possible to
create statements that a formal system (such as an AI
program) could not prove.
Strong AI
10Fanafzar Game Studio
• According to Weak AI, the correct simulation is a model
of the mind.
• Can machines think?
– boats and submarines do move through the water but
we do not call that swimming.
• Stuart Russell and Peter Norvig write: "AI researchers
have devoted little attention to passing the Turing test."
Weak AI
11Fanafzar Game Studio
• The way computers "think" is vastly different from the
way a human thinks. --James Martin
• AI is faster and has a larger capacity for storage and
memory than any human.
• The largest nerves in the brain can transmit impulses at
around 90 meters per second, whereas a fiber optics
connection can transmit impulses at 300 million meters
per second, more than 3 million times faster.
Alien intelligence
12Fanafzar Game Studio
• “A computer program is said to learn from experience E
with respect to some class of tasks T and performance
measure P, if its performance at tasks in T, as measured
by P, improves with experience E.” --Tom M. Mitchell
• REcognition, classification
• Online and Offline learning
• Supervised, Unsupervised, Reinforcement
Machine Learning
13Fanafzar Game Studio
• Classification
Machine Learning - Supervised
14Fanafzar Game Studio
• Clustering
– We don’t know number of classes
Machine Learning - Unsupervised
15Fanafzar Game Studio
X Y
12.37 15.64
22.8 7.8
34 17
91 50
11.9 17
44 19
80 45
21 9
33.31 16.5
79 39
… …
• Clustering
Machine Learning - Unsupervised
16Fanafzar Game Studio
• The goal of a reinforcement learning agent is to collect as
much reward as possible.
• Highly related to dynamic programming techniques
• Most famous technique is Q-learning
• Reinforcement Learning in First Person Shooter Games
– IEEE TRANSACTIONS ON COMPUTATIONAL INTELLIGENCE AND AI IN GAMES,
VOL. 3, NO. 1, MARCH 2011
• High-level Reinforcement Learning in Strategy Games
– International Conference on Autonomous Agents and Multiagent Systems
Machine Learning - Reinforcement
17Fanafzar Game Studio
• A simple idea: use the theory of evolution as an
algorithm.
• A Population of Individuals
• Swarm intelligence
– Ant colony optimization
– Particle swarm optimization
– Bees algorithm
– Cuckoo search
Evolutionary Computing
18Fanafzar Game Studio
• Individual = Chromosomes
• Mutation, Selection, and Crossover.
• Operating on dynamic data sets is difficult
• Tendency to converge towards local optima
• Randomness
Genetic Algorithm
19Fanafzar Game Studio
• Simplified models of neural processing in the brain
Neural Networks
20Fanafzar Game Studio
• Multilayer Perceptrons
Neural Networks
21Fanafzar Game Studio
• How to train
• Black box
• Over fitting
• Computationally expensive
• Evolving Neural Controllers using GA for Warcraft 3-Real
Time Strategy Game
– 2011 Sixth International Conference on Bio-Inspired Computing
Neural Networks
22Fanafzar Game Studio
• A good book about
GA and NN in games
Neural Networks
23Fanafzar Game Studio
Do we really need AI in computer games?
What we expect from game AI?
24Fanafzar Game Studio
• Efficiency
• Ease of Debugging (randomness)
• We don’t need general problem solver
• Believability
– We don’t need human level intelligence
– It doesn't really matter how NPC intelligence is
achieved, as long as the creatures in the game appear
believable.(weak AI)
What we expect from game AI?
25Fanafzar Game Studio
• Video games provide a rich test bed for artificial
intelligence methods
• Designers need to control the behavior of NPCs
– Explicit control
– Implicit control
• It is very genre specific
• Avoid artificial stupidity
What we expect from game AI?
26Fanafzar Game Studio
• Agent cycle
Agents as NPCs
27Fanafzar Game Studio
THINKSENSE ACT
• Agent cycle
Agents as NPCs
28Fanafzar Game Studio
MAP
GEOMETRY
ENTITIES
. . .
THINK ACT
• Agent cycle
Agents as NPCs
29Fanafzar Game Studio
REMEMBER
REASON
BEHAVE
SENSE ACT
• Agent cycle
Agents as NPCs
30Fanafzar Game Studio
ANIMATE
NAVIGATE
. . .
THINKSENSE
• Rule : if (condition) then action
• Production Rule System comprised of a database of rules,
each rule consists of an arbitrarily complex conditional
statements.
• They are fairly uncommon approach.
Rule Based
31Fanafzar Game Studio
• Search Methods, discovering a sequence of actions or
states within a search space that satisfy some goal
• Goal-oriented behavior is still fairly rare in games.
Goal Oriented
32Fanafzar Game Studio
• Everything in game world is triangle
• In door / Out door
• Path finding still is a problem
– Some pathfinding bugs(Video)
Introduction to Path planning
33Fanafzar Game Studio
• Graph Theory – shortest path
• Single Source shortest path
• All pairs shortest path – Floyd
– Store the result
• Heuristic F(n) = D(n) + H(n)
A*/Dijkstra
34Fanafzar Game Studio
• Near-Optimal Hierarchical Pathfinding,
– A. Botea, M. Muller, and J. Schaeffer, Journal of Game
Development, Volume 1
Hierarchical Pathfinding
35Fanafzar Game Studio
• Grid/Tile Base
– Fast
– Easy to develop
– Memory Inefficient
– 2D and strategy games
Reviewing some pathfinding methods
36Fanafzar Game Studio
• Waypoint graphs
– Manual
Reviewing some pathfinding methods
37Fanafzar Game Studio
• Waypoint graphs
– Automated : Point of visibility
Reviewing some pathfinding methods
38Fanafzar Game Studio
• Worlds require a ridiculous number of waypoints
• Difficult dynamic obstacle avoidance, if not impossible
• Is not shortest path – not optimal
• Impossible to do path-smoothing
• Zig Zag path
Reviewing some pathfinding methods
39Fanafzar Game Studio
Fanafzar Game Studio 40
Reviewing some pathfinding methods
Inefficient
• Convex Polygons
– Manual/Automated
Reviewing some pathfinding methods
41Fanafzar Game Studio
• Shortest path - Optimal
• Smaller Search Space
Reviewing some pathfinding methods
42Fanafzar Game Studio
Reviewing some pathfinding methods
43Fanafzar Game Studio
OK, But how
to
implement?
Reviewing some pathfinding methods
44Fanafzar Game Studio
• Mesh simplification
• Rendering techniques
• Flood filling with AABBs (UDK)
• Voxelization
• Check Mikko Monone’s work, RecastNavigation
– http://digestingduck.blogspot.com
• The general process is as follows:
1. Voxelization
2. Generate Regions
3. Generate Contours
4. Generate Polygon Mesh
5. Generate Detailed Mesh
Navigation mesh generation process
45Fanafzar Game Studio
1. Voxelization
Navigation mesh generation process
46Fanafzar Game Studio
1. Voxelization
Navigation mesh generation process
47Fanafzar Game Studio
1. Voxelization
Navigation mesh generation process
48Fanafzar Game Studio
1. Voxelization
Navigation mesh generation process
49Fanafzar Game Studio
1. Voxelization
Navigation mesh generation process
50Fanafzar Game Studio
1. Voxelization
Navigation mesh generation process
51Fanafzar Game Studio
2. Generate Regions
Navigation mesh generation process
52Fanafzar Game Studio
2. Generate Regions
Navigation mesh generation process
53Fanafzar Game Studio
2. Generate Regions
Navigation mesh generation process
54Fanafzar Game Studio
3. Generate Contours
Navigation mesh generation process
55Fanafzar Game Studio
3. Generate Contours
Navigation mesh generation process
56Fanafzar Game Studio
3. Generate Contours
Douglas-Peucker simplification
Navigation mesh generation process
57Fanafzar Game Studio
3. Generate Contours
Douglas-Peucker simplification
Navigation mesh generation process
58Fanafzar Game Studio
3. Generate Contours
Douglas-Peucker simplification
Navigation mesh generation process
59Fanafzar Game Studio
4. Generate Polygon Mesh
– Triangulation
– Merge to Convex Polygon
– Benefits of Convex Polygon
Navigation mesh generation process
60Fanafzar Game Studio
5. Generate Detailed Mesh
Navigation mesh generation process
61Fanafzar Game Studio
5. Generate Detailed Mesh
Navigation mesh generation process
62Fanafzar Game Studio
• Path find with A*
– Graph nodes are convex polygons
– Corridor map
– A* is not complex to implement
– There are many optimization techniques
Navigation mesh generation process
63Fanafzar Game Studio
• Pathfinding is Not A Star, AUTODESK® KYNAPSE ®
MIDDLEWARE WHITE PAPER
– Path smoothing
– Path following
– Deal with other NPCs
– Deal with dynamic evolutions of game world
Navigation mesh generation process
64Fanafzar Game Studio
• Velocity obstacle
• There are some variations
– RVO, NLVO, FVO, HRVO, NHRVO, PVO
• Mikko uses RVO(Reciprocal Velocity Obstacles)
Navigation mesh generation process
65Fanafzar Game Studio
• Voxelization also used in Cover selection, Jumps,
Camera movement
– Automatic annotations in Killzone 3 --Mikko Mononen,
Paris Game AI Conference 2011
Navigation mesh generation process
66Fanafzar Game Studio
Navigation mesh, Zorvan Integration
67Fanafzar Game Studio
• Generation Types
– Solo
– Tiled Navmesh
• Dynamic loading
• Deal with dynamic obstacles
• Off-Mesh Connections
• Convex polygons
Navigation mesh, Zorvan Integration
68Fanafzar Game Studio
• How to simulate movement of intelligent objects
like bird, animals, cars, etc. --Craig Reynols
• Stanley and Stella in: Breaking the Ice (1987)
Steering Behaviors
69Fanafzar Game Studio
• Simple Vehicle Model
– Mass scalar
– Position vector
– Velocity vector
– max_force scalar
– max_speed scalar
Steering Behaviors
70Fanafzar Game Studio
• Seek
• Flee
• Flocking
• Pursuit
• Arrival
• Obstacle avoidance
• Path follow
• Leader follow
• Hide
Steering Behaviors
71Fanafzar Game Studio
• Seek Vs Flee
Steering Behaviors
72Fanafzar Game Studio
• Seek
Vector2D SteeringBehaviors::Seek(Vector2D TargetPos)
{
Vector2D diff = TargetPos - m_pVehicle->Pos();
Vector2D DesiredVelocity =
Vec2DNormalize(diff) * m_pVehicle->MaxSpeed();
return (DesiredVelocity - m_pVehicle->Velocity());
}
Steering Behaviors
73Fanafzar Game Studio
• Obstacle avoidance
– Only circles
Steering Behaviors
74Fanafzar Game Studio
• Combining Steering Behaviors
– Weighted Truncated Sum
– Weighted Truncated Running Sum with Prioritization
– Prioritized Dithering
• Open Steer
Steering Behaviors
75Fanafzar Game Studio
Advantages
– Simplicity
– Reliability
– Predictability
– Efficiency
Disadvantages
– Local traps
• Oscillation
– Realism
• Jagged paths
– Scalability
Steering Behaviors
76Fanafzar Game Studio
• Pure scripting!
• Structured
– FSM
– HFSM
– Behavior Tree
Decision Making
77Fanafzar Game Studio
• Theory (Simplified)
– A set states, S
– An input vocabulary, e
– Transition function, T(s, e)
• Map a state and an input to another state
FSM
78Fanafzar Game Studio
Patrol
(idle)
Combat
Return to
post
Pursue
Player Seen
Near PlayerFar from post
Reach post
• Finite State Machine (FSM) is the Most Commonly
used Game AI Technology Today
– Simple
– Efficient
– Easily extensible
– Powerful enough to handle a wide variety of situations
• Decisions only depend on current state
FSM
79Fanafzar Game Studio
• Hard Coded
– Switch Statement
– Function pointers
– Polymorphism (State Pattern)
• Interpreted
– Data Driven
– Scripted
• Compiled
– machine code
– Generating source code
FSM
80Fanafzar Game Studio
• Function Pointer-Based, Embedded Finite-State Machines
– Chapter 3.1, Game programming gems 1
• A Finite-State Machine Class
– Chapter 3.3 Game Programming Gems 3
FSM
81Fanafzar Game Studio
• Each state can be a complete state machine in its own
right
• Original Paper
– Statecharts: A Visual Formalism for Complex Systems D. Harel
Science of Computer Programming 8, 1987
• Clustering states (XOR)
• Concurrency (AND)
HFSM
82Fanafzar Game Studio
• Example
HFSM
83Fanafzar Game Studio
Patrol
(idle)
Return to
post
Pursue
Player Seen
Near PlayerFar from post
Reach post
Combat
Attack 1 Attack 2
Success
• Cluster states
• The semantic of D is exclusive-or (XOR) of A and C
HFSM
84Fanafzar Game Studio
A
C
B
α
β
δ
γ(cond)
D
• Parallel (AND combination)
HFSM
85Fanafzar Game Studio
A
C
α β
E
G
F
α
δ
γ μ
A DY
Fanafzar Game Studio 86
Iranvij AI Editor
Fanafzar Game Studio 87
Iranvij AI Editor
• Halo 2 [Bungie Software, 2004] was one of the first high-
profile games for which the use of behavior trees.
• Instead of a state, the main building block of a behavior
tree is a Task
• Conditions, Actions, and Composites
Behavior tree
88Fanafzar Game Studio
• Selector
Behavior tree
89Fanafzar Game Studio
terminate
keep trying
?
• Sequence
Behavior tree
90Fanafzar Game Studio
keep going
bail out
• Example
Behavior tree
91Fanafzar Game Studio
?
Door
Open?
Move
(into room)
Move
(to door)
Open
door
Move
(into room)
Condition Action
• Refactored tree
Behavior tree
92Fanafzar Game Studio
?
Door
Open?
Move
(to door)
Open
door
Move
(into room)
• Decorators (such as Invertor)
• Random Selector
• Random Sequence
• Parallel
93Fanafzar Game Studio
• Procedural Animation
• Procedural level generation
• Dynamic game difficulty balancing
Next Generation AI for game
94Fanafzar Game Studio
• Artificial Intelligence For Games, Second Edition, Ian
Millington, John Funge
• Programming Game AI by Example, Mat Buckland
• Game programming gems series
• AI Game Programming Wisdom series
• AI Game Development: Synthetic Creatures with Learning
and Reactive Behaviors, Alex J. Champandard
• http://aigamedev.com/
• http://www.ai-blog.net/archives/000183.html
• http://www.critterai.org/nmgen_study
References
95Fanafzar Game Studio
• http://digestingduck.blogspot.com/
References
96Fanafzar Game Studio
Fanafzar Game Studio 97
Thank You
hojjatjafary@yahoo.com

Weitere ähnliche Inhalte

Andere mochten auch

Unity3D Tips and Tricks or "You are doing it wrong!"
Unity3D Tips and Tricks or "You are doing it wrong!"Unity3D Tips and Tricks or "You are doing it wrong!"
Unity3D Tips and Tricks or "You are doing it wrong!"Taras Leskiv
 
Introduction to Artificial Intelligence (AI) at Amazon
Introduction to Artificial Intelligence (AI) at Amazon Introduction to Artificial Intelligence (AI) at Amazon
Introduction to Artificial Intelligence (AI) at Amazon Amanda Mackay (she/her)
 
An introduction to AI (artificial intelligence)
An introduction to AI (artificial intelligence)An introduction to AI (artificial intelligence)
An introduction to AI (artificial intelligence)Bellaj Badr
 
Artificial intelligence my ppt by hemant sankhla
Artificial intelligence my ppt by hemant sankhlaArtificial intelligence my ppt by hemant sankhla
Artificial intelligence my ppt by hemant sankhlaHemant Sankhla
 
ARTIFICIAL INTELLIGENCE Presentation
ARTIFICIAL INTELLIGENCE PresentationARTIFICIAL INTELLIGENCE Presentation
ARTIFICIAL INTELLIGENCE PresentationMuhammad Ahmed
 
Unity Internals: Memory and Performance
Unity Internals: Memory and PerformanceUnity Internals: Memory and Performance
Unity Internals: Memory and PerformanceDevGAMM Conference
 
Practical Guide for Optimizing Unity on Mobiles
Practical Guide for Optimizing Unity on MobilesPractical Guide for Optimizing Unity on Mobiles
Practical Guide for Optimizing Unity on MobilesValentin Simonov
 
Optimizing unity games (Google IO 2014)
Optimizing unity games (Google IO 2014)Optimizing unity games (Google IO 2014)
Optimizing unity games (Google IO 2014)Alexander Dolbilov
 
Tracxn Research — Artificial Intelligence Startup Landscape, September 2016
Tracxn Research — Artificial Intelligence Startup Landscape, September 2016Tracxn Research — Artificial Intelligence Startup Landscape, September 2016
Tracxn Research — Artificial Intelligence Startup Landscape, September 2016Tracxn
 
Artificial Intelligence
Artificial IntelligenceArtificial Intelligence
Artificial IntelligenceNeil Mathew
 
Artificial Intelligence
Artificial IntelligenceArtificial Intelligence
Artificial Intelligenceu053675
 

Andere mochten auch (12)

Unity3D Tips and Tricks or "You are doing it wrong!"
Unity3D Tips and Tricks or "You are doing it wrong!"Unity3D Tips and Tricks or "You are doing it wrong!"
Unity3D Tips and Tricks or "You are doing it wrong!"
 
Artificial intelligence ppt
Artificial intelligence   pptArtificial intelligence   ppt
Artificial intelligence ppt
 
Introduction to Artificial Intelligence (AI) at Amazon
Introduction to Artificial Intelligence (AI) at Amazon Introduction to Artificial Intelligence (AI) at Amazon
Introduction to Artificial Intelligence (AI) at Amazon
 
An introduction to AI (artificial intelligence)
An introduction to AI (artificial intelligence)An introduction to AI (artificial intelligence)
An introduction to AI (artificial intelligence)
 
Artificial intelligence my ppt by hemant sankhla
Artificial intelligence my ppt by hemant sankhlaArtificial intelligence my ppt by hemant sankhla
Artificial intelligence my ppt by hemant sankhla
 
ARTIFICIAL INTELLIGENCE Presentation
ARTIFICIAL INTELLIGENCE PresentationARTIFICIAL INTELLIGENCE Presentation
ARTIFICIAL INTELLIGENCE Presentation
 
Unity Internals: Memory and Performance
Unity Internals: Memory and PerformanceUnity Internals: Memory and Performance
Unity Internals: Memory and Performance
 
Practical Guide for Optimizing Unity on Mobiles
Practical Guide for Optimizing Unity on MobilesPractical Guide for Optimizing Unity on Mobiles
Practical Guide for Optimizing Unity on Mobiles
 
Optimizing unity games (Google IO 2014)
Optimizing unity games (Google IO 2014)Optimizing unity games (Google IO 2014)
Optimizing unity games (Google IO 2014)
 
Tracxn Research — Artificial Intelligence Startup Landscape, September 2016
Tracxn Research — Artificial Intelligence Startup Landscape, September 2016Tracxn Research — Artificial Intelligence Startup Landscape, September 2016
Tracxn Research — Artificial Intelligence Startup Landscape, September 2016
 
Artificial Intelligence
Artificial IntelligenceArtificial Intelligence
Artificial Intelligence
 
Artificial Intelligence
Artificial IntelligenceArtificial Intelligence
Artificial Intelligence
 

Ähnlich wie Introduction to AI in computer games

VDP2016 - Lecture 14 Procedural content generation
VDP2016 - Lecture 14 Procedural content generationVDP2016 - Lecture 14 Procedural content generation
VDP2016 - Lecture 14 Procedural content generationPier Luca Lanzi
 
Finding Needles in Haystacks (The Size of Countries)
Finding Needles in Haystacks (The Size of Countries)Finding Needles in Haystacks (The Size of Countries)
Finding Needles in Haystacks (The Size of Countries)packetloop
 
Science and Videogames. Computational intelligence in videogames
Science and Videogames. Computational intelligence in videogamesScience and Videogames. Computational intelligence in videogames
Science and Videogames. Computational intelligence in videogamesAntonio Mora
 
Artificial Intelligence (and the telecom industry)
Artificial Intelligence (and the telecom industry)Artificial Intelligence (and the telecom industry)
Artificial Intelligence (and the telecom industry)Samuel Dratwa
 
게임 AI를 통해 본 인공지능 기본 개념
게임 AI를 통해 본 인공지능 기본 개념게임 AI를 통해 본 인공지능 기본 개념
게임 AI를 통해 본 인공지능 기본 개념Keunhyun Oh
 
blue brain technology
blue brain technologyblue brain technology
blue brain technologyManju Rajput
 
Adversarial search with Game Playing
Adversarial search with Game PlayingAdversarial search with Game Playing
Adversarial search with Game PlayingAman Patel
 
J-Fall 2017 - AI Self-learning Game Playing
J-Fall 2017 - AI Self-learning Game PlayingJ-Fall 2017 - AI Self-learning Game Playing
J-Fall 2017 - AI Self-learning Game PlayingRichard Abbuhl
 
Chapter.ppt
Chapter.pptChapter.ppt
Chapter.pptRamyaD76
 
North americai iotskynet-v2
North americai iotskynet-v2North americai iotskynet-v2
North americai iotskynet-v2Steve Poole
 
An Incomplete Introduction to Artificial Intelligence
An Incomplete Introduction to Artificial IntelligenceAn Incomplete Introduction to Artificial Intelligence
An Incomplete Introduction to Artificial IntelligenceSteven Beeckman
 
Artificial intelligence
Artificial intelligenceArtificial intelligence
Artificial intelligenceShikhar Bansal
 
Useful Techniques in Artificial Intelligence
Useful Techniques in Artificial IntelligenceUseful Techniques in Artificial Intelligence
Useful Techniques in Artificial IntelligenceIla Group
 

Ähnlich wie Introduction to AI in computer games (20)

VDP2016 - Lecture 14 Procedural content generation
VDP2016 - Lecture 14 Procedural content generationVDP2016 - Lecture 14 Procedural content generation
VDP2016 - Lecture 14 Procedural content generation
 
Finding Needles in Haystacks (The Size of Countries)
Finding Needles in Haystacks (The Size of Countries)Finding Needles in Haystacks (The Size of Countries)
Finding Needles in Haystacks (The Size of Countries)
 
Science and Videogames. Computational intelligence in videogames
Science and Videogames. Computational intelligence in videogamesScience and Videogames. Computational intelligence in videogames
Science and Videogames. Computational intelligence in videogames
 
Artificial Intelligence (and the telecom industry)
Artificial Intelligence (and the telecom industry)Artificial Intelligence (and the telecom industry)
Artificial Intelligence (and the telecom industry)
 
게임 AI를 통해 본 인공지능 기본 개념
게임 AI를 통해 본 인공지능 기본 개념게임 AI를 통해 본 인공지능 기본 개념
게임 AI를 통해 본 인공지능 기본 개념
 
blue brain technology
blue brain technologyblue brain technology
blue brain technology
 
Adversarial search with Game Playing
Adversarial search with Game PlayingAdversarial search with Game Playing
Adversarial search with Game Playing
 
Cam brain
Cam brainCam brain
Cam brain
 
J-Fall 2017 - AI Self-learning Game Playing
J-Fall 2017 - AI Self-learning Game PlayingJ-Fall 2017 - AI Self-learning Game Playing
J-Fall 2017 - AI Self-learning Game Playing
 
Chapter13.ppt
Chapter13.pptChapter13.ppt
Chapter13.ppt
 
Chapter.ppt
Chapter.pptChapter.ppt
Chapter.ppt
 
Chapter13.ppt
Chapter13.pptChapter13.ppt
Chapter13.ppt
 
Chapter13.ppt
Chapter13.pptChapter13.ppt
Chapter13.ppt
 
Chapter13.ppt
Chapter13.pptChapter13.ppt
Chapter13.ppt
 
Chapter13.ppt
Chapter13.pptChapter13.ppt
Chapter13.ppt
 
North americai iotskynet-v2
North americai iotskynet-v2North americai iotskynet-v2
North americai iotskynet-v2
 
An Incomplete Introduction to Artificial Intelligence
An Incomplete Introduction to Artificial IntelligenceAn Incomplete Introduction to Artificial Intelligence
An Incomplete Introduction to Artificial Intelligence
 
NPTEL_SEM_3.pdf
NPTEL_SEM_3.pdfNPTEL_SEM_3.pdf
NPTEL_SEM_3.pdf
 
Artificial intelligence
Artificial intelligenceArtificial intelligence
Artificial intelligence
 
Useful Techniques in Artificial Intelligence
Useful Techniques in Artificial IntelligenceUseful Techniques in Artificial Intelligence
Useful Techniques in Artificial Intelligence
 

Kürzlich hochgeladen

Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 

Kürzlich hochgeladen (20)

Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 

Introduction to AI in computer games

  • 2. • How do you think about AI? What is AI 2Fanafzar Game Studio
  • 3. • The field of AI research was founded at a conference on the campus of Dartmouth College in the summer of 1956 • “The science and engineering of making intelligent machines” -- John McCarthy 1956 • The study and design of intelligent agents -- Russell & Norvig What is AI 3Fanafzar Game Studio
  • 4. • The Imitation Game (1950) • A man (A), a woman (B), and an interrogator (C) who may be of either sex. Turing Test 4Fanafzar Game Studio
  • 5. • The Imitation Game • We now ask the question, What will happen when a machine takes the part of A in this game? Turing Test 5Fanafzar Game Studio
  • 6. • Turing conjectured that, by the year 2000, a computer with a storage of 10^9 units could be programmed well enough to pass the test. • The Turing test does not directly test whether the computer behaves intelligently – Some human behavior is unintelligent – Some intelligent behavior is inhuman • Real intelligence vs. simulated intelligence Turing Test 6Fanafzar Game Studio
  • 7. • The Chinese room is a thought experiment by John Searle which first appeared in his paper "Minds, Brains, and Programs", published in Behavioral and Brain Sciences in 1980. Chinese room 7Fanafzar Game Studio
  • 9. • Searle argued that software could pass the Turing Test simply by manipulating symbols of which they had no understanding. • Searle concludes—the Turing Test cannot prove that a machine can think. Chinese room 9Fanafzar Game Studio
  • 10. • According to Strong AI, the correct simulation really is a mind. • In 1931, Kurt Gödel proved that it is always possible to create statements that a formal system (such as an AI program) could not prove. Strong AI 10Fanafzar Game Studio
  • 11. • According to Weak AI, the correct simulation is a model of the mind. • Can machines think? – boats and submarines do move through the water but we do not call that swimming. • Stuart Russell and Peter Norvig write: "AI researchers have devoted little attention to passing the Turing test." Weak AI 11Fanafzar Game Studio
  • 12. • The way computers "think" is vastly different from the way a human thinks. --James Martin • AI is faster and has a larger capacity for storage and memory than any human. • The largest nerves in the brain can transmit impulses at around 90 meters per second, whereas a fiber optics connection can transmit impulses at 300 million meters per second, more than 3 million times faster. Alien intelligence 12Fanafzar Game Studio
  • 13. • “A computer program is said to learn from experience E with respect to some class of tasks T and performance measure P, if its performance at tasks in T, as measured by P, improves with experience E.” --Tom M. Mitchell • REcognition, classification • Online and Offline learning • Supervised, Unsupervised, Reinforcement Machine Learning 13Fanafzar Game Studio
  • 14. • Classification Machine Learning - Supervised 14Fanafzar Game Studio
  • 15. • Clustering – We don’t know number of classes Machine Learning - Unsupervised 15Fanafzar Game Studio X Y 12.37 15.64 22.8 7.8 34 17 91 50 11.9 17 44 19 80 45 21 9 33.31 16.5 79 39 … …
  • 16. • Clustering Machine Learning - Unsupervised 16Fanafzar Game Studio
  • 17. • The goal of a reinforcement learning agent is to collect as much reward as possible. • Highly related to dynamic programming techniques • Most famous technique is Q-learning • Reinforcement Learning in First Person Shooter Games – IEEE TRANSACTIONS ON COMPUTATIONAL INTELLIGENCE AND AI IN GAMES, VOL. 3, NO. 1, MARCH 2011 • High-level Reinforcement Learning in Strategy Games – International Conference on Autonomous Agents and Multiagent Systems Machine Learning - Reinforcement 17Fanafzar Game Studio
  • 18. • A simple idea: use the theory of evolution as an algorithm. • A Population of Individuals • Swarm intelligence – Ant colony optimization – Particle swarm optimization – Bees algorithm – Cuckoo search Evolutionary Computing 18Fanafzar Game Studio
  • 19. • Individual = Chromosomes • Mutation, Selection, and Crossover. • Operating on dynamic data sets is difficult • Tendency to converge towards local optima • Randomness Genetic Algorithm 19Fanafzar Game Studio
  • 20. • Simplified models of neural processing in the brain Neural Networks 20Fanafzar Game Studio
  • 21. • Multilayer Perceptrons Neural Networks 21Fanafzar Game Studio
  • 22. • How to train • Black box • Over fitting • Computationally expensive • Evolving Neural Controllers using GA for Warcraft 3-Real Time Strategy Game – 2011 Sixth International Conference on Bio-Inspired Computing Neural Networks 22Fanafzar Game Studio
  • 23. • A good book about GA and NN in games Neural Networks 23Fanafzar Game Studio
  • 24. Do we really need AI in computer games? What we expect from game AI? 24Fanafzar Game Studio
  • 25. • Efficiency • Ease of Debugging (randomness) • We don’t need general problem solver • Believability – We don’t need human level intelligence – It doesn't really matter how NPC intelligence is achieved, as long as the creatures in the game appear believable.(weak AI) What we expect from game AI? 25Fanafzar Game Studio
  • 26. • Video games provide a rich test bed for artificial intelligence methods • Designers need to control the behavior of NPCs – Explicit control – Implicit control • It is very genre specific • Avoid artificial stupidity What we expect from game AI? 26Fanafzar Game Studio
  • 27. • Agent cycle Agents as NPCs 27Fanafzar Game Studio THINKSENSE ACT
  • 28. • Agent cycle Agents as NPCs 28Fanafzar Game Studio MAP GEOMETRY ENTITIES . . . THINK ACT
  • 29. • Agent cycle Agents as NPCs 29Fanafzar Game Studio REMEMBER REASON BEHAVE SENSE ACT
  • 30. • Agent cycle Agents as NPCs 30Fanafzar Game Studio ANIMATE NAVIGATE . . . THINKSENSE
  • 31. • Rule : if (condition) then action • Production Rule System comprised of a database of rules, each rule consists of an arbitrarily complex conditional statements. • They are fairly uncommon approach. Rule Based 31Fanafzar Game Studio
  • 32. • Search Methods, discovering a sequence of actions or states within a search space that satisfy some goal • Goal-oriented behavior is still fairly rare in games. Goal Oriented 32Fanafzar Game Studio
  • 33. • Everything in game world is triangle • In door / Out door • Path finding still is a problem – Some pathfinding bugs(Video) Introduction to Path planning 33Fanafzar Game Studio
  • 34. • Graph Theory – shortest path • Single Source shortest path • All pairs shortest path – Floyd – Store the result • Heuristic F(n) = D(n) + H(n) A*/Dijkstra 34Fanafzar Game Studio
  • 35. • Near-Optimal Hierarchical Pathfinding, – A. Botea, M. Muller, and J. Schaeffer, Journal of Game Development, Volume 1 Hierarchical Pathfinding 35Fanafzar Game Studio
  • 36. • Grid/Tile Base – Fast – Easy to develop – Memory Inefficient – 2D and strategy games Reviewing some pathfinding methods 36Fanafzar Game Studio
  • 37. • Waypoint graphs – Manual Reviewing some pathfinding methods 37Fanafzar Game Studio
  • 38. • Waypoint graphs – Automated : Point of visibility Reviewing some pathfinding methods 38Fanafzar Game Studio
  • 39. • Worlds require a ridiculous number of waypoints • Difficult dynamic obstacle avoidance, if not impossible • Is not shortest path – not optimal • Impossible to do path-smoothing • Zig Zag path Reviewing some pathfinding methods 39Fanafzar Game Studio
  • 40. Fanafzar Game Studio 40 Reviewing some pathfinding methods Inefficient
  • 41. • Convex Polygons – Manual/Automated Reviewing some pathfinding methods 41Fanafzar Game Studio
  • 42. • Shortest path - Optimal • Smaller Search Space Reviewing some pathfinding methods 42Fanafzar Game Studio
  • 43. Reviewing some pathfinding methods 43Fanafzar Game Studio OK, But how to implement?
  • 44. Reviewing some pathfinding methods 44Fanafzar Game Studio • Mesh simplification • Rendering techniques • Flood filling with AABBs (UDK) • Voxelization • Check Mikko Monone’s work, RecastNavigation – http://digestingduck.blogspot.com
  • 45. • The general process is as follows: 1. Voxelization 2. Generate Regions 3. Generate Contours 4. Generate Polygon Mesh 5. Generate Detailed Mesh Navigation mesh generation process 45Fanafzar Game Studio
  • 46. 1. Voxelization Navigation mesh generation process 46Fanafzar Game Studio
  • 47. 1. Voxelization Navigation mesh generation process 47Fanafzar Game Studio
  • 48. 1. Voxelization Navigation mesh generation process 48Fanafzar Game Studio
  • 49. 1. Voxelization Navigation mesh generation process 49Fanafzar Game Studio
  • 50. 1. Voxelization Navigation mesh generation process 50Fanafzar Game Studio
  • 51. 1. Voxelization Navigation mesh generation process 51Fanafzar Game Studio
  • 52. 2. Generate Regions Navigation mesh generation process 52Fanafzar Game Studio
  • 53. 2. Generate Regions Navigation mesh generation process 53Fanafzar Game Studio
  • 54. 2. Generate Regions Navigation mesh generation process 54Fanafzar Game Studio
  • 55. 3. Generate Contours Navigation mesh generation process 55Fanafzar Game Studio
  • 56. 3. Generate Contours Navigation mesh generation process 56Fanafzar Game Studio
  • 57. 3. Generate Contours Douglas-Peucker simplification Navigation mesh generation process 57Fanafzar Game Studio
  • 58. 3. Generate Contours Douglas-Peucker simplification Navigation mesh generation process 58Fanafzar Game Studio
  • 59. 3. Generate Contours Douglas-Peucker simplification Navigation mesh generation process 59Fanafzar Game Studio
  • 60. 4. Generate Polygon Mesh – Triangulation – Merge to Convex Polygon – Benefits of Convex Polygon Navigation mesh generation process 60Fanafzar Game Studio
  • 61. 5. Generate Detailed Mesh Navigation mesh generation process 61Fanafzar Game Studio
  • 62. 5. Generate Detailed Mesh Navigation mesh generation process 62Fanafzar Game Studio
  • 63. • Path find with A* – Graph nodes are convex polygons – Corridor map – A* is not complex to implement – There are many optimization techniques Navigation mesh generation process 63Fanafzar Game Studio
  • 64. • Pathfinding is Not A Star, AUTODESK® KYNAPSE ® MIDDLEWARE WHITE PAPER – Path smoothing – Path following – Deal with other NPCs – Deal with dynamic evolutions of game world Navigation mesh generation process 64Fanafzar Game Studio
  • 65. • Velocity obstacle • There are some variations – RVO, NLVO, FVO, HRVO, NHRVO, PVO • Mikko uses RVO(Reciprocal Velocity Obstacles) Navigation mesh generation process 65Fanafzar Game Studio
  • 66. • Voxelization also used in Cover selection, Jumps, Camera movement – Automatic annotations in Killzone 3 --Mikko Mononen, Paris Game AI Conference 2011 Navigation mesh generation process 66Fanafzar Game Studio
  • 67. Navigation mesh, Zorvan Integration 67Fanafzar Game Studio
  • 68. • Generation Types – Solo – Tiled Navmesh • Dynamic loading • Deal with dynamic obstacles • Off-Mesh Connections • Convex polygons Navigation mesh, Zorvan Integration 68Fanafzar Game Studio
  • 69. • How to simulate movement of intelligent objects like bird, animals, cars, etc. --Craig Reynols • Stanley and Stella in: Breaking the Ice (1987) Steering Behaviors 69Fanafzar Game Studio
  • 70. • Simple Vehicle Model – Mass scalar – Position vector – Velocity vector – max_force scalar – max_speed scalar Steering Behaviors 70Fanafzar Game Studio
  • 71. • Seek • Flee • Flocking • Pursuit • Arrival • Obstacle avoidance • Path follow • Leader follow • Hide Steering Behaviors 71Fanafzar Game Studio
  • 72. • Seek Vs Flee Steering Behaviors 72Fanafzar Game Studio
  • 73. • Seek Vector2D SteeringBehaviors::Seek(Vector2D TargetPos) { Vector2D diff = TargetPos - m_pVehicle->Pos(); Vector2D DesiredVelocity = Vec2DNormalize(diff) * m_pVehicle->MaxSpeed(); return (DesiredVelocity - m_pVehicle->Velocity()); } Steering Behaviors 73Fanafzar Game Studio
  • 74. • Obstacle avoidance – Only circles Steering Behaviors 74Fanafzar Game Studio
  • 75. • Combining Steering Behaviors – Weighted Truncated Sum – Weighted Truncated Running Sum with Prioritization – Prioritized Dithering • Open Steer Steering Behaviors 75Fanafzar Game Studio
  • 76. Advantages – Simplicity – Reliability – Predictability – Efficiency Disadvantages – Local traps • Oscillation – Realism • Jagged paths – Scalability Steering Behaviors 76Fanafzar Game Studio
  • 77. • Pure scripting! • Structured – FSM – HFSM – Behavior Tree Decision Making 77Fanafzar Game Studio
  • 78. • Theory (Simplified) – A set states, S – An input vocabulary, e – Transition function, T(s, e) • Map a state and an input to another state FSM 78Fanafzar Game Studio Patrol (idle) Combat Return to post Pursue Player Seen Near PlayerFar from post Reach post
  • 79. • Finite State Machine (FSM) is the Most Commonly used Game AI Technology Today – Simple – Efficient – Easily extensible – Powerful enough to handle a wide variety of situations • Decisions only depend on current state FSM 79Fanafzar Game Studio
  • 80. • Hard Coded – Switch Statement – Function pointers – Polymorphism (State Pattern) • Interpreted – Data Driven – Scripted • Compiled – machine code – Generating source code FSM 80Fanafzar Game Studio
  • 81. • Function Pointer-Based, Embedded Finite-State Machines – Chapter 3.1, Game programming gems 1 • A Finite-State Machine Class – Chapter 3.3 Game Programming Gems 3 FSM 81Fanafzar Game Studio
  • 82. • Each state can be a complete state machine in its own right • Original Paper – Statecharts: A Visual Formalism for Complex Systems D. Harel Science of Computer Programming 8, 1987 • Clustering states (XOR) • Concurrency (AND) HFSM 82Fanafzar Game Studio
  • 83. • Example HFSM 83Fanafzar Game Studio Patrol (idle) Return to post Pursue Player Seen Near PlayerFar from post Reach post Combat Attack 1 Attack 2 Success
  • 84. • Cluster states • The semantic of D is exclusive-or (XOR) of A and C HFSM 84Fanafzar Game Studio A C B α β δ γ(cond) D
  • 85. • Parallel (AND combination) HFSM 85Fanafzar Game Studio A C α β E G F α δ γ μ A DY
  • 86. Fanafzar Game Studio 86 Iranvij AI Editor
  • 87. Fanafzar Game Studio 87 Iranvij AI Editor
  • 88. • Halo 2 [Bungie Software, 2004] was one of the first high- profile games for which the use of behavior trees. • Instead of a state, the main building block of a behavior tree is a Task • Conditions, Actions, and Composites Behavior tree 88Fanafzar Game Studio
  • 89. • Selector Behavior tree 89Fanafzar Game Studio terminate keep trying ?
  • 90. • Sequence Behavior tree 90Fanafzar Game Studio keep going bail out
  • 91. • Example Behavior tree 91Fanafzar Game Studio ? Door Open? Move (into room) Move (to door) Open door Move (into room) Condition Action
  • 92. • Refactored tree Behavior tree 92Fanafzar Game Studio ? Door Open? Move (to door) Open door Move (into room)
  • 93. • Decorators (such as Invertor) • Random Selector • Random Sequence • Parallel 93Fanafzar Game Studio
  • 94. • Procedural Animation • Procedural level generation • Dynamic game difficulty balancing Next Generation AI for game 94Fanafzar Game Studio
  • 95. • Artificial Intelligence For Games, Second Edition, Ian Millington, John Funge • Programming Game AI by Example, Mat Buckland • Game programming gems series • AI Game Programming Wisdom series • AI Game Development: Synthetic Creatures with Learning and Reactive Behaviors, Alex J. Champandard • http://aigamedev.com/ • http://www.ai-blog.net/archives/000183.html • http://www.critterai.org/nmgen_study References 95Fanafzar Game Studio
  • 97. Fanafzar Game Studio 97 Thank You hojjatjafary@yahoo.com