1 Game AI Steering Behavior & Group Movement ( 轉向行為 及 群體運動 )

Slides:



Advertisements
Similar presentations
7.2. AI E NGINE AND S TEERING B EHAVIOUR I Design of an AI Engine and introduction to steering in game AI.
Advertisements

7.3. S TEERING B EHAVIOUR II Steering behaviours in game AI.
Torque, Equilibrium, and Stability
今日課程內容 CH10 轉動 轉動牛頓第二運動定律 轉動動能 轉動慣量 Angular Quantities Here is the correspondence between linear and rotational quantities:
Chapter 11 Angular Momentum
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.
Behavioral animation CSE 3541 Matt Boggus. Material recap and trajectory Geometric – Artist specifies translation and rotation over time Physically based.
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
Florian Klein Flocking Cooperation with Limited Communication in Mobile Networks.
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.
Particle Swarm Optimization
1 Reactive Pedestrian Path Following from Examples Ronald A. Metoyer Jessica K. Hodgins Presented by Stephen Allen.
1 Terrain Following & Collision Detection. 2 Both of topics are very game-type-oriented Both of topics are very game-type-oriented Terrain Terrain For.
1Notes  Assignment 2 is out  Flocking references  Reynolds, “Flocks, Herds, and Schools…”, SIGGRAPH’87  Tu and Terzopoulos, “Artificial Fishes…”, SIGGRAPH’94.
Problem Solving For Conservation of Momentum problems: 1.BEFORE and AFTER 2.Do X and Y Separately.
Better Group Behaviors in Complex Environments using Global Roadmaps O. Burchan Bayazit, Jyh-Ming Lien and Nancy M. Amato Andreas Edlund.
Physics 2211: Lecture 38 Rolling Motion
CS274 Spring 01 Lecture 5 Copyright © Mark Meyer Lecture V Higher Level Motion Control CS274: Computer Animation and Simulation.
1cs426-winter-2008 Notes  Please read: C. Reynolds “Flocks, Herds, and Schools…” SIGGRAPH ‘87
Crowd Simulation Seminar ”Steering Behaviors For Autonomous Characters” By Craig W. Reynolds Rudi Bonfiglioli ( )
Steering Behaviors For Autonomous Characters
Collective Animal Behavior Ariana Strandburg-Peshkin.
Inverse Kinematics Jacobian Matrix Trajectory Planning
Games Programming III (TGP2281) – T1, 2010/2011 Movement AI John See 19, 26 Nov 2010.
Physics. Session Particle Dynamics - 5 Session Objective 1.Circular motion 2.Angular variables 3.Unit vector along radius and tangent 4.Radial and tangential.
Artificial Intelligence in Game Design Camera Control.
Lecture VII Rigid Body Dynamics CS274: Computer Animation and Simulation.
Yingcai Xiao Artificial Intelligence in Game Development Yingcai Xiao.
Constraints-based Motion Planning for an Automatic, Flexible Laser Scanning Robotized Platform Th. Borangiu, A. Dogar, A. Dumitrache University Politehnica.
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.
Steering Autonomous Characters Spring 2005 Ref: Craig Reynolds.
Artificial Intelligence for Games Lecture 1 1 Minor Games Programming.
Review IMGD Engine Architecture Types Broadly, what are the two architecture types discussed for game engines? What are the differences?
Math / Physics 101 GAM 376 Robin Burke Fall 2006.
今日課程內容 CH10 轉動 角位移、角速度、角加速度 等角加速度運動 力矩 轉動牛頓第二運動定律 轉動動能 轉動慣量.
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/
Computer Animation Rick Parent Computer Animation Algorithms and Techniques Behavioral Animation: Knowing the environment Flocking.
Basic Steering of Game Agents Featuring Guest professors Stephen Sheneman & Michael Wilkens 1.
1 Game System. 2 Control system Control system User input User input Mouse or keyboard Mouse or keyboard Keyboard layout Keyboard layout Camera control.
Chapter 7: Rotational Motion and the Law of Gravity Angular Speed & Acceleration  A unit of angular measure: radian y x P r  s = r  where s,r in m,
Chapter 13 Gravitation Newton’s Law of Gravitation Here m 1 and m 2 are the masses of the particles, r is the distance between them, and G is the.
REFERENCES: FLOCKING.
Steering Animation 數位內容學院 遊戲開發研究班第一期 3D 圖學 沈育德 Edward Shen May 19, 2005.
CS274 Spring 01 Lecture 7 Copyright © Mark Meyer Lecture VII Rigid Body Dynamics CS274: Computer Animation and Simulation.
今日課程內容 CH10 轉動 角位移、角速度、角加速度 等角加速度運動 轉動與移動關係 轉動動能 轉動慣量 力矩 轉動牛頓第二運動定律.
Artificial Intelligence in Game Design Lecture 8: Complex Steering Behaviors and Combining Behaviors.
Rick Parent - CIS682 Rigid Body Dynamics simulate basic physics of an object subject to forces Keyframing can be tedious - especially to get ‘realism’
CSCI 4310 Lecture 5: Steering Behaviors in Raven.
Circular Motion. Rotational Quantities A O r  dAdA A point on an object, located a distance r from a fixed axis of rotation, rotates in such a way that.
Demonstration of Simple Movement using Python AI for Gaming 2013, SCU.
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.
Students: Yossi Turgeman Avi Deri Self-Stabilizing and Efficient Robust Uncertainty Management Instructor: Prof Michel Segal.
行動 (Movement) 靜宜大學資工系 蔡奇偉 副教授.
Flocking Geometric objects Many objects
Sony Computer Entertainment
Steering Behaviors GAM 376 Robin Burke Fall 2006.
CIS 488/588 Bruce R. Maxim UM-Dearborn
Synthesis of Motion from Simple Animations
Chapter 11 Angular Momentum
FLOSCAN: An Artificial Life Based Data Mining Algorithm
Presentation transcript:

