1 CO3301 - Games Development 2 Week 22 Flocking Gareth Bellaby.

Slides:



Advertisements
Similar presentations
Beyond the Centralized Mindset
Advertisements

Chapter 12: Momentum 12.1 Momentum
Torque, Equilibrium, and Stability
Flocking and more.  NPC groups can move in cohesive groups not just independently ◦ Meadow of sheep grazing? ◦ Hunting flock of birds? ◦ Ants? Bees?
Reading Quiz The voltage (or electric potential) of a battery determines how much work the battery can do on an electric charge. how much net electric.
Ch 3.8: Mechanical & Electrical Vibrations
Evolving Flocking Simulation and Robotics Dan Sayers iotic.com.
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.
OBJECT-ORIENTED THINKING CHAPTER Topics  The Object-Oriented Metaphor  Object-Oriented Flocks of Birds –Boids by Craig W. Reynolds  Modularity.
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.
Kristen Gardner. Outline Swarm Intelligence Flocking Basic Steering Swarms Applications Animals Vehicles People.
Flocking References: xxx.
1 Reactive Pedestrian Path Following from Examples Ronald A. Metoyer Jessica K. Hodgins Presented by Stephen Allen.
Social Force Model for Pedestrian Dynamics 1998 Sai-Keung Wong.
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.
Better Group Behaviors in Complex Environments using Global Roadmaps O. Burchan Bayazit, Jyh-Ming Lien and Nancy M. Amato Andreas Edlund.
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
Steering Behaviors For Autonomous Characters
Games Programming III (TGP2281) – T1, 2010/2011 Movement AI John See 19, 26 Nov 2010.
Relative Velocity Two observers moving relative to each other generally do not agree on the outcome of an experiment However, the observations seen by.
Electric Field You have learned that two charges will exert a force on each other even though they are not actually touching each other. This force is.
1 CO Games Development 1 Week 5 Deriving a "look at" function + Graph Theory Gareth Bellaby.
 The gravitational force between two masses, m1 & m2 is proportional to the product of the masses and inversely proportional to the square of the distance.
In Engineering --- Designing a Pneumatic Pump Introduction System characterization Model development –Models 1, 2, 3, 4, 5 & 6 Model analysis –Time domain.
Universal Gravitation
Biology: flocking, herding & schooling Day 5 COLQ 201 Multiagent modeling Harry Howard Tulane University.
Ch. 8 Momentum and its conservation
Robot Crowd Navigation using Predictive Position Fields in the Potential Function Framework Ninad Pradhan, Timothy Burg, and Stan Birchfield Electrical.
Van Allen Radiation Belts The Van Allen radiation belts consist of charged particles surrounding the Earth in doughnut-shaped regions. The particles are.
Circular Motion & Gravity
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.
Gravity Sir Isaac Newton is credited with the discovery of gravity. Now, of course we know that he didn’t really discover the thing – let’s face it, people.
Exploring Complex Systems through Games and Computer Models Santa Fe Institute – Project GUTS
Chapter 1 Introduction to Game AI April 11,
CO1301: Games Concepts Dr Nick Mitchell (Room CM 226) Material originally prepared by Gareth Bellaby.
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.
Dynamic Self-Organization & Computation by Natural and Artificial Potential Fields John H Reif Duke University Download:
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.
Controlling Individual Agents in High-Density Crowd Simulation
Particles Paul Taylor Polygons are not so hot! Good for representing objects like A Cup A Robot A Pyramid Not so hot for creating Hair Snowflakes.
1 Tycho Brahe ( ) best observer of his day Made most accurate measurements of his time.
REFERENCES: FLOCKING.
UNC Chapel Hill M. C. Lin Basics of Motion Generation let X i = position,orient. of O i at t k = t 0,  i END = false while (not END) do display O i, 
Chapter 9 – Additional Scenarios. Marbles Collision Detection The Marbles scenario does not use any of the built-in Greenfoot collision detection.
Particles and their home in Geometry Shaders Paul Taylor 2010.
Artificial Intelligence in Game Design Lecture 8: Complex Steering Behaviors and Combining Behaviors.
CSCI 4310 Lecture 5: Steering Behaviors in Raven.
L7-s1,9 Physics 114 – Lecture 7 Chapter 4 Dynamics: Newton’s Laws of Motion We now investigate why bodies undergo motion. Why do bodies accelerate? They.
Animation Animation is about bringing things to life Technically: –Generate a sequence of images that, when played one after the other, make things move.
1 CO Games Development 2 Week 13 Influence Maps Gareth Bellaby.
Students: Yossi Turgeman Avi Deri Self-Stabilizing and Efficient Robust Uncertainty Management Instructor: Prof Michel Segal.
Computer Animation Algorithms and Techniques
Crowd Modelling & Simulation
Electric Force Unit 7.3.
A theory on autonomous driving algorithms
Swarm simulation using anti-Newtonian forces
CO Games Development 2 Week 19 Extensions to Finite State Machines
Basics of Motion Generation
Chapter 4 The Laws of Motion.
CIS 488/588 Bruce R. Maxim UM-Dearborn
FLOSCAN: An Artificial Life Based Data Mining Algorithm
Electric Force Unit 11.2.
Presentation transcript:

1 CO Games Development 2 Week 22 Flocking Gareth Bellaby

