SlideShare une entreprise Scribd logo
1  sur  47
INTRO TO INTELLIGENT AND
AUTONOMOUS AGENTS



Steering behaviors and pathfinding
Game AI

 What we’re covering today
   And what we’re not
 How AI can improve your games
 Autonomous agents
Steering Behaviors

 What they are
 When they’re used
   Quite often
   http://www.youtube.com/watch?v=e2YYtSJhmJg
   Movies
 Let’s try some out!
Seek

 Move entity from current position to target
  position as quickly as possible
Our entity is the triangle. How do we get to the
target?
Desired velocity = target.position - myPosition
You can get a vector pointing from A to B by B - A
Don’t worry about
overshooting, it’ll be
corrected
Other steering behaviors

 Arrive
 Obstacle Avoidance


 Make sure we don’t have a force that’s too
  big!
Using SBs in your Entities

 ChasePlayer State
   Obstacle avoidance, Pursue or Seek
 Idle State
   Wander, maybe flocking?


 Sheep
   Flocking, Wander, Obstacle Avoidance, Evade
Steering behaviors ftw :?
Wouldn’t this be lovely? Well then, let’s find a path
A graph of points! (navigation graph)
Building a Nav Graph

 Goal: A list of nodes and edges
 What is needed:
   Start point, cast distance, interval
   (optional)Max number of nodes
Data Structures

GraphNode                              GraphEdge

Vector3 position                       GraphNode fromNode
GraphEdge[4] edges                     GraphFrom toNode
                                       (Float weight)
List<GraphNodes> Nodes

For ( i = 1; i <= xCastDistance; ++i)
      For (j = 1; j <= zCastDistance; ++j)
      {
            cast a ray downward from above for each potential neighbor node
            (i.e. (curX + invertal, curZ), (curX, curZ + interval), etc.)
            if raycast hit the ground
            {
                  new GraphNode(GraphNode(Raycast hit point))
                 if we haven’t already found this node
                 {
                        Add new graph node to Nodes
                 }

             (calculate edge cost)
             new GraphEdge(current node, new graph node, cost))
             Add new graph edge to the current node’s Edge list
         }
Start from initial position, start casting out!
What happens when node cast hits out of bounds?
New position
Nothing new, just adding another node/edge
:o A box!
Hit an object not tagged ground, skip it, keep moving
:OOOOO But we already processed that node!
Result depends on algorithm implementation. Easy route (the way the pseudo code was
setup) is to have each node responsible for itself. So in our case add the edge and ignore
the node.
Improvements Worth Mentioning

 Reducing node density
 Indexing GraphNodes and GraphEdges
Data Structures for Indexing

GraphNode                                         GraphEdge

int index                                         int fromNodeIndex
Vector3 position                                  int toNodeIndex
GraphEdge[4] mEdges                               float weight




  Instead of storing the GraphNodes that a GraphEdge is connected to, we
  store the index of each GraphNode, so we’re not storing a GraphNode twice
Take a look at that graph
Search Algorithms

 Depth-first search
 Breadth-first search
 Dijkstra’s algorithm
 A* (aka Dijkstra++)
   ^ yahtzee
Dijkstra’s Algorithm

 Usable with weighted graphs. Graphs without
  weight can be processed by assuming edges
  of equal weight
 Guaranteed to find shortest path, if it exists.
 Implementation
   Examine nodes on our search frontier, find the
    one with the smallest total weight, and add it to
    our path and keep going
Picture from “Programming Game AI by Example” by Mat Buckland
Picture from “Programming Game AI by Example” by Mat Buckland
A*

 Dijkstra with an additional weight factor
  (heuristic)
   Heuristic: Making a decision based on some knowledge

 There’s something troublesome in the Dijsktra
  implementation that seems like it would be an
  easy fix
We know where our target is, so let’s
 approximate the cost from the nodes we are
 looking at to the target and factor that
 into what we choose
