Steering Autonomous Characters Spring 2005 Ref: Craig Reynolds.

Slides:



Advertisements
Similar presentations
Reactive and Potential Field Planners
Advertisements

Lecture 7: Potential Fields and Model Predictive Control
7.2. AI E NGINE AND S TEERING B EHAVIOUR I Design of an AI Engine and introduction to steering in game AI.
Chapter 4.2 Collision Detection and Resolution. 2 Collision Detection Complicated for two reasons 1. Geometry is typically very complex, potentially requiring.
Flocking and more.  NPC groups can move in cohesive groups not just independently ◦ Meadow of sheep grazing? ◦ Hunting flock of birds? ◦ Ants? Bees?
LOCOMOTION IN INTERACTIVE ENVIRONMENTS Navjot Garg.
Rotational Motion Chapter Opener. Caption: You too can experience rapid rotation—if your stomach can take the high angular velocity and centripetal acceleration.
Steering Behaviors GAM 376 Robin Burke Winter 2008.
Robotics applications of vision-based action selection Master Project Matteo de Giacomi.
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
Kristen Gardner. Outline Swarm Intelligence Flocking Basic Steering Swarms Applications Animals Vehicles People.
University of Texas at Austin CS 378 – Game Technology Don Fussell CS 378: Computer Game Technology Dynamic Path Planning, Flocking Spring 2012.
Flocking References: xxx.
Introduction to VISSIM
Verbs and Adverbs: Multidimensional Motion Interpolation Using Radial Basis Functions Presented by Sean Jellish Charles Rose Michael F. Cohen Bobby Bodenheimer.
DARPA Mobile Autonomous Robot SoftwareMay Adaptive Intelligent Mobile Robotics William D. Smart, Presenter Leslie Pack Kaelbling, PI Artificial.
Artificial Intelligence in Game Design Intelligent Decision Making and Decision Trees.
5/18/20151 Team Sport AI CIS 479/579 Bruce R. Maxim UM-Dearborn.
Artificial Intelligence in Game Design Introduction to Learning.
1 Reactive Pedestrian Path Following from Examples Ronald A. Metoyer Jessica K. Hodgins Presented by Stephen Allen.
1Notes  Assignment 2 is out  Flocking references  Reynolds, “Flocks, Herds, and Schools…”, SIGGRAPH’87  Tu and Terzopoulos, “Artificial Fishes…”, SIGGRAPH’94.
Chapter 4.2 Collision Detection and Resolution. 2 Collision Detection Complicated for two reasons 1. Geometry is typically very complex, potentially requiring.
RED DEAD REVOLVER Artificial Intelligence Critique By Mitchell C. Dodes CIS 588.
Interactive Animation of Structured Deformable Objects Mathieu Desbrun Peter Schroder Alan Barr.
Better Group Behaviors in Complex Environments using Global Roadmaps O. Burchan Bayazit, Jyh-Ming Lien and Nancy M. Amato Andreas Edlund.
1 Geometry A line in 3D space is represented by  S is a point on the line, and V is the direction along which the line runs  Any point P on the line.
Chapter 10 Rotational Motion
CS274 Spring 01 Lecture 5 Copyright © Mark Meyer Lecture V Higher Level Motion Control CS274: Computer Animation and Simulation.
Introduction What is this ? What is this ? This project is a part of a scientific research in machine learning, whose objective is to develop a system,
Crowd Simulation Seminar ”Steering Behaviors For Autonomous Characters” By Craig W. Reynolds Rudi Bonfiglioli ( )
Steering Behaviors For Autonomous Characters
Games Programming III (TGP2281) – T1, 2010/2011 Movement AI John See 19, 26 Nov 2010.
June 12, 2001 Jeong-Su Han An Autonomous Vehicle for People with Motor Disabilities by G. Bourhis, O.Horn, O.Habert and A. Pruski Paper Review.
Lecture VII Rigid Body Dynamics CS274: Computer Animation and Simulation.
1 Constant Following Distance Simulations CS547 Final Project December 6, 1999 Jeremy Elson.
Chapter 11 Motion.
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.
Artificial Intelligence for Games Lecture 1 1 Minor Games Programming.
CS329e – Elements of Visual Programming Implementing Programs Mike Scott (Slides 2-2)
Mobile Robot Navigation Using Fuzzy logic Controller
Artificial Intelligence in Game Design Cooperative Movement.
1 Game AI Steering Behavior & Group Movement ( 轉向行為 及 群體運動 )
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.
Chapter 7 Rotational Motion and The Law of Gravity.
Joseph Xu Soar Workshop Learning Modal Continuous Models.
Kinematics.  Distance – the total measured path that an object travels. (scalar)  Displacement – the measured straight line distance from when the object.
REFERENCES: FLOCKING.
School of Systems, Engineering, University of Reading rkala.99k.org April, 2013 Motion Planning for Multiple Autonomous Vehicles Rahul Kala Multi-Level.
Steering Animation 數位內容學院 遊戲開發研究班第一期 3D 圖學 沈育德 Edward Shen May 19, 2005.
Crowd Self-Organization, Streaming and Short Path Smoothing 學號: 姓名:邱欣怡 日期: 2007/1/2 Stylianou Soteris & Chrysanthou Yiorgos.
CS274 Spring 01 Lecture 7 Copyright © Mark Meyer Lecture VII Rigid Body Dynamics CS274: Computer Animation and Simulation.
Artificial Intelligence in Game Design Lecture 8: Complex Steering Behaviors and Combining Behaviors.
CSCI 4310 Lecture 5: Steering Behaviors in Raven.
Path Planning Based on Ant Colony Algorithm and Distributed Local Navigation for Multi-Robot Systems International Conference on Mechatronics and Automation.
Rotational Motion – Part I AP Physics C. The radian  There are 2 types of pure unmixed motion:  Translational - linear motion  Rotational - motion.
Chapter 7 Rotational Motion and The Law of Gravity.
Fundamentals of Computer Animation Controlling Groups of Objects (2)
11/13/03CS679 - Fall Copyright Univ. of Wisconsin Last Time A* Improvements Hierarchical planning Pre-Planning.
Review IMGD Engine Architecture Types Broadly, what are the two architecture types discussed for game engines? What are the differences?
Jan throws a ball into the air and catches it on its way down
Real-time Wall Outline Extraction for Redirected Walking
CIS 488/588 Bruce R. Maxim UM-Dearborn
Steering Behaviors GAM 376 Robin Burke Fall 2006.
CIS 488/588 Bruce R. Maxim UM-Dearborn
Steering behaviours in game AI
Synthesis of Motion from Simple Animations
Presentation transcript:

