CS 378: Computer Game Technology

Similar documents
CS 354 R Game Technology

Particle Systems. Typical Time Step. Particle Generation. Controlling Groups of Objects: Particle Systems. Flocks and Schools

Traffic/Flocking/Crowd AI. Gregory Miranda

Under the Guidance of

Graphs, Search, Pathfinding (behavior involving where to go) Steering, Flocking, Formations (behavior involving how to go)

Simulation: Particle Systems

CS 354R: Computer Game Technology

Robotic Behaviors. Potential Field Methods

Lecture 18.1 Multi-Robot Path Planning (3)

Chapter 19- Object Physics

Path Planning. Marcello Restelli. Dipartimento di Elettronica e Informazione Politecnico di Milano tel:

Robotic Motion Planning: Review C-Space and Start Potential Functions

Computer Graphics. Si Lu. Fall uter_graphics.htm 11/27/2017

ENHANCING THE CONTROL AND PERFORMANCE OF PARTICLE SYSTEMS THROUGH THE USE OF LOCAL ENVIRONMENTS. Abstract

Announcements. Ray tracer is due in five days you should have started by now or you re going to have a bad week. Missing file posted on the web page

Autonomous Mobile Robots, Chapter 6 Planning and Navigation Where am I going? How do I get there? Localization. Cognition. Real World Environment

LECTURE 16: SWARM INTELLIGENCE 2 / PARTICLE SWARM OPTIMIZATION 2

CS 354R: Computer Game Technology

Crowd simulation. Taku Komura

Chapter 14 Particle Systems & Interactions

The 3D rendering pipeline (our version for this class)

Visibility Graph. How does a Mobile Robot get from A to B?

A simple example. Assume we want to find the change in the rotation angles to get the end effector to G. Effect of changing s

Computer Animation. Animation A broad Brush. Keyframing. Keyframing

Topics in Computer Animation

Robotics Tasks. CS 188: Artificial Intelligence Spring Manipulator Robots. Mobile Robots. Degrees of Freedom. Sensors and Effectors

GPU-based Distributed Behavior Models with CUDA

PARTICLE SWARM OPTIMIZATION (PSO)

Planning and Control: Markov Decision Processes

Dynamical Simulation 1: Particle Systems and ODEs

Announcements. CS 188: Artificial Intelligence Fall Robot motion planning! Today. Robotics Tasks. Mobile Robots

CS 188: Artificial Intelligence Fall Announcements

CS4621/5621 Fall Particle Systems and Compute Shaders

Formations in flow fields

CS 231. Crowd Simulation. Outline. Introduction to Crowd Simulation. Flocking Social Forces 2D Cellular Automaton Continuum Crowds

Sketch-based Interface for Crowd Animation

Realtime Water Simulation on GPU. Nuttapong Chentanez NVIDIA Research

Senior Project Write Up

Particle Systems. Lecture 8 Taku Komura

Local Search Methods. CS 188: Artificial Intelligence Fall Announcements. Hill Climbing. Hill Climbing Diagram. Today

CS248. Game Mechanics

Collision Avoidance with Unity3d

12 - More Steering. from Milligan, "Artificial Intelligence for Games", Morgan Kaufman, 2006

6.141: Robotics systems and science Lecture 9: Configuration Space and Motion Planning

Sung-Eui Yoon ( 윤성의 )

Principles of Computer Game Design and Implementation. Revision Lecture

Spring 2010: Lecture 9. Ashutosh Saxena. Ashutosh Saxena

Shape of Things to Come: Next-Gen Physics Deep Dive


CMU-Q Lecture 4: Path Planning. Teacher: Gianni A. Di Caro

Mobile Robot Path Planning in Static Environments using Particle Swarm Optimization

6.141: Robotics systems and science Lecture 10: Implementing Motion Planning

Algorithms. Algorithms GEOMETRIC APPLICATIONS OF BSTS. 1d range search line segment intersection kd trees interval search trees rectangle intersection

Algorithms. Algorithms GEOMETRIC APPLICATIONS OF BSTS. 1d range search line segment intersection kd trees interval search trees rectangle intersection

Atmospheric Reentry Geometry Shader

Algorithms. Algorithms GEOMETRIC APPLICATIONS OF BSTS. 1d range search line segment intersection kd trees interval search trees rectangle intersection

Complex behavior emergent from simpler ones