In this case, Euclidean distance
Manhattan Distance
Results
Picture from “Programming Game AI by Example” by Mat Buckland
Picture from “Programming Game AI by Example” by Mat Buckland
Review

 Steering behaviors
 Navigation graphs
 Search algorithms


 So how do they work together?
   You have a point on the graph you want to reach.
   You find a sequence of nodes to follow.
   Use steering behaviors to get from point to
    point, and create interesting behavior on the way
Next time…

 Organizing these lower level decisions into
  functional, autonomous agents (in a
  smart, extendable, debug-friendly way )

 Questions?

(can someone let Jordan know he can wake up now? kthx)

Contenu connexe

Tendances

Shadow Volumes on Programmable Graphics Hardware
Shadow Volumes on Programmable Graphics HardwareShadow Volumes on Programmable Graphics Hardware
Shadow Volumes on Programmable Graphics Hardwarestefan_b
 
The Speed of Two Objects
The Speed of Two ObjectsThe Speed of Two Objects
The Speed of Two ObjectsAlex Lee
 
02 Geographic scripting in uDig - halfway between user and developer
02 Geographic scripting in uDig - halfway between user and developer02 Geographic scripting in uDig - halfway between user and developer
02 Geographic scripting in uDig - halfway between user and developerAndrea Antonello
 
Machine Learning lecture2(linear regression)
Machine Learning lecture2(linear regression)Machine Learning lecture2(linear regression)
Machine Learning lecture2(linear regression)cairo university
 
Texture mapping in_opengl
Texture mapping in_openglTexture mapping in_opengl
Texture mapping in_openglManas Nayak
 
Machine Learning lecture3(linear regression)
Machine Learning lecture3(linear regression)Machine Learning lecture3(linear regression)
Machine Learning lecture3(linear regression)cairo university
 
CS 354 Object Viewing and Representation
CS 354 Object Viewing and RepresentationCS 354 Object Viewing and Representation
CS 354 Object Viewing and RepresentationMark Kilgard
 
Opensource gis development - part 4
Opensource gis development - part 4Opensource gis development - part 4
Opensource gis development - part 4Andrea Antonello
 
Artdm170 week12 user_interaction
Artdm170 week12 user_interactionArtdm170 week12 user_interaction
Artdm170 week12 user_interactionGilbert Guerrero
 
CS 354 Texture Mapping
CS 354 Texture MappingCS 354 Texture Mapping
CS 354 Texture MappingMark Kilgard
 
Image processing for robotics
Image processing for roboticsImage processing for robotics
Image processing for roboticsSALAAMCHAUS
 
Class[6][5th aug] [three js-loaders]
Class[6][5th aug] [three js-loaders]Class[6][5th aug] [three js-loaders]
Class[6][5th aug] [three js-loaders]Saajid Akram
 
Generative Adversarial Networks
Generative Adversarial NetworksGenerative Adversarial Networks
Generative Adversarial NetworksMark Chang
 
CS 354 Pixel Updating
CS 354 Pixel UpdatingCS 354 Pixel Updating
CS 354 Pixel UpdatingMark Kilgard
 
Unsupervised learning represenation with DCGAN
Unsupervised learning represenation with DCGANUnsupervised learning represenation with DCGAN
Unsupervised learning represenation with DCGANShyam Krishna Khadka
 
CSS3: Border And Colors
CSS3: Border And ColorsCSS3: Border And Colors
CSS3: Border And ColorsReema
 
Andrew Goldberg. Highway Dimension and Provably Efficient Shortest Path Algor...
Andrew Goldberg. Highway Dimension and Provably Efficient Shortest Path Algor...Andrew Goldberg. Highway Dimension and Provably Efficient Shortest Path Algor...
Andrew Goldberg. Highway Dimension and Provably Efficient Shortest Path Algor...Computer Science Club
 

Tendances (20)