1 Game AI Steering Behavior & Group Movement ( 轉向行為 及 群體運動 )

References References –Craig W. Reynolds –1987 “Flocks, Herds, and Schools: A Distributed Behavioral Model”, Siggraph’87 Proceedings –1999 “Steering Behaviors for Autonomous Characters”, GDC Proceedings* – Autonomous Characters ( 自主角色 ) Autonomous Characters ( 自主角色 ) –Autonomous agents –NPCs in Games (Non-player characters, 非玩家角色 ) Applications Applications –Robotics –Artificial Intelligence (AI) ( 人工智能 ) –Artificial Life 2Introduction

Action selection ( 行動選擇 ) Action selection ( 行動選擇 ) Steering ( 轉向 ) Steering ( 轉向 ) Locomotion ( 運動, 移動 ) Locomotion ( 運動, 移動 ) 3 Motion Behavior ( 運動 行為 ) A hierarchy of motion behavior

Game AI engine Game AI engine –Finite state machine ( 有限狀態機 ) –Goals ( 目的 ) –Planning ( 規劃 ) –Strategy ( 策略 ) Scripting ( 腳本 ) Scripting ( 腳本 ) Assigned by players Assigned by players 4 Action Selection ( Action Selection ( 行動選擇 )

Path Determination Path Determination –Path finding or path planning Behaviors Behaviors –Seek & flee ( 尋找 及逃離 ) –Pursuit & evasion ( 追尋 及逃避 ) –Obstacle avoidance ( 障礙迴避 ) –Wander ( 徘徊 ) –Path following ( 路徑追蹤 ) –Unaligned collision avoidance ( 非排列碰撞迴避 ) Ref: Group Steering Group Steering 5 Steering ( Steering ( 轉向 )

Character Physically-based Models Character Physically-based Models Movement Movement –Turn Right, Move forward, … Animation Animation –Quaternion Implemented / Managed by Game Engine Implemented / Managed by Game Engine 6Locomotion

A Point Mass A Point Mass –Linear momentum –No rotational momentum Parameters Parameters –Mass –Position –Velocity »Modified by applied forces »Max speed Top speed of a vehicle Top speed of a vehicle –Max steering force »Self-applied –Orientation »Car »Aircraft 7 A Simple Vehicle Model (1/2)

Local Space Local Space –Origin –Forward –Up –Side Steering Forces Steering Forces –Asymmetrical »Thrust ( 推力 ) »Braking ( 制動 ) »Steering ( 轉向 ) Velocity Alignment Velocity Alignment –No slide ( 非滑動 ), spin ( 旋轉 ), … –Turn 8 A Simple Vehicle Model (2/2)

Steer_force = Truncate(Streer_direction, Max_force) Steer_force = Truncate(Streer_direction, Max_force) Acceleration = Steer_force / mass Acceleration = Steer_force / mass Velocity = Truncate(Old_velocity + Acceleration * Time_step, Max_speed) Velocity = Truncate(Old_velocity + Acceleration * Time_step, Max_speed) New_position = Old_position + Velocity * Time_step New_position = Old_position + Velocity * Time_step 9 Euler Integration

Pursuit to a Static Target Pursuit to a Static Target –Steer a character toward to a target position Seek Steering force Seek Steering force –desired_velocity = normalize(target - position)*max_speed –steering = desired_velocity – velocity “A moth buzzing a light bulb” “A moth buzzing a light bulb” Flee Flee –Inverse of Seek Variants Variants –Arrival –Pursuit to a moving target 10 Seek & Flee Behaviors

A Stopping Radius A Stopping Radius –Outside the radius, arrival is identical to seek –Inside the radius, the speed is ramped down to zero »target_offset = target – position »distance = length(target_offset) »ramped_speed = max_speed*(distance/slowing_distance) »clipped_speed = minimum(ramped_speed, max_speed) »desired_velocity = (clipped_speed/distance)*target_offset »steering = desired_velocity – Velocity 11 Arrival Behavior

Target Character is Moving Target Character is Moving Apply Seek or Flee to the Target’s Predict Position Apply Seek or Flee to the Target’s Predict Position Estimate the Prediction Interval T Estimate the Prediction Interval T –T = Dc –D = distance(Pursuer, Quarry) –c = turning parameter Variants Variants –Offset pursuit »“Fly by” 12 Pursuit & Evasion Behaviors

Use Bounding Sphere Use Bounding Sphere Collision avoidance Collision avoidance Probe Probe –A cylinder lying along forward axis –Diameter = character’s bounding sphere –Length = speed (means Alert range) Find the most Threaten Obstacle Find the most Threaten Obstacle –Nearest intersected obstacle Steering Steering 13 Obstacle Avoidance Behavior

Random Steering Random Steering One Solution : One Solution : –Retain steering direction state »Constrain steering force to the sphere surface located slightly ahead of the character –Make small random displacements to it each frame »A small sphere on sphere surface to indicate and constrain the displacement Another one : Another one : –Perlin noise Variants Variants –Explore –Forage 14 Wander Behavior

A Path A Path –Spine »A spline or poly-line to define the path –Pipe »The tube or generated cylinder by a defined “radius” Following Following –A velocity-based prediction position »Inside the tube Do nothing about steering Do nothing about steering »Outside the tube “Seek” to the on-path projection “Seek” to the on-path projection 15 Path Following Behavior Variants Variants –Wall following –Containment

A Flow Field Environment is Defined A Flow Field Environment is Defined Virtual Reality Virtual Reality –Not common in games 16 Flow Field Following Behavior

Turn Away from Possible Collision Turn Away from Possible Collision Predict the Potential Collision Predict the Potential Collision –Use bounding spheres If possibly collide, If possibly collide, –Apply the steering on both characters –Steering direction is possible collision result »Use “future” possible position »The connected line between two sphere centers 17 Unaligned Collision Avoidance Behavior

Steering Behaviors Determining How the Character Reacts to the Other Characters within His Local Neighborhood Steering Behaviors Determining How the Character Reacts to the Other Characters within His Local Neighborhood The Behaviors include The Behaviors include –Separation –Cohesion –Alignment 18 Steering Behaviors for Groups of Characters

The Local Neighborhood is Defined The Local Neighborhood is Defined –A distance –The field-of-view »Angle 19 The Local Neighborhood of a Character The Neighborhood

Make a Character to Maintain a Distance from Others Nearby Make a Character to Maintain a Distance from Others Nearby –Compute the repulsive forces within local neighborhood »Calculate the position vector for each nearby »Normalize it »Weight the magnitude with distance 1/distance 1/distance »Sum the result forces »Negate it 20 Separation Behavior

Make a Character to Cohere with the others Nearby Make a Character to Cohere with the others Nearby –Compute the cohesive forces within local neighborhood »Compute the average position of the other nearbys Gravity center Gravity center »Apply “Seek” to the position 21 Cohesion Behavior

Make a Character to Align with the Others Nearby Make a Character to Align with the Others Nearby –Compute the steering force »Average the velocity of all other characters nearby »The result is the desired velocity »Correct the current velocity to the desired one with the steering force 22 Alignment Behavior

Boids Model of Flocks Boids Model of Flocks –[Reynolds 87] Combination of Combination of –Separation steering –Cohesion steering –Alignment steering For Each Combination For Each Combination –A weight for combing –A distance –An Angle 23 Flocking Behavior

Follow a Leader Follow a Leader –Stay with the leader »“Pursuit” behavior (Arrival style) –Stay out of the leader’s way »Defined as “next position” with an extension »“Evasion” behavior when inside the above area –“Separation” behavior for the followers 24 Leader Following behavior

A Simple Vehicle Model with Local Neighborhood A Simple Vehicle Model with Local Neighborhood Common Steering Behaviors Common Steering Behaviors –Seek –Flee –Pursuit –Evasion –Offset pursuit –Arrival –Obstacle avoidance –Wander –Path following 25 Behavior Conclusion –Wall following –Containment –Flow field following –Unaligned collision avoidance –Separation –Cohesion () –Cohesion ( 凝聚 ) –Alignment ( ) –Alignment ( 隊列 ) –Flocking () –Flocking ( 集群活動 ) –Leader following Combining Behaviors Combining Behaviors