CSCI 4310 Lecture 5: Steering Behaviors in Raven.

Slides:



Advertisements
Similar presentations
Reactive and Potential Field Planners
Advertisements

7.2. AI E NGINE AND S TEERING B EHAVIOUR I Design of an AI Engine and introduction to steering in game AI.
7.3. S TEERING B EHAVIOUR II Steering behaviours in game AI.
Physics of Motion Lecturer: Mauro Ferreira
Halliday/Resnick/Walker Fundamentals of Physics 8th edition
Flocking and more.  NPC groups can move in cohesive groups not just independently ◦ Meadow of sheep grazing? ◦ Hunting flock of birds? ◦ Ants? Bees?
Lecture 4: Command and Behavior Fusion Gal A. Kaminka Introduction to Robots and Multi-Robot Systems Agents in Physical and Virtual Environments.
Steering Behaviors GAM 376 Robin Burke Winter 2008.
CSE 380 – Computer Game Programming Pathfinding AI
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.
Math / Physics 101 GAM 376 Robin Burke Winter 2008.
Computational Geometry & Collision detection
5/18/20151 Team Sport AI CIS 479/579 Bruce R. Maxim UM-Dearborn.
John S Gero Agents – Agent Simulations AGENT-BASED SIMULATIONS.
Centripetal Force and Centrifugal Force
Chapter 4.1 Mathematical Concepts
6/11/20151 Autonomous Game Agents CIS 479/579 Bruce R. Maxim UM-Dearborn.
Analysis vs. Design When you take a test in your math or physics course, there is one and only one answer! When you do a goal-driven design there may be:
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.
CS274 Spring 01 Lecture 5 Copyright © Mark Meyer Lecture V Higher Level Motion Control CS274: Computer Animation and Simulation.
Crowd Simulation Seminar ”Steering Behaviors For Autonomous Characters” By Craig W. Reynolds Rudi Bonfiglioli ( )
Steering Behaviors For Autonomous Characters
Intelligent Pac-Man Ghost AI
DAMN : A Distributed Architecture for Mobile Navigation Julio K. Rosenblatt Presented By: Chris Miles.
Games Programming III (TGP2281) – T1, 2010/2011 Movement AI John See 19, 26 Nov 2010.
Physics 111: Mechanics Lecture 6
Geometric Intuition Randy Gaul. Vectors, Points and Basis Matrices Rotation Matrices Dot product and how it’s useful Cross product and how it’s useful.
1 Constant Following Distance Simulations CS547 Final Project December 6, 1999 Jeremy Elson.
Raven Robin Burke GAM 376. Soccer standings Burke, 7 Ingebristen, 6 Buer, 6 Bukk, 6 Krishnaswamy, 4 Lobes, 3 Borys, 2 Rojas, 2 Bieneman, 2.
Physics 111: Mechanics Lecture 6 Wenda Cao NJIT Physics Department.
CS 450: COMPUTER GRAPHICS QUATERNIONS SPRING 2015 DR. MICHAEL J. REALE.
Autonomous Movement IMGD 4000 With material from: Millington and Funge, Artificial Intelligence for Games, Morgan Kaufmann 2009 (Chapter 3), Buckland,
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.
Announcements Homework returned now 9/19 Switching to more lecture-style class starting today Good luck on me getting powerpoint lectures ready every day.
Steering Autonomous Characters Spring 2005 Ref: Craig Reynolds.
Vectors and Direction In drawing a vector as an arrow you must choose a scale. If you walk five meters east, your displacement can be represented by a.
Artificial Intelligence for Games Lecture 1 1 Minor Games Programming.
Math / Physics 101 GAM 376 Robin Burke Fall 2006.
CO1301: Games Concepts Dr Nick Mitchell (Room CM 226) Material originally prepared by Gareth Bellaby.
Ch. 2: Describing Motion: Kinematics in One Dimension.
2.7 Avoiding Dynamic Obstacles and Hazards Don DeLorenzo.
1 Game AI Steering Behavior & Group Movement ( 轉向行為 及 群體運動 )
Artificial Intelligence in Game Design Complex Steering Behaviors and Combining Behaviors.
Chasing, Evading, Intercepting, Pattern Movements
CGDD 4003 THE MATH LECTURE (BOILED DOWN, YET LIGHTLY SALTED)
Basic Steering of Game Agents Featuring Guest professors Stephen Sheneman & Michael Wilkens 1.
Artificial intelligence IN NPCs. Early Role Playing games Npcs in early role playing games were very limited in terms of being “Intelligent”. For instance,
CSCI 4310 Lecture 8: Path Planning. Book Buckland Ch. 8.
REFERENCES: FLOCKING.
Steering Animation 數位內容學院 遊戲開發研究班第一期 3D 圖學 沈育德 Edward Shen May 19, 2005.
Artificial Intelligence in Game Design Lecture 8: Complex Steering Behaviors and Combining Behaviors.
1 CO Games Development 1 Week 4 Finite State Machines + Maths Gareth Bellaby.
Lecture Outline Chapter 3 Physics, 4 th Edition James S. Walker Copyright © 2010 Pearson Education, Inc.
Vectors for Calculus-Based Physics AP Physics C. A Vector …  … is a quantity that has a magnitude (size) AND a direction.  …can be in one-dimension,
Fundamentals of Computer Animation Controlling Groups of Objects (2)
Flocking Geometric objects Many objects
Advanced & Group Steering
Vector Addition using Trigonometry
Vector Addition Describe how to add vectors graphically.
Sony Computer Entertainment
Steering Behaviors GAM 376 Robin Burke Fall 2006.
2.1: An introduction to vectors
8.1. Steering Behaviour III
CIS 488/588 Bruce R. Maxim UM-Dearborn
Steering behaviours in game AI
Physics 11a.
Kinematics Vectors and Motion
CO Games Concepts Week 12 Collision Detection
Presentation transcript:

CSCI 4310 Lecture 5: Steering Behaviors in Raven

Book Buckland Chapter 3, 7 Generating Automated Agent Behavior

High Level Some ‘meta’ intelligence decides it is time to flee Ex: Rule: if badguy.size > me.size How do we implement fleeing?

Background Vectors v(6,2) Magnitude = √(6² + 2²) = |v| = 6.32 Also called norm Vector v(6,2)

Background Normalize Vectors x N = x / |v| x N = 6 / 6.32 y N = y / |v| y N = 2 / 6.32 New Magnitude = 1 Direction unchanged

Background cos(Θ) = ay / |v| Θ = arccos (ay / |v|) ay = |v| cos (Θ) sin(Θ) = ax / |v| Θ = arcsin (ax / |v|) ax = |v| sin (Θ) Component Vectors x y Θ v a

Background Dot product of 2 vectors u, v u · v = |u||v| cos (Θ) normalize u, v u · v = cos (Θ) Θ = arccos (u · v) Dot product x y Θ v a Dot product of 2 vectors u, v u · v = u x v x + u y v y Angle between vectors

Raven Vector2D struct has methods for Normalizing, Dot product, and adding, multiplying, etc. vectors

Steering: Seek Direct our player toward a target position Return a force (Vector) to a target position Airplane navigation

Steering: Seek current target Steering force (seek) Desired = targetPos – vehiclePos Assume vehicle at (0,0) Desired = (5,6) Current + = Desired desired

Steering: Seek Vector2D SteeringBehaviors:: Seek(Vector2D TargetPos) Vehicles contain a reference to a SteeringBehaviors SteeringBehaviors::Seek returns a Vector2D Returned Vector2D represents the steering force Seek demo

Steering: Flee Run away from a given position Return a force (Vector) to a target position Opposite of seek Modified in book p. 92 to flee only when a target is within a certain range

Steering: Flee current target Steering force (flee) Desired = vehiclePos – targetPos Assume vehicle at (0,0) Desired = (-5,-6) Current + = Desired desired

Steering: Flee Vector2D SteeringBehaviors:: Flee(Vector2D TargetPos) Returned Vector2D represents the steering force Flee demo

