11/13/03CS679 - Fall 2003 - Copyright Univ. of Wisconsin Last Time A* Improvements Hierarchical planning Pre-Planning.

Slides:



Advertisements
Similar presentations
Reactive and Potential Field Planners
Advertisements

Lecture 7: Potential Fields and Model Predictive Control
AI Pathfinding Representing the Search Space
Least squares CS1114
Flocking and more.  NPC groups can move in cohesive groups not just independently ◦ Meadow of sheep grazing? ◦ Hunting flock of birds? ◦ Ants? Bees?
Steering Behaviors GAM 376 Robin Burke Winter 2008.
CSE 380 – Computer Game Programming Pathfinding AI
Better Group Behaviors in Complex Environments using Global Roadmaps O. Burchan Bayazit, Jyh-Ming Lien and Nancy M. Amato Presented by Mohammad Irfan Rafiq.
Flocks, Herds, and Schools: A Distributed Behavioral Model By: Craig Reynolds Presented by: Stephanie Grosvenor.
1 CO Games Development 2 Week 22 Flocking Gareth Bellaby.
Optimizing Flocking Controllers using Gradient Descent
Crowd simulation Taku Komura. Animating Crowds We have been going through methods to simulate individual characters We have been going through methods.
University of Texas at Austin CS 378 – Game Technology Don Fussell CS 378: Computer Game Technology Dynamic Path Planning, Flocking Spring 2012.
Week 14 - Monday.  What did we talk about last time?  Bounding volume/bounding volume intersections.
Artificial Intelligence in Game Design Introduction to Learning.
Planning under Uncertainty
1Notes  Assignment 2 is out  Flocking references  Reynolds, “Flocks, Herds, and Schools…”, SIGGRAPH’87  Tu and Terzopoulos, “Artificial Fishes…”, SIGGRAPH’94.
1Notes  Textbook: matchmove 6.7.2, B.9. 2 Match Move  For combining CG effects with real footage, need to match synthetic camera to real camera: “matchmove”
John S Gero Agents – Agent Simulations AGENT-BASED SIMULATIONS.
Particle Systems 1 Adapted from: E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012.
Particle Systems and Fuzzy Shapes Presented by Dan Cogswell.
Motion Analysis (contd.) Slides are from RPI Registration Class.
Crowds Andrew Kaufman Michael Welsman-Dinelle. What is a crowd? A group of agents performing actions. Agents can affect each other. Agent actions may.
Expectation Maximization Algorithm
Continuum Crowds Adrien Treuille, Siggraph 王上文.
1cs426-winter-2008 Notes  Please read: C. Reynolds “Flocks, Herds, and Schools…” SIGGRAPH ‘87
Chapter 5: Path Planning Hadi Moradi. Motivation Need to choose a path for the end effector that avoids collisions and singularities Collisions are easy.
Steering Behaviors For Autonomous Characters
DAMN : A Distributed Architecture for Mobile Navigation Julio K. Rosenblatt Presented By: Chris Miles.
Population Ecology Population: A group of organisms that belong to the same species that live in the same place at the same time.
09/18/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Bump Mapping Multi-pass algorithms.
05/09/02(c) 2002 University of Wisconsin Last Time Global illumination algorithms Grades so far.
Introduction to Monte Carlo Methods D.J.C. Mackay.
Lecture VII Rigid Body Dynamics CS274: Computer Animation and Simulation.
1 Constant Following Distance Simulations CS547 Final Project December 6, 1999 Jeremy Elson.
11/19/02 (c) 2002, University of Wisconsin, CS 559 Last Time Many, many modeling techniques –Polygon meshes –Parametric instancing –Hierarchical modeling.
World space = physical space, contains robots and obstacles Configuration = set of independent parameters that characterizes the position of every point.
09/09/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Event management Lag Group assignment has happened, like it or not.
Flow Fields Hao Li and Howard Hamilton. Motivation for Flow Fields Multiple AI algorithms in a computer game can produce conflicting results. The AI must.
Computer Graphics 2 In the name of God. Outline Introduction Animation The most important senior groups Animation techniques Summary Walking, running,…examples.
Math / Physics 101 GAM 376 Robin Burke Fall 2006.
1 IE 607 Heuristic Optimization Particle Swarm Optimization.
Motion Planning in Games Mark Overmars Utrecht University.
CSC505 Particle Systems. CSC505 Object Representations So far we have represented (rendered) objects with –Lines –Polygons (triangles) –Curves These techniques.
Detail-Preserving Fluid Control N. Th ű rey R. Keiser M. Pauly U. R ű de SCA 2006.
Adrian Treuille, Seth Cooper, Zoran Popović 2006 Walter Kerrebijn
CLASS 10 SCENE GRAPHS BASIC ANIMATION CS770/870. A scene Graph A data structure to hold components of a scene Usually a Tree of a Directed Acyclic Graph.
Artificial Intelligence in Game Design Complex Steering Behaviors and Combining Behaviors.
Controlling the Behavior of Swarm Systems Zachary Kurtz CMSC 601, 5/4/
Point Sprites Course Information CVG: Programming 4 My Name: Mark Walsh Website: Recommended.
Particle Swarm Optimization † Spencer Vogel † This presentation contains cheesy graphics and animations and they will be awesome.
CS274 Spring 01 Lecture 7 Copyright © Mark Meyer Lecture VII Rigid Body Dynamics CS274: Computer Animation and Simulation.
Autonomous Robots Robot Path Planning (3) © Manfred Huber 2008.
Artificial Intelligence in Game Design Lecture 8: Complex Steering Behaviors and Combining Behaviors.
Particle Swarm Optimization (PSO)
Simulating Crowds Simulating Dynamical Features of Escape Panic & Self-Organization Phenomena in Pedestrian Crowds Papers by Helbing.
Path Planning Based on Ant Colony Algorithm and Distributed Local Navigation for Multi-Robot Systems International Conference on Mechatronics and Automation.
Artificial Intelligence in Game Design Lecture 20: Hill Climbing and N-Grams.
Animation Animation is about bringing things to life Technically: –Generate a sequence of images that, when played one after the other, make things move.
Introduction to Parametric Curve and Surface Modeling.
Computer Animation Algorithms and Techniques
Review: Tree search Initialize the frontier using the starting state
CS b659: Intelligent Robotics
CS679 - Fall Copyright Univ. of Wisconsin
© University of Wisconsin, CS559 Spring 2004
CIS 488/588 Bruce R. Maxim UM-Dearborn
(c) 2002 University of Wisconsin
Computer Animation Algorithms and Techniques
Computer Graphics Lecture 15.
Introduction to Parametric Curve and Surface Modeling
Presentation transcript:

11/13/03CS679 - Fall Copyright Univ. of Wisconsin Last Time A* Improvements Hierarchical planning Pre-Planning

11/13/03CS679 - Fall Copyright Univ. of Wisconsin Today Dynamic Path Planning –Avoiding the problem –Re-planning –Potential Field Planning Flocking Models General Particle Systems

11/13/03CS679 - Fall Copyright Univ. of Wisconsin Dynamic Path Planning What happens when the environment changes after the plan has been made? –The player does something –Other agents get in the way (in this case, you know that the environment will change at the time you make the plan) The solution strategies are highly dependent on the nature of the game, the environment, the types of AI, and so on Three approaches: –Try to avoid the problem –Re-plan when something goes wrong –Reactive planning

11/13/03CS679 - Fall Copyright Univ. of Wisconsin Avoiding Plan Changes Partial planning: Only plan short segments of path at a time –Stop A* after a path of some length is found, even if the goal is not reached - use best estimated path found so far Extreme case: Use greedy search and only plan one step at a time Common case: Hierarchical planning and only plan low level when needed –Underlying idea is that a short path is less likely to change than a long path –But, optimality will be sacrificed –Another advantage is more even frame times Other strategies: –Wait for the blockage to pass - if you have reason to believe it will –Lock the path to other agents - but implies priorities