2 Introduction Flocking is a way of generating realistic movement for animals in a group: a flock. For example a flock of birds. Can be applied to non-human animals such as birds and fish. Can be extended and applied to aircraft, units and squads. Flocking was developed by Craig Reynolds.

3 Application to Games Flocking is of interest to games for two main reasons: Realistic flocks of birds or other animals which can be placed within a game world and just left to their own devices, e.g. a flock of birds that fly around, perch and react to the characters presence but without the need for scripting. Application to group movement.

4 Characteristics Flocking is an example of emergent behaviour. The individual members of the flock do not know anything about the behaviour of the flock. The flock will turn without direction. In the original formulation of flocking there is no leader. The movement propagates though the flock. An example of complexity out of simplicity - uses three simple rules.

5 Original Formulation Three rules: Separation: steer to avoid crowding local members of the flock. Alignment: steer towards the average heading of local members of the flock. Cohesion: steer to move toward the average position of members of the flock.

6 Discussion Only takes local members of the flock into account. The system is unpredictable (over moderate time periods. The algorithm uses feedback mechanisms. Feedback is when part (or all) of the output of a system is used as input into the system, e.g. a thermostat. Positive feedback leads to an uncontrolled system. Negative feedback leads to a controlled system. The system is chaotic. However, the use of feedback leads to group behaviour and, in most circumstances, a stable system.

7 Efficiency considerations An individual knows the average location and heading of other members of the flock, plus the distance between itself and the other members. The algorithm can be computationally expensive since each member needs to make a comparison against every other members. Can reduce this cost if the members are kept sorted by location.

8 Distances In Craig's initial experiments attraction and repulsion were weighted linearly by distance. This resulted in an unrealistic "bouncy" flocking action. The net effect is like a spring. He revised the model to use an inverse square of the distance. This resulted in more realistic flocking behaviour. The inverse square law dampens the effect.

9 Inverse Square Law The inverse square law is the law that an effect is inversely proportion to the square of the distance. For example, let the repulsive effect of the flock members at a distance of 1 be r : distancecalculationeffect 11/1 2 = 1r/1 21/2 2 = 1/4r/4 31/3 2 = 1/9r/9

10 Collisions Collisions will occur within the flock. There will come points where the net effect of the repulsors and attractors will force a collision between flock members. It is necessary to maintain a collision detection system in place. Could abrupt turns in emergency situations. It can be argued that this is realistic, e.g. birds do occasionally collide.

11 Forward perception Can introduce forward perception. The individual can only perceive those members of the flock who are in their field of view. A wide field of view leads to a broad flock. A narrow field of view leads to a narrow flock (ultimately follow-my- leader)

12 Behaviour As you change the values used with separation, alignment and cohesion the behaviour of the flock will change. Could give each member of the flock slightly different values, i.e. a flock made out of non-uniform members.

13 Graceful obstacle avoidance The flocking behaviour as described ignores obstacles. A graceful form of obstacle avoidance can be created by providing the individual with sensors. This has similarities with the sensors used in robotics.

14 Graceful obstacle avoidance Use a vector drawn from the individual to the outside of the radius. May be able to get away with just a single sensor sticking out of the front of the individual.

15 Leaders The original formulation of flocking did not include targets or leaders. The leader could be permamently designated. The designation of leader could be temporary. For example, let's introduce the idea of the flock aiming towards the most recent mouse click on screen. The leader could be the member of the flock nearest the target and where the target is in front of the individual. The rest of the flock could use a follow-the-leader rule.

16 Attractors and Repulsors These 3 rules describe 3 attractors/repulsors. Attractors attract the individual. Repulsors repulse the individual. The repulsors and attractors are summed together to generate the action.

17 Attractors and Repulsors The use of the inverse square law helps to dampen oscillation. However, it is inefficient to let the influence exerted by each member of the flock just degrade over distance since they will still exert an influence. It is necessary to introduce a cut-off as well.

18 Attractors and Repulsors The flock is in constant motion. If you want to allow the flock to come to rest then it may prove to use further dampening or allow more complex combination of forces, e.g. so that a flock of birds can come to rest when they perch. The aim is allow still points to arise automatically. Could tie the repulsion between flock members in with the speed of the members - although this would have to be a non-linear relationship (similar sort of reasoning to the inverse square used more generally in flocking).

19 More behaviour Predator - prey relationships can be created. Predators are to be avoided. A predator is repulsive. The individual will attempt to move away from a predator. Prey is to be hunted. The prey is attractive. A predator will attempt to close with prey. Note that real predators may utilise the natural response of their prey in order to trap them, e.g. wolves.

20 Formations Previously talked about the use of relative positioning in a formation. This can be used with flocking as well.

21 Attractors and Repulsors Lots more to explore. Olsen, "Attractors and Repulsors", Game Programming Gems 4, discusses the summation of attractors and repulsors. He also introduces a "mass" into the equation. The net effect of the "mass" would be to dampen the acceleration. Olsen also discusses some alternative non-linear attraction curves.

22 Some references Craig Reynolds (1987), "Flocks, Herds, and Schools: A Distributed Behavioral Model", SIGGRAPH Bourg & Seemann, AI for Game Developers. Sample chapter: erpt_ai_for_game_developers.php Steve Rabin, "Common Game AI Techniques", AI Game Programming Wisdom 2, 2003.

23 Some references Steven Woodcock, "Flocking with Teeth: Predators and Prey", Game Programming Gems 2, John M. Olsen, "Attractors and Repulsors", Game Programming Gems 4, 2004.