Steering: Arrive Vector2D SteeringBehaviors:: Arrive(Vector2D TargetPos, Deceleration decel) Arrive allows you to seek and come to a slower arrival (based on deceleration parameter) Deceleration is an enumeration, slow=3, normal=2, fast=1

Steering: Arrive Just adjust speed multiplier (magnitude) of DesiredVelocity vector to slow down Base on distance to target Arrive demo

Steering: Pursuit Intercepting a moving target Don’t just aim for the target position Aim for where you *think* the target will be Look-ahead directly proportional to distance to evader and inversely proportional to speed Another modification of seek

Steering: Pursuit Vector2D SteeringBehaviors:: Pursuit(const Vehcile* evader) Seek (evader->Pos() + evader->Velocity * LookAheadTime) LookAheadTime = ToEvader.Length() / me->MaxSpeed() + evader->Speed()

Steering: Pursuit current evader Steering force (flee) Current + = Desired desired current Pursuit Demo

Steering: Evade Vector2D SteeringBehaviors:: Evade(const Vehcile* pursuer) Opposite of pursuit: Evader flees from the estimated future position.

Steering: Evade Flee (persuer->Pos() + persuer->Velocity * LookAheadTime) LookAheadTime = ToPersuer.Length() / me->MaxSpeed() + persuer->Speed()

Steering: Wander Steering force for a ‘random walk’ Just moving randomly is unconvincing and erratic No one out on a walk stops and reverses course frequently Perlin noise – Ken Perlin (Tron) Remember our earlier statement: Randomness can make us look smarter!

Steering: Wander One solution: Project a circle in front of the agent Steer towards a target that is constrained to move along the perimeter of this circle Target adjusts in small increments along the perimeter Adjust algo based on circle radius, target adjustments, circle distance

Steering: Wander wander radius wander distance Wander Demo

Steering: Obstacle Avoidance Need concept of a bounding box (or detection box) Rather than detecting a collision on a complex boundary Can get incrementally more detailed in collision detection

Steering: Obstacle Avoidance Collision detection is a detailed endeavor Only recently distinguished hits by location in FPS

Steering: Obstacle Avoidance Detection box length proportionate to speed obs Dot product of agent (purple) vector and vector to obstacle will be positive if obs is in front – this obstacle can be ignored.

Steering: Obstacle Avoidance obs Extend obstacle boundary by ½ width of detection box. If new boundary crosses agent vector, collision occurs at intersection of new boundary and detection box.

Steering: Obstacle Avoidance obs

Steering: Obstacle Avoidance Vector2D SteeringBehaviors::ObstacleAvoidance(const std::vector &obstacles) Once an obstacle that will cause a collision is detected, need a steering force to avoid. Just like driving: slow down and avoid

Steering: Obstacle Avoidance Lateral force in proportion to obstacle’s position with respect to the agent Braking force in proportion to distance to obstacle (force acting along opposite vector of agent) Code omitted Obstacle Avoidance Demo

Steering: Hide Position yourself such that an obstacle is always between you and an agent Constant (c) for distance from obstacle c ‘Arrive’ to this position

Steering: Hide Vector2D SteeringBehaviors::Hide(const Vehicle* target, vector & obstacles) For Each Obstacle Calculate A hiding position for this obs Calculate Distance to hiding position Is Hiding Position Available? Yes – Call ‘Arrive’ to Closest No – Evade Hide Demo

Steering: Path Following Useful for creating bot behaviors such as patrolling Used for multi-stage navigation Very commonly used in most games Some other function determines a goal location – more difficult Calls FollowPath to get there

Steering: Path Following Vector2D SteeringBehaviors::followPath( ) Just ‘seek’ each waypoint in turn Can ‘arrive’ at final destination Path object in GameWorld class Path class omitted Path Following Demo

Steering: Group Behavior Agents can react to other agents Multi-agent aware From our earlier discussion of environment and agent attributes Mimic nature Simple creatures performing complex activities - ACO Neighborhood – pervasive concept. What is the sphere of influence? This idea present in many AI concepts

Steering: Flocking Combination of Separation Alignment Cohesion Flocking Demo