Steering Autonomous Characters Spring 2005 Ref: Craig Reynolds

2 Introduction-1 Autonomous characters: also known as NPC (non-player character) in games Steering: the ability to navigate around their world in a life-like and improvisational manner.

3 Introduction-2 Motion-behavior hierarchy [herding example]

4 Herding Example some cowboys tending a herd of cattle out on the range. A cow wanders away from the herd. The trail boss tells a cowboy to fetch the stray. The cowboy says “giddy-up” to his horse and guides it to the cow, possibly avoiding obstacles along the way. Action selection: the trail boss, noticing that the state of the world has changed (a cow left the herd) and setting a goal (retrieve the stray). The steering level: the cowboy, who decomposes the goal into a series of simple subgoals (approach the cow, avoid obstacles, retrieve the cow). A subgoal corresponds to a steering behavior for the cowboy-and-horse team. Using various control signals (vocal commands, spurs, reins) the cowboy steers his horse towards the target. In general terms, these signals express concepts like: go faster, go slower, turn right, turn left, and so on. The horse implements the locomotion level. Taking the cowboy’s control signals as input, the horse moves in the indicated direction. This motion is the result of a complex interaction of the horse visual perception, its sense of balance, and its muscles applying torques to the joints of its skeleton.

5 Introduction-3 Path-finding is a topic related to, but separate from, the subject of this paper. Path-finding algorithms such as A* and Dijkstra's operate on networks (often representing grids) and essentially solve mazes. Such a solution could serve as a specification to the steering techniques described in this paper. Steering behaviors discussed here relate to “fast” motion: running versus crawling. As a result, the steering behaviors must anticipate the future, and take into account eventual consequences of current actions. The approach taken in this paper is to consider steering behaviors as essentially independent from the underlying locomotion scheme.

6 Vehicle: Idealized locomotion model based on a point mass approximation. The physics is based on forward Euler integration. the control signal passed from the steering behaviors to the locomotion behavior consists of exactly one vector quantity: a desired steering force. Because of its assumption of velocity alignment, this simple vehicle model cannot simulate effects such as skids, spins or slides.

7 Supplemental To get  t between displays: int glutGet (GLUT_ELAPSED_TIME) : msec

8 Vehicle: 3D vs. 2D Airplane vs. ground vehicle Velocity aligned frame: 3 axes: forward, up, and side. Use rotation-minimizing frame (next page) to update the character local frame forward(v) side up

9 Rotation Minimizing Frame (ref)ref Use second derivative to define the first frame (if zero, set N 0 to any vector  T 0 ) Compute all subsequent T i ; find a rotation from T i-1 to T i ; rotate N i and B i accordingly If no rotation, use the same frame

10 Building Blocks of Steering Seek/Flee Pursuit/Evasion Arrival Obstacle avoidance Wander Path following Containment Flow field following Unaligned collision avoidance Group: separation, cohesion, alignment Combined behavior application; implementation Offset pursuit