Shadow Volumes on Programmable Graphics Hardware
Shadow Volumes on Programmable Graphics HardwareShadow Volumes on Programmable Graphics Hardware
Shadow Volumes on Programmable Graphics Hardware
 
The Speed of Two Objects
The Speed of Two ObjectsThe Speed of Two Objects
The Speed of Two Objects
 
02 Geographic scripting in uDig - halfway between user and developer
02 Geographic scripting in uDig - halfway between user and developer02 Geographic scripting in uDig - halfway between user and developer
02 Geographic scripting in uDig - halfway between user and developer
 
Machine Learning lecture2(linear regression)
Machine Learning lecture2(linear regression)Machine Learning lecture2(linear regression)
Machine Learning lecture2(linear regression)
 
Texture mapping in_opengl
Texture mapping in_openglTexture mapping in_opengl
Texture mapping in_opengl
 
Machine Learning lecture3(linear regression)
Machine Learning lecture3(linear regression)Machine Learning lecture3(linear regression)
Machine Learning lecture3(linear regression)
 
Data structure
Data structureData structure
Data structure
 
CS 354 Object Viewing and Representation
CS 354 Object Viewing and RepresentationCS 354 Object Viewing and Representation
CS 354 Object Viewing and Representation
 
Opensource gis development - part 4
Opensource gis development - part 4Opensource gis development - part 4
Opensource gis development - part 4
 
Artdm170 week12 user_interaction
Artdm170 week12 user_interactionArtdm170 week12 user_interaction
Artdm170 week12 user_interaction
 
CS 354 Texture Mapping
CS 354 Texture MappingCS 354 Texture Mapping
CS 354 Texture Mapping
 
Image processing for robotics
Image processing for roboticsImage processing for robotics
Image processing for robotics
 
Spectral graph theory
Spectral graph theorySpectral graph theory
Spectral graph theory
 
Class[6][5th aug] [three js-loaders]
Class[6][5th aug] [three js-loaders]Class[6][5th aug] [three js-loaders]
Class[6][5th aug] [three js-loaders]
 
Generative Adversarial Networks
Generative Adversarial NetworksGenerative Adversarial Networks
Generative Adversarial Networks
 
CS 354 Pixel Updating
CS 354 Pixel UpdatingCS 354 Pixel Updating
CS 354 Pixel Updating
 
Unsupervised learning represenation with DCGAN
Unsupervised learning represenation with DCGANUnsupervised learning represenation with DCGAN
Unsupervised learning represenation with DCGAN
 
Transfer learningforclp
Transfer learningforclpTransfer learningforclp
Transfer learningforclp
 
CSS3: Border And Colors
CSS3: Border And ColorsCSS3: Border And Colors
CSS3: Border And Colors
 
Andrew Goldberg. Highway Dimension and Provably Efficient Shortest Path Algor...
Andrew Goldberg. Highway Dimension and Provably Efficient Shortest Path Algor...Andrew Goldberg. Highway Dimension and Provably Efficient Shortest Path Algor...
Andrew Goldberg. Highway Dimension and Provably Efficient Shortest Path Algor...
 

En vedette

Steering Behaviours: Wander
Steering Behaviours: WanderSteering Behaviours: Wander
Steering Behaviours: WanderSam Cartwright
 
Massive Battle: Coordinated Movement of Autonomous Agents
Massive Battle: Coordinated Movement of Autonomous AgentsMassive Battle: Coordinated Movement of Autonomous Agents
Massive Battle: Coordinated Movement of Autonomous AgentsWolfgang Hürst
 
AI in Games- Steering, Wander and Flocking behavior
AI in Games- Steering, Wander and Flocking behaviorAI in Games- Steering, Wander and Flocking behavior
AI in Games- Steering, Wander and Flocking behaviorナム-Nam Nguyễn
 
