Artificial Intelligence in Game Design Dynamic Path Planning Algorithms.

Slides:



Advertisements
Similar presentations
Artificial Intelligence in Game Design
Advertisements

Wall Building for RTS Games Patrick Schmid. Age of Empires.
Heuristic Search techniques
Problem solving with graph search
AI Pathfinding Representing the Search Space
Traveling Salesperson Problem
Types of Algorithms.
Lecture 24 Coping with NPC and Unsolvable problems. When a problem is unsolvable, that's generally very bad news: it means there is no general algorithm.
Chapter 7 Negotiating Intersections
Chapter 10: Negotiating Intersections
Pathfinding. “PathEngine is a sophisticated middleware tool- kit for the implementation of intelligent agent movement, built around an advanced implementation.
CSE 380 – Computer Game Programming Pathfinding AI
Delaware State Driver’s Education Study Guide. Drivers have trouble seeing motorcycles in traffic. Why?
Generated Waypoint Efficiency: The efficiency considered here is defined as follows: As can be seen from the graph, for the obstruction radius values (200,
Multiagent Probabilistic Smart Terrain Dr. John R. Sullins Youngstown State University.
Artificial Intelligence in Game Design Intelligent Decision Making and Decision Trees.
Artificial Intelligence in Game Design Introduction to Learning.
Algorithm Strategies Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
DRIVING TOO FAST FOR CONDITIONS A Collision Countermeasures Presentation.
MAE 552 – Heuristic Optimization Lecture 27 April 3, 2002
Pathfinding Algorithms Josh Palmer Rachael Beers.
Chapter 5.4 Artificial Intelligence: Pathfinding.
State-Space Searches. 2 State spaces A state space consists of –A (possibly infinite) set of states The start state represents the initial problem Each.
State-Space Searches.
Artificial Intelligence in Game Design Camera Control.
Negotiating Intersections
Artificial Intelligence in Game Design Event and Sense Management.
Dijkstra’s Algorithm and Heuristic Graph Search David Johnson.
Chapter 5.4 Artificial Intelligence: Pathfinding.
Shortest Path Algorithms. Kruskal’s Algorithm We construct a set of edges A satisfying the following invariant:  A is a subset of some MST We start with.
Artificial Intelligence in Game Design Problems and Goals.
Geography and CS Philip Chan. How do I get there? Navigation Which web sites can give you turn-by-turn directions?
Artificial Intelligence in Game Design
© Peter Andreae CS4HS Algorithms Searching for an item in a list Sorting a list Searching for a word in text Analysing Networks.
Drive Right Chapter 7 Negotiating Intersections Unit 4
Representing and Using Graphs
Artificial Intelligence in Game Design
State-Space Searches. 2 State spaces A state space consists of A (possibly infinite) set of states The start state represents the initial problem Each.
Exploration Strategies for Learned Probabilities in Smart Terrain Dr. John R. Sullins Youngstown State University.
MODULE 5 Objectives: Students will learn to recognize moderate risk environments, establish vehicle speed, manage intersections, hills, and passing maneuvers.
Artificial Intelligence in Game Design Cooperative Movement.
Artificial Intelligence in Game Design N-Grams and Decision Tree Learning.
Adrian Treuille, Seth Cooper, Zoran Popović 2006 Walter Kerrebijn
Artificial Intelligence in Game Design Complex Steering Behaviors and Combining Behaviors.
Michael Walker. From Maps to Graphs  Make Intersections Vertices  Make Roads Edges  Result is Weighted Directed Graph  Weights: Speed Limit Length.
Informed Search I (Beginning of AIMA Chapter 4.1)
Informed Search Reading: Chapter 4.5 HW #1 out today, due Sept 26th.
1 CSE 4705 Artificial Intelligence Jinbo Bi Department of Computer Science & Engineering
Types of Algorithms. 2 Algorithm classification Algorithms that use a similar problem-solving approach can be grouped together We’ll talk about a classification.
REFERENCE: “ARTIFICIAL INTELLIGENCE FOR GAMES”, IAN MILLINGTON. A* (A-STAR)
Artificial Intelligence in Game Design Influence Maps and Decision Making.
Artificial Intelligence in Game Design Lecture 8: Complex Steering Behaviors and Combining Behaviors.
A* Reference: “Artificial Intelligence for Games”, Ian Millington.
CSCE 552 Spring 2010 AI (III) By Jijun Tang. A* Pathfinding Directed search algorithm used for finding an optimal path through the game world Used knowledge.
Artificial Intelligence in Game Design Lecture 20: Hill Climbing and N-Grams.
1 Chapter 7 Advanced Pathfinding Techniques improving performance & quality Reference: Game Development Essentials Game Artificial Intelligence.
Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 12: Slide 1 Chapter 12 Path Planning.
Artificial Intelligence in Game Design Board Games and the MinMax Algorithm.
Garmin 60CSx How To Use The Available Features Photos by IN-TF1 Technical Search, Stephen Bauer Written by IN-TF1 Technical Search, Jean Seibert.
Chapter 5.4 Artificial Intelligence: Pathfinding
Traveling Salesperson Problem
BackTracking CS255.
Navigation In Dynamic Environment
Reference: “Artificial Intelligence for Games”, Ian Millington.
Team 17c ****** Pathfinding
Artificial Intelligence
CPSC 322 Introduction to Artificial Intelligence
Efficiently Estimating Travel Time
Reading: Chapter 4.5 HW#2 out today, due Oct 5th
Presentation transcript:

Artificial Intelligence in Game Design Dynamic Path Planning Algorithms

Dynamic Path Planning Not always plausible for NPC to have complete map for path planning “Fog of war” –Player can only view part of map they have explored –Same should be true for NPC Paths may change dynamically –Paths between moving cars –Must reevaluate paths each frame

Map Exploration Key idea: NPC only has map of some waypoints NPC can still use heuristic to estimate distance from waypoints to goal in unexplored areas explored Goal in unexplored area Have heuristic estimate of distance to it from waypoint Waypoint in explored area Know shortest path to here

Map Exploration NPC should not know waypoints and edge costs until they have explored an adjacent waypoint –Gathering information has cost of moving to that location Key question: Which waypoint should NPC move to next? explored Goal in unexplored area Have heuristic estimate of distance to it from newly found points Waypoint in explored area Reaching here has cost

Best-first Search Follow edge to waypoint with shortest estimated path to goal Difference from A*: –Path cost from initial location to current location W here not factored in –That cost already incurred by reaching current location Go to waypoint W next with minimum of: edgecost(W here, W next ) + H(W next, W goal )

Best-first Search Example Chosen since < Chosen since <

Backtracking (LRTA*) Heuristic may greatly underestimate actual distance to goal –High-cost terrain –Impassible obstacle in path Best path may involve returning to some previous waypoint and taking another route Backtrack to waypoint W prev if: edgecost(W here, W next ) + H(W next, W goal ) > pathcost(W here, W prev ) + H(W prev, W goal ) W goal W next W prev

Backtracking Example Easy to reach, but on edge of cliff Estimated cost = 22 Close to goal, but requires crossing a river Estimated cost = 16 Best path involves backtracking to here Estimated cost = = 9

Heuristics and Dynamic Pathfinding Heuristic estimates too high  may not find best path –May be plausible behavior for world with hidden passages or paths –Player can use knowledge of shortcuts to outrun NPC! Chosen since < Shortcut has actual cost = 3

Heuristics and Dynamic Pathfinding Heuristic estimates too low  frequent backtracking –May be most plausible behavior for worlds with many obstacles –Can be amusing for player if done right! &*%!

Pathfinding in Dynamic Graphs Example: Racing games or other games involving traffic Problems: Waypoints are moving Edges between waypoints may only exist temporarily These waypoints are moving with car being passed This car may change lanes and cut off edge

Time-based Waypoints Waypoints have time as well as location property –Location of waypoint –Time at which the character reaches the waypoint –Only way to deal with moving waypoints Example: 2 different routes to same location W –Red route: reaches waypoint (W, 5) –Blue route: reaches waypoint (W, 7) Same location but different time component

Time-based Waypoints Problem: potentially infinite number of waypoints at same location with different time components –Car can change lanes multiple times at any point –Can go faster or slower, resulting in different arrival times –Green route reaches (W, 9) Need heuristics to constrain choices –Often “greedy”, covering ground as fast as possible

Simplifying Assumptions Racing heuristics: If changing lanes, do so as soon as possible Once in lane, move at maximum speed to next lane change Change lanes as soon as safe Get here as fast as possible

Goal Points Paths change rapidly –Other cars change lanes –Other cars change speeds Can’t plan far in advance Must put goals at small intervals –Every few hundred feet on track (possibly at inflection points) –Every block in city –Not necessarily point

Safe Distances Choose waypoints based on “safe distance” from other cars –Usually defined by some “radius” around cars Can base safe radius on “personality” –Cautious –Normal –Aggressive –Psychotic Can’t get closer than this Can’t cut in front of this car Can cut in front of this car

Dynamic Waypoints Add waypoints for immediate lane changes from current position –Must be no cars within safe radius Must take into account velocity of car –Can’t move directly sideways! –Must take into account speeds of cars in way Distance traveled in time to change lane Waypoint here blocked Distance blocking car travels

Dynamic Waypoints Add waypoints for positions immediately behind car in same lane –Based on speed difference between cars Waypoint for Seek behavior without slowing down –Used if immediately steer into another lane without slowing down Waypoint for Arrive behavior with matching velocity –Pulling up behind car without collision Current position of other car Where other car will be if Seek without slowing down Where other car will be if Arrive while slowing down

Dynamic Waypoints Add waypoints for positions where car can cut in front of cars in adjacent lanes –Based on speed difference between cars –Can’t be past car in current lane No waypoints past this car

Dynamic Waypoints Example combining all above waypoints –Each other car shown at position where it will be at waypoint formation Waypoints for immediate lane changes Waypoints for passing this car Waypoint for passing car in front Waypoint for pulling up behind car in front

Creating Dynamic Graph Next step: Continue on from these waypoints to next waypoints Continue until nearest goal reached Goal

Finding Best Path Use Dijkstra or A* to find shortest path Recompute each frame since things change When reach this goal, start again for next goal Goal