11/13/03CS679 - Fall Copyright Univ. of Wisconsin Re-Planning If you discover the plan has gone wrong, create a new one The new plan assumes that the dynamic changes are permanent Usually used in conjunction with one of the avoidance strategies –Re-planning is expensive, so try to avoid having to do it –No point in generating a plan that will be re-done - suggests partial planning in conjunction with re-planning

11/13/03CS679 - Fall Copyright Univ. of Wisconsin Reactive Planning A reactive agent plans only its next step, and only uses immediately available information Best example for path planning is potential field planning –Set up a force field around obstacles (and other agents) –Set up a gradient field toward the goal –The agent follows the gradient downhill to the goal, while the force field pushes it away from obstacles –Can also model velocity and momentum - field applies a force Potential field planning is reactive because the agent just looks at the local gradient at any instant Has been used in real robots for navigating things like hallways

11/13/03CS679 - Fall Copyright Univ. of Wisconsin Potential Field Red is start point, blue is goal This used a quadratic field strength around the obstacles Note that the boundaries of the world also contribute to the field

11/13/03CS679 - Fall Copyright Univ. of Wisconsin Creating the Field The constant gradient can be a simple linear gradient based on distance from the goal, d goal : f goal =k d goal The obstacles contribute a field strength based on the distance from their boundary, f i (d i ) –Linear, quadratic, exponential, something else –Normally truncate so that field at some distance is zero. Why? –Strength determines how likely the agent is to avoid it Add all the sub-fields together to get overall field –Do you recall what modeling technique this resembles?

11/13/03CS679 - Fall Copyright Univ. of Wisconsin Following the Field At each step, the agent needs to know which direction is “downhill” Compute the gradient of the field –Compute the gradients of each component and add –Need partial derivatives in x and y (for 2D planning) Best approach is to consider the gradient as an acceleration –Automatically avoids sharp turns and provides smooth motion –Higher mass can make large objects turn more slowly –Easy to make frame-rate independent –But, high velocities can cause collisions because field is not strong enough to turn the object in time –One solution is to limit velocity - want to do this anyway because the field is only a guide, not a true force

11/13/03CS679 - Fall Copyright Univ. of Wisconsin Following Examples No momentum - choose to go to neighbor with lowest field strength Momentum - but with linear obstacle field strength and moved goal

11/13/03CS679 - Fall Copyright Univ. of Wisconsin Discrete Approximation Compute the field on a grid –Allows pre-computation of fields that do not change, such as fixed obstacles –Moving obstacles handled as before Use discrete gradients –Look at neighboring cells –Go to neighboring cell with lowest field value Advantages: Faster Disadvantages: Space cost, approximate Left example on previous slide is a (very fine) discrete case

11/13/03CS679 - Fall Copyright Univ. of Wisconsin Potential Field Problems There are many parameters to tune –Strength of the field around each obstacle –Function for field strength around obstacle –Steepness of force toward the goal –Maximum velocity and mass Goals conflict –High field strength avoids collisions, but produces big forces and hence unnatural motion –Higher mass smoothes paths, but increases likelihood of collisions Local minima cause huge problems

11/13/03CS679 - Fall Copyright Univ. of Wisconsin Bloopers Field too weakField too strong

11/13/03CS679 - Fall Copyright Univ. of Wisconsin Local Minima Example

11/13/03CS679 - Fall Copyright Univ. of Wisconsin The Local Minima Problem Recall, path planning can be viewed as optimization Potential field planning is gradient descent optimization The biggest problem with gradient descent is that it gets stuck in local minima Potential field planning suffers from exactly the same problem Must have a way to work around this –Go back if a minima is found, and try another path With what sorts of environments will potential fields work best? What form of waypoint-based search is it similar to?