Autonomous Agents on the Web: Beyond Linking and Meaning Mike Amundsen Keynot...
Autonomous Agents on the Web: Beyond Linking and Meaning Mike Amundsen Keynot...Autonomous Agents on the Web: Beyond Linking and Meaning Mike Amundsen Keynot...
Autonomous Agents on the Web: Beyond Linking and Meaning Mike Amundsen Keynot...CA API Management
 

En vedette (8)

Presentation5
Presentation5Presentation5
Presentation5
 
Steering Behaviours: Wander
Steering Behaviours: WanderSteering Behaviours: Wander
Steering Behaviours: Wander
 
Driving simulators to support the design of autonomous vehicles
Driving simulators to support the design of autonomous vehiclesDriving simulators to support the design of autonomous vehicles
Driving simulators to support the design of autonomous vehicles
 
Massive Battle: Coordinated Movement of Autonomous Agents
Massive Battle: Coordinated Movement of Autonomous AgentsMassive Battle: Coordinated Movement of Autonomous Agents
Massive Battle: Coordinated Movement of Autonomous Agents
 
AI in Games- Steering, Wander and Flocking behavior
AI in Games- Steering, Wander and Flocking behaviorAI in Games- Steering, Wander and Flocking behavior
AI in Games- Steering, Wander and Flocking behavior
 
Autonomous Agents on the Web: Beyond Linking and Meaning Mike Amundsen Keynot...
Autonomous Agents on the Web: Beyond Linking and Meaning Mike Amundsen Keynot...Autonomous Agents on the Web: Beyond Linking and Meaning Mike Amundsen Keynot...
Autonomous Agents on the Web: Beyond Linking and Meaning Mike Amundsen Keynot...
 
Mobile platform
Mobile platformMobile platform
Mobile platform
 
Software engineering-quiz
Software engineering-quizSoftware engineering-quiz
Software engineering-quiz
 

Similaire à Ai part 1

Difference between logistic regression shallow neural network and deep neura...
Difference between logistic regression  shallow neural network and deep neura...Difference between logistic regression  shallow neural network and deep neura...
Difference between logistic regression shallow neural network and deep neura...Chode Amarnath
 
Auto encoders in Deep Learning
Auto encoders in Deep LearningAuto encoders in Deep Learning
Auto encoders in Deep LearningShajun Nisha
 
Practical Digital Image Processing 3
 Practical Digital Image Processing 3 Practical Digital Image Processing 3
Practical Digital Image Processing 3Aly Abdelkareem
 
The Day You Finally Use Algebra: A 3D Math Primer
The Day You Finally Use Algebra: A 3D Math PrimerThe Day You Finally Use Algebra: A 3D Math Primer
The Day You Finally Use Algebra: A 3D Math PrimerJanie Clayton
 
3D Math Primer: CocoaConf Chicago
3D Math Primer: CocoaConf Chicago3D Math Primer: CocoaConf Chicago
3D Math Primer: CocoaConf ChicagoJanie Clayton
 
ABSTRACT GRAPH MACHINE: MODELING ORDERINGS IN ASYNCHRONOUS DISTRIBUTED-MEMORY...
ABSTRACT GRAPH MACHINE: MODELING ORDERINGS IN ASYNCHRONOUS DISTRIBUTED-MEMORY...ABSTRACT GRAPH MACHINE: MODELING ORDERINGS IN ASYNCHRONOUS DISTRIBUTED-MEMORY...
ABSTRACT GRAPH MACHINE: MODELING ORDERINGS IN ASYNCHRONOUS DISTRIBUTED-MEMORY...Thejaka Amila Kanewala, Ph.D.
 
2017 RM-URISA Track: Spatial SQL - The Best Kept Secret in the Geospatial World
2017 RM-URISA Track:  Spatial SQL - The Best Kept Secret in the Geospatial World2017 RM-URISA Track:  Spatial SQL - The Best Kept Secret in the Geospatial World
2017 RM-URISA Track: Spatial SQL - The Best Kept Secret in the Geospatial WorldGIS in the Rockies
 