11 Seek/Flee & Arrival The length of “desired velocity” could be max_speed, or it could be the character’s current speed, depending on the particular application. Arrival: velocity ramp down (linearly) to zero while approaching target Application: stop for traffic light Does not produce a steering force; rather, it sets up a flag for velocity modification

12 Pursuit/Evasion Chasing moving target: use a simple predictor and reevaluate it each simulation step. linear predictor: assuming that the target will not turn during the prediction interval, T The position of a character after T units of time can be obtained by scaling its velocity by T and adding that offset to its current position.

13 Pursuit (cont) T could be a constant, which while naive, would produce better pursuit than simple seek (T=0). For better performance, T should be larger when the pursuer is far from the target, and small when they are nearby. T=Dc where D is the distance between pursuer and quarry, and c is a tuning parameter.

14 Offset Pursuit … refers to steering a path which passes near, but not directly into a moving target. Examples would be a spacecraft doing a fly-by or an aircraft doing a “strafing run”: flying near enough to be within sensor or weapon range without colliding with the target. Set target point, use seek steering

15 Collision Avoidance The goal of the behavior is to keep an imaginary cylinder of free space in front of the character Diameter: the character’s bounding sphere Length: based on the character’s speed Exhaustive search or spatial partitioning to help identify the candidate obstacles Generally only care about obstacles which are between us and our goal. Corrective steering: consider the most threatening obstacle, take its projection on side-up plane B is most threatening

16 Collision Avoidance (cont) 3D projection (on side-up plane) to predict future collision

17 Wander: random steering Rather than truly random, retain steering direction state and make small random displacements to it each frame Another way to implement wander would be to use coherent Perlin noise [Perlin 85] to generate the steering direction

18 Wander (Illustrated-1) Generate a wander in green circle New steering direction

19 Wander (Illustrated-2) Steering direction updated

20 Path Following a path will be idealized as a spine and a radius. The spine might be represented as a spline curve or a poly-line velocity-based prediction The predicted future position is projected onto the nearest point on the path spine. If the character is veering away from the path, or is too far away from the path, apply corrective steer. To steer back towards the path, the seek behavior is used to steer towards the on-path projection of the predicted future position. Wall following: path following + offset pursuit Examples of containment: fish swimming in an aquarium; hockey players skating within an ice rink.

21 Flow Field Following useful tool for directing the motion of characters based on their position within an environment. Flow field designed by a level designer (game production) or a scene planner or layout artist (animation production).

22 Unaligned Collision Avoidance Consider your own experience of walking across a plaza or lobby full of other walking people: avoiding collisions involves predicting potential collisions and altering your direction and speed to prevent them If all nearby characters are aligned, use separation.

23 Unaligned Collision Avoidance Our character considers each of the other characters and determines (based on current velocities) when and where the two will make their nearest approach. A potential for collision exists if the nearest approach is in the future, and if the distance between the characters at nearest approach is small enough. The nearest of these potential collisions, if any, is determined. Steering strategy: turning, change speed

24 Group Steering (cont) How character reacts to other characters in its neighborhood Stampede scene in Lion King Nbhd definition

25 Corrective Steering-1 Compute difference vector between character and each one in the neighborhood; then apply 1/r weighting. Apply seek towards “average position” of neighbors

26 Corrective Steering-2 Desired velocity determined by average of neighbors unit vector or not depends on applications Combining Behaviors For better control it is helpful to first normalize the three steering components, and then to scale them by three weighting factors before summing them. Tuning parameters: Weights, nbhd def (distance, angle)

27 Compound Steering The implementation of leader following relies on arrival behavior. The arrival target is a point offset slightly behind the leader. (The offset distance might optionally increases with speed.) If a follower finds itself in a rectangular region in front of the leader, it will steer laterally away from the leader’s path before resuming arrival behavior. In addition the followers use separation behavior to prevent crowding each other.

28 Other Applications Interpose steering behavior attempts to put its character between two other moving characters, for example a soccer player trying to block a pass between two members of the opposing team. Hide behavior involves identifying a target location which is on the opposite side of an obstacle from the opponent, and steering toward it using seek. building blocks for more complex patterns of behavior. like notes of a melody or words of a story.

29 Combining Behavior Two modes: switching or blending Example 1: imagine caribou grazing in a meadow when suddenly they sense wolves approaching. This event triggers a discrete behavioral switch. take place at the action selection level Example 2: As the caribou flee through the forest, they blend evasion and obstacle avoidance together to allow them to escape from the wolves while dodging trees. occurs at the middle steering level of the behavioral hierarchy.

30 Blending Concerns and Strategy Minimize computation cost by considering character momentum; avoid canceling steering output Prioritize steering (e.g., collision avoidance > evasion > …) Simple linear combination might do just fine