Non-Homogeneous Swarms vs. MDP s A Comparison of Path Finding Under Uncertainty

Safe Prediction-Based Local Path Planning using Obstacle Probability Sections

BCC Particle System Generator

Spring Localization II. Roland Siegwart, Margarita Chli, Juan Nieto, Nick Lawrance. ASL Autonomous Systems Lab. Autonomous Mobile Robots

STEERING BEHAVIORS. Markéta Popelová, marketa.popelova [zavináč] matfyz.cz. 2012, Umělé Bytosti, MFF UK

Game AI: The set of algorithms, representations, tools, and tricks that support the creation and management of real-time digital experiences

Replicating Chaos Vehicle Replication in Watch Dogs 2. Matt Delbosc Team Lead Programmer Ubisoft Toronto

CUDA Particles. Simon Green

CS 331: Artificial Intelligence Local Search 1. Tough real-world problems

Path Planning for Point Robots. NUS CS 5247 David Hsu

Configuration Space of a Robot

1/16. Emergence in Artificial Life. Sebastian Marius Kirsch Back Close

Navigation and Metric Path Planning

Fluid Simulation. [Thürey 10] [Pfaff 10] [Chentanez 11]

Particle Systems A Technique for Modeling a Class of Fuzzy Objects

BCC 3D Extruded Image Shatter Filter

Animation. Computer Graphics COMP 770 (236) Spring Instructor: Brandon Lloyd 4/23/07 1

Autonomous and Mobile Robotics Prof. Giuseppe Oriolo. Motion Planning 1 Retraction and Cell Decomposition

3D Starfields for Unity

When using Flocking with network rendering (LWSN, for instance) you must bake your Flocking results.

Master s Thesis. Animal Stampede Simulation

CS 387/680: GAME AI MOVEMENT

Efficient Crowd Simulation for Mobile Games

NVIDIA. Interacting with Particle Simulation in Maya using CUDA & Maximus. Wil Braithwaite NVIDIA Applied Engineering Digital Film

Lecture 3: Motion Planning 2

Rendering diffuse objects using particle systems inside voxelized surface geometry. Thorsten Juckel Steffi Beckhaus

History. Early viewers

Optimization and least squares. Prof. Noah Snavely CS1114

Adding Virtual Characters to the Virtual Worlds. Yiorgos Chrysanthou Department of Computer Science University of Cyprus

Who has worked on a voxel engine before? Who wants to? My goal is to give the talk I wish I would have had before I started on our procedural engine.

9 Dynamics. Getting Started with Maya 491

Advanced Algorithms. Particle Systems. Reading. What is a Particle System?

NCCA National Center for Computer Animation Master Project ZHUO YAO LU. MSC Computer Animation. Media School. Bournemouth University NCCA 2005

FLUENT Secondary flow in a teacup Author: John M. Cimbala, Penn State University Latest revision: 26 January 2016

T6: Position-Based Simulation Methods in Computer Graphics. Jan Bender Miles Macklin Matthias Müller

Where are we? Setup Sprites. Input. Collision Drawing Sprites. Initializing, loading, movement Parameters (color, alpha, scale, etc.

Second Semester Examinations 2012/13

Realistic Animation of Fluids

To Do. History of Computer Animation. These Lectures. 2D and 3D Animation. Computer Animation. Foundations of Computer Graphics (Spring 2010)

STEERING BEHAVIORS MOTIVATION REQUIREMENTS FOR MOTION CONTROL MOTIVATION BOIDS & FLOCKING MODEL STEERING BEHAVIORS - BASICS

Swarm of Bees. See a preview animation of the effect to get an idea about what we are creating here:

Spring Localization II. Roland Siegwart, Margarita Chli, Martin Rufli. ASL Autonomous Systems Lab. Autonomous Mobile Robots

Cognitive Robotics Robot Motion Planning Matteo Matteucci

Transcription:

CS 378: Computer Game Technology Dynamic Path Planning, Flocking Spring 2012 University of Texas at Austin CS 378 Game Technology Don Fussell

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

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

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

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

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

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?

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

Following Examples No momentum - choose to go to neighbor with lowest field strength Momentum - but with linear obstacle field strength and moved goal

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

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

Bloopers Field too weak Field too strong

Local Minima Example

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?

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,

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 flockmates! 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

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

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

Flocking Demo http://www.red3d.com/cwr/boids/

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

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

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

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

Smoke Trails Time Extinguished New

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

Particles Demo