Prim's Algorithm on minimum spanning tree
Prim's Algorithm on minimum spanning treePrim's Algorithm on minimum spanning tree
Prim's Algorithm on minimum spanning treeoneous
 
2-Heuristic Search.ppt
2-Heuristic Search.ppt2-Heuristic Search.ppt
2-Heuristic Search.pptMIT,Imphal
 
Monads and Monoids by Oleksiy Dyagilev
Monads and Monoids by Oleksiy DyagilevMonads and Monoids by Oleksiy Dyagilev
Monads and Monoids by Oleksiy DyagilevJavaDayUA
 
Graph Analytics - From the Whiteboard to Your Toolbox - Sam Lerma
Graph Analytics - From the Whiteboard to Your Toolbox - Sam LermaGraph Analytics - From the Whiteboard to Your Toolbox - Sam Lerma
Graph Analytics - From the Whiteboard to Your Toolbox - Sam LermaPyData
 
Lec5 pagerank
Lec5 pagerankLec5 pagerank
Lec5 pagerankCarlos
 

Similaire à Ai part 1 (20)

Difference between logistic regression shallow neural network and deep neura...
Difference between logistic regression  shallow neural network and deep neura...Difference between logistic regression  shallow neural network and deep neura...
Difference between logistic regression shallow neural network and deep neura...
 
Auto encoders in Deep Learning
Auto encoders in Deep LearningAuto encoders in Deep Learning
Auto encoders in Deep Learning
 
Pathfinding in games
Pathfinding in gamesPathfinding in games
Pathfinding in games
 
dijkstra algo.ppt
dijkstra algo.pptdijkstra algo.ppt
dijkstra algo.ppt
 
Practical Digital Image Processing 3
 Practical Digital Image Processing 3 Practical Digital Image Processing 3
Practical Digital Image Processing 3
 
The Day You Finally Use Algebra: A 3D Math Primer
The Day You Finally Use Algebra: A 3D Math PrimerThe Day You Finally Use Algebra: A 3D Math Primer
The Day You Finally Use Algebra: A 3D Math Primer
 
SIFT
SIFTSIFT
SIFT
 
3D Math Primer: CocoaConf Chicago
3D Math Primer: CocoaConf Chicago3D Math Primer: CocoaConf Chicago
3D Math Primer: CocoaConf Chicago
 
ABSTRACT GRAPH MACHINE: MODELING ORDERINGS IN ASYNCHRONOUS DISTRIBUTED-MEMORY...
ABSTRACT GRAPH MACHINE: MODELING ORDERINGS IN ASYNCHRONOUS DISTRIBUTED-MEMORY...ABSTRACT GRAPH MACHINE: MODELING ORDERINGS IN ASYNCHRONOUS DISTRIBUTED-MEMORY...
ABSTRACT GRAPH MACHINE: MODELING ORDERINGS IN ASYNCHRONOUS DISTRIBUTED-MEMORY...
 
2017 RM-URISA Track: Spatial SQL - The Best Kept Secret in the Geospatial World
2017 RM-URISA Track:  Spatial SQL - The Best Kept Secret in the Geospatial World2017 RM-URISA Track:  Spatial SQL - The Best Kept Secret in the Geospatial World
2017 RM-URISA Track: Spatial SQL - The Best Kept Secret in the Geospatial World
 
Prim's Algorithm on minimum spanning tree
Prim's Algorithm on minimum spanning treePrim's Algorithm on minimum spanning tree
Prim's Algorithm on minimum spanning tree
 
Distributed computing with spark
Distributed computing with sparkDistributed computing with spark
Distributed computing with spark
 
Primitives
PrimitivesPrimitives
Primitives
 
2-Heuristic Search.ppt
2-Heuristic Search.ppt2-Heuristic Search.ppt
2-Heuristic Search.ppt
 
