SlideShare uma empresa Scribd logo
1 de 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)

Mais conteúdo relacionado

Mais procurados

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
 

Mais procurados (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...
 

Destaque

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
 

Destaque (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
 

Semelhante a 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
 

Semelhante a 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
 

Mais 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
 

Mais 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
 

Último

Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfTechSoup
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
Q4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptxQ4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptxnelietumpap1
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomnelietumpap1
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Celine George
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptxSherlyMaeNeri
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 

Último (20)

Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptxFINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
Raw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptxRaw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptx
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 
Q4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptxQ4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptx
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choom
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17
 
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptxYOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptx
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.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)

Notas do Editor

  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