Kristen Gardner. Outline Swarm Intelligence Flocking Basic Steering Swarms Applications Animals Vehicles People.

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

AI Pathfinding Representing the Search Space
7.3. S TEERING B EHAVIOUR II Steering behaviours in game AI.
Beyond the Centralized Mindset
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
Evolving Flocking Simulation and Robotics Dan Sayers iotic.com.
Flocks, Herds and Schools Modeling and Analytic Approaches.
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.
OBJECT-ORIENTED THINKING CHAPTER Topics  The Object-Oriented Metaphor  Object-Oriented Flocks of Birds –Boids by Craig W. Reynolds  Modularity.
Optimizing Flocking Controllers using Gradient Descent
Florian Klein Flocking Cooperation with Limited Communication in Mobile Networks.
Behavioral Animation Procedural Animation Type?. Behavioral Animation Introduced by C. Reynolds (1987) Animating many things at one time –A group of the.
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.
Flocking References: xxx.
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.
John S Gero Agents – Agent Simulations AGENT-BASED SIMULATIONS.
Multi Agent Simulation and its optimization over parallel architecture using CUDA™ Abdur Rahman and Bilal Khan NEDUET(Department Of Computer and Information.
Everyday Driving Skills
San Diego 7/11/01 VIRTUAL SHELLS FOR AVOIDING COLLISIONS Yale University A. S. Morse.
Better Group Behaviors in Complex Environments using Global Roadmaps O. Burchan Bayazit, Jyh-Ming Lien and Nancy M. Amato Andreas Edlund.
Continuum Crowds Adrien Treuille, Siggraph 王上文.
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
Games Programming III (TGP2281) – T1, 2010/2011 Movement AI John See 19, 26 Nov 2010.
Crowd Simulations Guest Instructor - Stephen J. Guy.
Motion Chapter 11.
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.
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved Event Driven Programming, The.
Computer Graphics 2 In the name of God. Outline Introduction Animation The most important senior groups Animation techniques Summary Walking, running,…examples.
Artificial Intelligence for Games Lecture 1 1 Minor Games Programming.
EXIT = Way Out Julian Dymacek April 29. Escape Panic Paper Dr. Dirk Helbing, Illes J. Farkas, Dr. Tamas Vicsek Point mass simulation Uses psychological.
Artificial Intelligence in Game Design Cooperative Movement.
Adrian Treuille, Seth Cooper, Zoran Popović 2006 Walter Kerrebijn
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.
Controlling the Behavior of Swarm Systems Zachary Kurtz CMSC 601, 5/4/
Games Development 2 Entity Update & Rendering CO3301 Week 2, Part 1.
Basic Steering of Game Agents Featuring Guest professors Stephen Sheneman & Michael Wilkens 1.
Behavior Control of Virtual Vehicle
Study of Individual and Group responses of Mexican Free Tailed Bats Presented by Aruna Raghavan.
Particle Swarm Optimization † Spencer Vogel † This presentation contains cheesy graphics and animations and they will be awesome.
REFERENCES: FLOCKING.
Artificial Intelligence in Game Design Lecture 8: Complex Steering Behaviors and Combining Behaviors.
Simulating Crowds Simulating Dynamical Features of Escape Panic & Self-Organization Phenomena in Pedestrian Crowds Papers by Helbing.
CSCI 4310 Lecture 5: Steering Behaviors in Raven.
Forces and Newton’s Laws Video Warm Up. What is a force? A force is a push or pull that causes an object to move, stop, or change direction. In physics,
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.
4/22/20031/28. 4/22/20031/28 Presentation Outline  Multiple Agents – An Introduction  How to build an ant robot  Self-Organization of Multiple Agents.
Computer Animation Algorithms and Techniques
Crowd Modelling & Simulation
A theory on autonomous driving algorithms
Sony Computer Entertainment
Steering Behaviors GAM 376 Robin Burke Fall 2006.
CIS 487/587 Bruce R. Maxim UM-Dearborn
CIS 488/588 Bruce R. Maxim UM-Dearborn
Steering behaviours in game AI
FLOSCAN: An Artificial Life Based Data Mining Algorithm
Hiroki Sayama NECSI Summer School 2008 Week 2: Complex Systems Modeling and Networks Agent-Based Models Hiroki Sayama
Presentation transcript:

Kristen Gardner

Outline Swarm Intelligence Flocking Basic Steering Swarms Applications Animals Vehicles People

Swarm Intelligence What is it? Artificial intelligence that is based on collective behavior of decentralized, self organized systems Examples? Flocks of birds, schools of fish (Boids) Ant colony Bees

What is Flocking? An example of emergent behavior which resembles the motion of a flock of birds, school of fish, or swarm of insects First simulated on a computer in 1986 by Craig Reynolds’ program Boids Considered emergent because unexpected behavior may occur when flocks split up and reunite to avoid obstacles

How Does Flocking Work? The behavior of each Boid is individual, but conforms to a few, relatively simple, rules Separation Alignment Cohesion Other, more complex rules may also be added Obstacle avoidance Goal seeking

Basic Rules separation: steer to avoid crowding local flock mates alignment: steer towards the average heading of local flock mates cohesion: steer to move toward the average position of local flock mates

Field of View To keep things “realistic,” respond only to the actions of neighboring Boids Example Fancy Example

Algorithmic Complexity Basic un-optimized implementation is O(n 2 ) Each Boid must calculate its distance from each other Boid Basic optimized implementation is O(kn) Area the flock inhabits is divided into a grid with each Boid in a “bin” Each Boid only needs to check its position relative to Boids in its (or neighboring) bins

Using Steering Model mass (scalar) position (vector) velocity (vector) max_force (scalar) max_speed (scalar) orientation (N basis vectors) Euler Integration for animation steering_force = truncate (steering_direction, max_force) acceleration = steering_force / mass velocity = truncate (velocity + acceleration, max_speed) position = position + velocity

Steering Behaviors Seek and Flee Pursue and Evade Wander Arrival Wall Following Path Following Flow Field Following

Seek and Flee Go toward or away from a static target Seek: desired_velocity = normalize (position - target) * max_speed steering = desired_velocity – velocity Flee: Inverse of seek

Pursuit and Evasion Similar to Seek and Flee, but estimates the quarry’s position in the future Based on the distance to the quarry, estimate the number of time steps (the predictor interval T) until the Boid could reach the quarry Base T on the distance between objects: T=Dc Based on the quarry’s current velocity, position, and the calculated predictor interval, estimate the target Use seek or flee algorithm to determine steering

Wander Multiple ways Random steering force at each frame Easy to implement May cause “twitching” behavior Retain steering direction, but make small displacement Constrain steering to a sphere (or circle in 2D) in front of the Boid Size of sphere determines how quickly heading can change

Arrival Similar to seek, but slows when approaching target 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

Path Following Boid steers to follow a predetermined path Velocity-based prediction of future position Future position projected to nearest point on path If distance from path is more than path radius, steer toward path

Variation of Path Finding Wall Following Approach a wall and maintain a certain distance from it Generate a new goal position and steer toward it Containment Use future position to determine if Boid will remain inside area If not steer back toward the center of area

Flow Field Following Steer to align with flow vectors steering = flow_direction-velocity

Obstacle Avoidance Multiple approaches can be used Force Field model Steer-to-avoid

Types of Collisions Obstacles Stationary Incoming Outgoing Sideswiping Response Circumvention Queuing

Force Fields The equation: k i is a scaling constant d i is the distance from the agent to the obstacle e i controls the magnitude of acceleration based on distance k i and e i should be negative for avoidance, positive values can be used for attraction Advantages: Easy to model Disadvantages: Field is exactly opposite, so no turning away from straight on Too weak far away, so long term planning may be required

Steer-to-Avoid Algorithm: Calculates silhouette for each obstacle Tests collision with current heading If there will be a collision, the Boid will aim for a point one body length beyond the silhouette Advantages: Only affected by obstacles directly in front of it

Combined Behaviors Crowd Path Following path following and separation Leader Following Leader: wandering, seek random position Followers: arrival, separation, follow path set by leader Unaligned Collision Avoidance Containment, predictive obstacle avoidance Queuing Seek, avoid, separation,

And the result is… So, little circles running around are great, but really, what can flocking do? The Lion King

Simple Swarms An alternative to flocking Due to complexity, flocking calculations may be prohibitive in real-time applications Does not attempt to avoid collisions between swarm members Use with large number of small creatures Spiders, rats, etc.

Swarms Introducing the swarm Drop from the ceiling, “explode” from a container Each agent has a separate timer, set to a random value, so the agents enter the scene gradually Algorithm Small changes in movement and direction should keep the agents separate “Outer zone” Increment agent’s speed if it is less than the maximum (should vary from agent to agent) If the agent’s heading is not roughly in the right direction (within some tolerance), rotate back to the correct heading “Inner zone” Behavior varies, depending on the overall desired movement of the group

Modified swarm Can add simple collision tests, simple path following, and some other behaviors while still maintaining O(n) complexity Also can be modified for agents who fly or walk on walls

Applications Why do we care about any of this? Animals: flocks, schools, herds People: crowds Vehicles: traffic When to flock, when to swarm? Flocking Small to medium number of creatures Use when behavior of creatures is major focus of game play Pikmin Swarms Large groups (tens or hundreds of agents)

Animals Ambient Enhance the environment Give more life-like feel Not relevant to game play Secondary Limited amount of interaction with the player Part of game play, but not the focus Should behave intelligently, but also limited so as not to distract from goals Primary Are focus of the game and have direct relation to primary objectives

Understand Behavior - Groups Flocks Stay together Don’t crowd each other Follow the leader Switch leaders occasionally Individuals break away sometimes, but don’t go too far Schools Very similar, but tend to change directions more often High cohesion and alignment, low separation

Understand Behavior – Solitary Does not mean antisocial, just not governed by the behavior of others Examples – chipmunks, eagles, etc. Stay in a limited area Efforts mainly directed toward feeding May or may not be comfortable with human presence Maintain “safe” distance, but only depart if pursued Low alignment and low to moderate cohesion

Ambient animals Bugs - Example behavior for butterflies Don’t fly in straight line Don’t always flap their wings Don’t flap wings in full beat Attracted to flowers and bright colors Avoid moving objects Stay in limited area Easily governed by simple rules

Primary and Secondary Tend to follow a schedule throughout the day Frequent a fixed number of places Have more than one active sensing mechanism, some more keen than others Senses are affected by factors in the environment Avoid human contact, but may be dangerous when cornered Typically predictable, but should also demonstrate unexpected behavior occasionally Require more complex individual behavior than ambient animals

Traffic Must obey traffic rules Stop signs and signals, speed limits, drive on correct side of street Can be implemented with messages when the vehicle approaches specific objects Set precedence A stop sign or pedestrian is more important than maintaining a certain speed Intersections – ticket system In order to go through, must be in possession of ticket After passing through, vehicle relinquishes control of the ticket

People “Milling” Low max speed, planning for collision avoidance, small changes in heading, follow social/safety conventions (stay on sidewalk) Pedestrians on sidewalk, small groups standing around Organized behavior Pay more attention to other agents Queuing, military formations, “doing the wave,” waiting at cross-walks, etc. Traumatic behavior High maximum speed, large changes in heading, ignore conventions (running into traffic) Run away from the crazy person with a big gun

Rome: Total War Strategy game – both turn-based and real time Game engine Has the ability to render 30,000 units on a single battle field Used by Decisive Battles (History Channel) to recreate historical battles Battle of Cannae Rome: Total War

Summary Flocking Emergent behavior that imitates a flock, school, or herd Computationally expensive for large groups Swarms Use when flocking too expensive (hundreds of agents) Organic motion, but flock mates may collide Applications Video games, movies/TV, simulations Animals, vehicles, people Understand what you want to model before you model it

Questions or Comments?