11/13/03CS679 - Fall Copyright Univ. of Wisconsin Flocking Models (Reynolds 87) Potential fields are most often used in avoiding collisions between the members of a group –Each member pushes on its neighbors to keep them from colliding Additional rules for groups can be defined - the result is a flocking model, or herding, or schooling, … Each rule contributes a desired direction, which are combined in some way to come up with the acceleration The aim is to obtain emergent behavior: –Define simple rules on individuals that interact to give interesting global behavior –For example, rules for individual birds make them form a flock, but we never explicitly specify a leader, or the exact shape, or the speed, …

11/13/03CS679 - Fall Copyright Univ. of Wisconsin Flocking Rules Separation: Try to avoid running into local flock-mates –Works just like potential fields –Normally, use a perception volume to limit visible flock-mates Alignment: Try to fly in same direction as local flock-mates –Gets everyone flying in the same direction Cohesion: Try to move toward the average position of local flock-mates –Spaces everyone out evenly, and keep boundary members toward the group Avoidance: Try to avoid obstacles –Just like potential fields

11/13/03CS679 - Fall Copyright Univ. of Wisconsin Rules Illustrated Separation: Fly away away from neighbors that are “too close” Alignment: steer toward average velocity Cohesion: steer toward average position Avoidance: steer away from obstacles

11/13/03CS679 - Fall Copyright Univ. of Wisconsin Combining Commands Consider commands as accelerations Give a weight to each desire –High for avoidance, low for cohesion Option 1: Apply in order of highest weight, until a max acceleration is reached –Ensures that high priority things happen Option 2: Take weighted sum and truncate acceleration –Makes sure some part of everything happens

11/13/03CS679 - Fall Copyright Univ. of Wisconsin Flocking Demo

11/13/03CS679 - Fall Copyright Univ. of Wisconsin Flocking Evaluation Advantages: –Complex behavior from simple rules –Many types of behavior can be expressed with different rules and parameters Disadvantages: –Can be difficult to set parameters to achieve desired result –All the problems of potential fields regarding strength of forces

11/13/03CS679 - Fall Copyright Univ. of Wisconsin General Particle Systems Flocking is a special case of a particle system Objects are considered point masses from the point of view of simulating their motion (maybe with orientation) Simple rules are applied to control how the particles move Particles can be rendered in a variety of ways to simulate many different things: –Fireworks –Waterfalls, spray, foam –Explosions (smoke, flame, chunks of debris) –Clouds –Crowds, herds Widely used in movies as well as games –The ocean spray in Titanic and Perfect Storm, for instance

11/13/03CS679 - Fall Copyright Univ. of Wisconsin Particle System Step 1.Inject any new particles into the system and assign them their individual attributes There may be one or more sources Particles might be generated at random (clouds), in a constant stream (waterfall), or according to a script (fireworks) 2.Remove any particles that have exceeded their lifetime May have a fixed lifetime, or die on some condition 3.Move all the current particles according to their script Script typically refers to the neighboring particles and the environment 4.Render all the current particles Many options for rendering

11/13/03CS679 - Fall Copyright Univ. of Wisconsin Example: Smoke Trails Particles are spawned at a constant rate They have zero initial velocity, or maybe a small velocity away from the rocket Rules: –Particles could rise or fall slowly (drift with the wind) –Attach a parameter, density, that grows quickly then falls over time Extinguish when density becomes very small Render with an billboard facing the viewer, scaled according to the density of the puff

11/13/03CS679 - Fall Copyright Univ. of Wisconsin Smoke Trails NewExtinguished Time

11/13/03CS679 - Fall Copyright Univ. of Wisconsin Example: Explosions System starts when the target is hit Target is broken into pieces and a particle assigned for each piece Each particle gets an initial velocity away from the center of the explosion Particle rules are: –Move ballistically unless there is a collision –Could take into account rigid body rotation, or just do random rotation –Collisions are resolved by reflecting the velocity about the contact normal Rendering just draws the appropriate piece of target at the particles location

11/13/03CS679 - Fall Copyright Univ. of Wisconsin Particles Demo

11/13/03CS679 - Fall Copyright Univ. of Wisconsin Todo By Monday, Nov 24, Stage 4 demo By Monday, Dec 1, Final goals By Wednesday, Dec 10, Final Demo