Computer graphics
Computer graphicsComputer graphics
Computer graphics
 
Monads and Monoids by Oleksiy Dyagilev
Monads and Monoids by Oleksiy DyagilevMonads and Monoids by Oleksiy Dyagilev
Monads and Monoids by Oleksiy Dyagilev
 
Graph Analytics - From the Whiteboard to Your Toolbox - Sam Lerma
Graph Analytics - From the Whiteboard to Your Toolbox - Sam LermaGraph Analytics - From the Whiteboard to Your Toolbox - Sam Lerma
Graph Analytics - From the Whiteboard to Your Toolbox - Sam Lerma
 
artifical intelligence final paper
artifical intelligence final paperartifical intelligence final paper
artifical intelligence final paper
 
Lec5 Pagerank
Lec5 PagerankLec5 Pagerank
Lec5 Pagerank
 
Lec5 pagerank
Lec5 pagerankLec5 pagerank
Lec5 pagerank
 

Plus de spartasoft

Interviewing and Getting a Job 101
Interviewing and Getting a Job 101Interviewing and Getting a Job 101
Interviewing and Getting a Job 101spartasoft
 
Spartasoft Month Long Game Roundtable
Spartasoft Month Long Game RoundtableSpartasoft Month Long Game Roundtable
Spartasoft Month Long Game Roundtablespartasoft
 
Gpu presentation
Gpu presentationGpu presentation
Gpu presentationspartasoft
 
GDC 2011 recap
GDC 2011 recapGDC 2011 recap
GDC 2011 recapspartasoft
 
Console development
Console developmentConsole development
Console developmentspartasoft
 
Build some PR!
Build some PR!Build some PR!
Build some PR!spartasoft
 

Plus de spartasoft (7)

Interviewing and Getting a Job 101
Interviewing and Getting a Job 101Interviewing and Getting a Job 101
Interviewing and Getting a Job 101
 
Spartasoft Month Long Game Roundtable
Spartasoft Month Long Game RoundtableSpartasoft Month Long Game Roundtable
Spartasoft Month Long Game Roundtable
 
Gpu presentation
Gpu presentationGpu presentation
Gpu presentation
 
GDC 2011 recap
GDC 2011 recapGDC 2011 recap
GDC 2011 recap
 
Console development
Console developmentConsole development
Console development
 
Build some PR!
Build some PR!Build some PR!
Build some PR!
 
Unite 2010
Unite 2010Unite 2010
Unite 2010
 

Dernier

Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024Janet Corral
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...PsychoTech Services
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 

Dernier (20)

Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 

