1fanafzar game studio. how do you think about ai? what is ai 2fanafzar game studio
TRANSCRIPT
![Page 1: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/1.jpg)
Fanafzar Game Studio 1
Introduction to AI in Computer Games
Hojjat JafaryFanafzar Game Studio
November 2012
![Page 2: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/2.jpg)
2Fanafzar Game Studio
• How do you think about AI?
What is AI
![Page 3: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/3.jpg)
3Fanafzar 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
![Page 4: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/4.jpg)
4Fanafzar Game Studio
• The Imitation Game (1950)
• A man (A), a woman (B), and an interrogator (C) who may be of either sex.
Turing Test
![Page 5: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/5.jpg)
5Fanafzar 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
![Page 6: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/6.jpg)
6Fanafzar 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
![Page 7: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/7.jpg)
7Fanafzar 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
![Page 8: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/8.jpg)
8Fanafzar Game Studio
Chinese room
![Page 9: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/9.jpg)
9Fanafzar 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
![Page 10: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/10.jpg)
10Fanafzar 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
![Page 11: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/11.jpg)
11Fanafzar 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
![Page 12: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/12.jpg)
12Fanafzar 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
![Page 13: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/13.jpg)
13Fanafzar 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
![Page 14: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/14.jpg)
14Fanafzar Game Studio
• Classification
Machine Learning - Supervised
![Page 15: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/15.jpg)
15Fanafzar Game Studio
• Clustering– We don’t know number of classes
Machine Learning - Unsupervised
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
… …
![Page 16: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/16.jpg)
16Fanafzar Game Studio
• Clustering
Machine Learning - Unsupervised
![Page 17: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/17.jpg)
17Fanafzar 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
![Page 18: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/18.jpg)
18Fanafzar 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
![Page 19: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/19.jpg)
19Fanafzar Game Studio
• Individual = Chromosomes
• Mutation, Selection, and Crossover.
• Operating on dynamic data sets is difficult• Tendency to converge towards local optima• Randomness
Genetic Algorithm
![Page 20: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/20.jpg)
20Fanafzar Game Studio
• Simplified models of neural processing in the brain
Neural Networks
![Page 21: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/21.jpg)
21Fanafzar Game Studio
• Multilayer Perceptrons
Neural Networks
![Page 22: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/22.jpg)
22Fanafzar 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
![Page 23: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/23.jpg)
23Fanafzar Game Studio
• A good book aboutGA and NN in games
Neural Networks
![Page 24: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/24.jpg)
24Fanafzar Game Studio
Do we really need AI in computer games?
What we expect from game AI?
![Page 25: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/25.jpg)
25Fanafzar 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?
![Page 26: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/26.jpg)
26Fanafzar 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?
![Page 27: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/27.jpg)
27Fanafzar Game Studio
• Agent cycle
Agents as NPCs
THINKSENSE ACT
![Page 28: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/28.jpg)
28Fanafzar Game Studio
• Agent cycle
Agents as NPCs
MAP
GEOMETRY
ENTITIES
. . .
THINK ACT
![Page 29: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/29.jpg)
29Fanafzar Game Studio
• Agent cycle
Agents as NPCs
REMEMBERREASO
N
BEHAVESENSE ACT
![Page 30: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/30.jpg)
30Fanafzar Game Studio
• Agent cycle
Agents as NPCs
ANIMATE
NAVIGATE
. . .
THINKSENSE
![Page 31: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/31.jpg)
31Fanafzar Game Studio
• 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
![Page 32: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/32.jpg)
32Fanafzar 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
![Page 33: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/33.jpg)
33Fanafzar 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
![Page 34: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/34.jpg)
34Fanafzar 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
![Page 35: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/35.jpg)
35Fanafzar Game Studio
• Near-Optimal Hierarchical Pathfinding,– A. Botea, M. Muller, and J. Schaeffer, Journal of Game
Development, Volume 1
Hierarchical Pathfinding
![Page 36: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/36.jpg)
36Fanafzar Game Studio
• Grid/Tile Base– Fast– Easy to develop– Memory Inefficient– 2D and strategy games
Reviewing some pathfinding methods
![Page 37: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/37.jpg)
37Fanafzar Game Studio
• Waypoint graphs– Manual
Reviewing some pathfinding methods
![Page 38: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/38.jpg)
38Fanafzar Game Studio
• Waypoint graphs– Automated : Point of visibility
Reviewing some pathfinding methods
![Page 39: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/39.jpg)
39Fanafzar 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
![Page 40: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/40.jpg)
Fanafzar Game Studio 40
Reviewing some pathfinding methods
Inefficient
![Page 41: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/41.jpg)
41Fanafzar Game Studio
• Convex Polygons– Manual/Automated
Reviewing some pathfinding methods
![Page 42: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/42.jpg)
42Fanafzar Game Studio
• Shortest path - Optimal• Smaller Search Space
Reviewing some pathfinding methods
![Page 43: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/43.jpg)
43Fanafzar Game Studio
Reviewing some pathfinding methods
OK, But how to
implement?
![Page 44: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/44.jpg)
44Fanafzar Game Studio
Reviewing some pathfinding methods• Mesh simplification
• Rendering techniques
• Flood filling with AABBs (UDK)
• Voxelization
• Check Mikko Monone’s work, RecastNavigation– http://digestingduck.blogspot.com
![Page 45: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/45.jpg)
45Fanafzar Game Studio
• The general process is as follows:
1. Voxelization2. Generate Regions3. Generate Contours4. Generate Polygon Mesh5. Generate Detailed Mesh
Navigation mesh generation process
![Page 46: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/46.jpg)
46Fanafzar Game Studio
1. Voxelization
Navigation mesh generation process
![Page 47: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/47.jpg)
47Fanafzar Game Studio
1. Voxelization
Navigation mesh generation process
![Page 48: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/48.jpg)
48Fanafzar Game Studio
1. Voxelization
Navigation mesh generation process
![Page 49: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/49.jpg)
49Fanafzar Game Studio
1. Voxelization
Navigation mesh generation process
![Page 50: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/50.jpg)
50Fanafzar Game Studio
1. Voxelization
Navigation mesh generation process
![Page 51: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/51.jpg)
51Fanafzar Game Studio
1. Voxelization
Navigation mesh generation process
![Page 52: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/52.jpg)
52Fanafzar Game Studio
2. Generate Regions
Navigation mesh generation process
![Page 53: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/53.jpg)
53Fanafzar Game Studio
2. Generate Regions
Navigation mesh generation process
![Page 54: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/54.jpg)
54Fanafzar Game Studio
2. Generate Regions
Navigation mesh generation process
![Page 55: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/55.jpg)
55Fanafzar Game Studio
3. Generate Contours
Navigation mesh generation process
![Page 56: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/56.jpg)
56Fanafzar Game Studio
3. Generate Contours
Navigation mesh generation process
![Page 57: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/57.jpg)
57Fanafzar Game Studio
3. Generate ContoursDouglas-Peucker simplification
Navigation mesh generation process
![Page 58: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/58.jpg)
58Fanafzar Game Studio
3. Generate ContoursDouglas-Peucker simplification
Navigation mesh generation process
![Page 59: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/59.jpg)
59Fanafzar Game Studio
3. Generate ContoursDouglas-Peucker simplification
Navigation mesh generation process
![Page 60: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/60.jpg)
60Fanafzar Game Studio
4. Generate Polygon Mesh– Triangulation– Merge to Convex Polygon– Benefits of Convex Polygon
Navigation mesh generation process
![Page 61: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/61.jpg)
61Fanafzar Game Studio
5. Generate Detailed Mesh
Navigation mesh generation process
![Page 62: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/62.jpg)
62Fanafzar Game Studio
5. Generate Detailed Mesh
Navigation mesh generation process
![Page 63: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/63.jpg)
63Fanafzar 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
![Page 64: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/64.jpg)
64Fanafzar 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
![Page 65: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/65.jpg)
65Fanafzar Game Studio
• Velocity obstacle
• There are some variations – RVO, NLVO, FVO, HRVO, NHRVO, PVO
• Mikko uses RVO(Reciprocal Velocity Obstacles)
Navigation mesh generation process
![Page 66: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/66.jpg)
66Fanafzar 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
![Page 67: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/67.jpg)
67Fanafzar Game Studio
Navigation mesh, Zorvan Integration
![Page 68: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/68.jpg)
68Fanafzar Game Studio
• Generation Types– Solo– Tiled Navmesh
• Dynamic loading• Deal with dynamic obstacles
• Off-Mesh Connections• Convex polygons
Navigation mesh, Zorvan Integration
![Page 69: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/69.jpg)
69Fanafzar 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
![Page 70: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/70.jpg)
70Fanafzar Game Studio
• Simple Vehicle Model– Mass scalar– Position vector– Velocity vector– max_force scalar– max_speed scalar
Steering Behaviors
![Page 71: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/71.jpg)
71Fanafzar Game Studio
• Seek• Flee• Flocking• Pursuit• Arrival• Obstacle avoidance• Path follow• Leader follow• Hide
Steering Behaviors
![Page 72: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/72.jpg)
72Fanafzar Game Studio
• Seek Vs Flee
Steering Behaviors
![Page 73: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/73.jpg)
73Fanafzar 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
![Page 74: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/74.jpg)
74Fanafzar Game Studio
• Obstacle avoidance– Only circles
Steering Behaviors
![Page 75: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/75.jpg)
75Fanafzar Game Studio
• Combining Steering Behaviors– Weighted Truncated Sum– Weighted Truncated Running Sum with Prioritization– Prioritized Dithering
• Open Steer
Steering Behaviors
![Page 76: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/76.jpg)
76Fanafzar Game Studio
Advantages– Simplicity– Reliability– Predictability– Efficiency
Disadvantages– Local traps
• Oscillation
– Realism• Jagged paths
– Scalability
Steering Behaviors
![Page 77: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/77.jpg)
77Fanafzar Game Studio
• Pure scripting!
• Structured – FSM– HFSM– Behavior Tree
Decision Making
![Page 78: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/78.jpg)
78Fanafzar 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
Patrol (idle)
Combat
Return to post
PursuePlayer Seen
Near PlayerFar from postReach post
![Page 79: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/79.jpg)
79Fanafzar Game Studio
• 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
![Page 80: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/80.jpg)
80Fanafzar Game Studio
• Hard Coded– Switch Statement– Function pointers– Polymorphism (State Pattern)
• Interpreted– Data Driven– Scripted
• Compiled– machine code– Generating source code
FSM
![Page 81: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/81.jpg)
81Fanafzar 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
![Page 82: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/82.jpg)
82Fanafzar 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
![Page 83: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/83.jpg)
83Fanafzar Game Studio
• Example
HFSM
Patrol (idle)
Return to post
PursuePlayer Seen
Near PlayerFar from post
Reach post
Combat
Attack 1 Attack 2
Success
![Page 84: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/84.jpg)
84Fanafzar Game Studio
• Cluster states• The semantic of D is exclusive-or (XOR) of A and C
HFSM
A
C
B
α
β
δ
γ(cond)
D
![Page 85: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/85.jpg)
85Fanafzar Game Studio
• Parallel (AND combination)
HFSM
A
C
α β
E
G
F
α
δ
γ μ
A DY
![Page 86: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/86.jpg)
Fanafzar Game Studio 86
Iranvij AI Editor
![Page 87: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/87.jpg)
Fanafzar Game Studio 87
Iranvij AI Editor
![Page 88: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/88.jpg)
88Fanafzar Game Studio
• 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
![Page 89: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/89.jpg)
89Fanafzar Game Studio
• Selector
Behavior tree
terminate
keep trying
?
![Page 90: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/90.jpg)
90Fanafzar Game Studio
• Sequence
Behavior tree
keep going
bail out
![Page 91: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/91.jpg)
91Fanafzar Game Studio
• Example
Behavior tree
?
DoorOpen?
Move(into room)
Move(to door)
Opendoor
Move(into room)
Condition Action
![Page 92: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/92.jpg)
92Fanafzar Game Studio
• Refactored tree
Behavior tree
?
DoorOpen?
Move(to door)
Opendoor
Move(into room)
![Page 93: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/93.jpg)
93Fanafzar Game Studio
• Decorators (such as Invertor)
• Random Selector
• Random Sequence
• Parallel
![Page 94: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/94.jpg)
94Fanafzar Game Studio
• Procedural Animation
• Procedural level generation
• Dynamic game difficulty balancing
Next Generation AI for game
![Page 95: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/95.jpg)
95Fanafzar 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
![Page 96: 1Fanafzar Game Studio. How do you think about AI? What is AI 2Fanafzar Game Studio](https://reader038.vdocuments.net/reader038/viewer/2022103111/5518c6f5550346a61f8b5837/html5/thumbnails/96.jpg)
96Fanafzar Game Studio
• http://digestingduck.blogspot.com/
References