Ai part 1

  • 1. INTRO TO INTELLIGENT AND AUTONOMOUS AGENTS Steering behaviors and pathfinding
  • 2. Game AI  What we’re covering today  And what we’re not  How AI can improve your games  Autonomous agents
  • 3. Steering Behaviors  What they are  When they’re used  Quite often  http://www.youtube.com/watch?v=e2YYtSJhmJg  Movies  Let’s try some out!
  • 4. Seek  Move entity from current position to target position as quickly as possible
  • 5. Our entity is the triangle. How do we get to the target?
  • 6. Desired velocity = target.position - myPosition
  • 7. You can get a vector pointing from A to B by B - A
  • 8.
  • 9.
  • 10. Don’t worry about overshooting, it’ll be corrected
  • 11. Other steering behaviors  Arrive  Obstacle Avoidance  Make sure we don’t have a force that’s too big!
  • 12. Using SBs in your Entities  ChasePlayer State  Obstacle avoidance, Pursue or Seek  Idle State  Wander, maybe flocking?  Sheep  Flocking, Wander, Obstacle Avoidance, Evade
  • 14. Wouldn’t this be lovely? Well then, let’s find a path
  • 15. A graph of points! (navigation graph)
  • 16. Building a Nav Graph  Goal: A list of nodes and edges  What is needed:  Start point, cast distance, interval  (optional)Max number of nodes
  • 17. Data Structures GraphNode GraphEdge Vector3 position GraphNode fromNode GraphEdge[4] edges GraphFrom toNode (Float weight)
  • 18. List<GraphNodes> Nodes For ( i = 1; i <= xCastDistance; ++i) For (j = 1; j <= zCastDistance; ++j) { cast a ray downward from above for each potential neighbor node (i.e. (curX + invertal, curZ), (curX, curZ + interval), etc.) if raycast hit the ground { new GraphNode(GraphNode(Raycast hit point)) if we haven’t already found this node { Add new graph node to Nodes } (calculate edge cost) new GraphEdge(current node, new graph node, cost)) Add new graph edge to the current node’s Edge list }
  • 19. Start from initial position, start casting out!
  • 20.
  • 21. What happens when node cast hits out of bounds?
  • 22.
  • 24. Nothing new, just adding another node/edge
  • 25. :o A box! Hit an object not tagged ground, skip it, keep moving
  • 26. :OOOOO But we already processed that node! Result depends on algorithm implementation. Easy route (the way the pseudo code was setup) is to have each node responsible for itself. So in our case add the edge and ignore the node.
  • 27. Improvements Worth Mentioning  Reducing node density  Indexing GraphNodes and GraphEdges
  • 28. Data Structures for Indexing GraphNode GraphEdge int index int fromNodeIndex Vector3 position int toNodeIndex GraphEdge[4] mEdges float weight Instead of storing the GraphNodes that a GraphEdge is connected to, we store the index of each GraphNode, so we’re not storing a GraphNode twice
  • 29. Take a look at that graph
  • 30. Search Algorithms  Depth-first search  Breadth-first search  Dijkstra’s algorithm  A* (aka Dijkstra++)  ^ yahtzee
  • 31. Dijkstra’s Algorithm  Usable with weighted graphs. Graphs without weight can be processed by assuming edges of equal weight  Guaranteed to find shortest path, if it exists.  Implementation  Examine nodes on our search frontier, find the one with the smallest total weight, and add it to our path and keep going
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39. Picture from “Programming Game AI by Example” by Mat Buckland
  • 40. Picture from “Programming Game AI by Example” by Mat Buckland
  • 41. A*  Dijkstra with an additional weight factor (heuristic)  Heuristic: Making a decision based on some knowledge  There’s something troublesome in the Dijsktra implementation that seems like it would be an easy fix
  • 42. We know where our target is, so let’s approximate the cost from the nodes we are looking at to the target and factor that into what we choose In this case, Euclidean distance
  • 44. Results Picture from “Programming Game AI by Example” by Mat Buckland
  • 45. Picture from “Programming Game AI by Example” by Mat Buckland
  • 46. Review  Steering behaviors  Navigation graphs  Search algorithms  So how do they work together?  You have a point on the graph you want to reach.  You find a sequence of nodes to follow.  Use steering behaviors to get from point to point, and create interesting behavior on the way
  • 47. Next time…  Organizing these lower level decisions into functional, autonomous agents (in a smart, extendable, debug-friendly way )  Questions? (can someone let Jordan know he can wake up now? kthx)

Notes de l'éditeur

  1. Steering behaviors as low level movement logic, often used in combination with each other to create interesting behaviors for autonomous agents.A few weeks ago one of the AI programmers on Castlevania: LoS was talking about, well, AI in LoS. I found it interesting when he mentioned the birds on the crow witch was mostly a flocking behavior, with some tweaksFlocks of bats and herds of penguins in Batman Returns, movement of orc armies in Lord of the RingsWhile you won’t use everyone in every game, having an understanding of them and saving them in your back pocket can be extremely useful.
  2. It would be great to have a direct path to follow to get there, wouldn’t it? What do we need to accomplish this? First, we need a large
  3. If your graph isn’t going to utilize special terrain