270 likes | 426 Views
”Steering Behaviors For Autonomous Characters” By Craig W. Reynolds Rudi Bonfiglioli (3565025). Crowd Simulation Seminar. Outline. About the author and the paper Introduction, previous work, general concepts Main part: Locomotive model The steering layer – Behaviors Combining Behaviors
E N D
”Steering Behaviors For Autonomous Characters” By Craig W. ReynoldsRudi Bonfiglioli (3565025) Crowd Simulation Seminar
Outline • About the author and the paper • Introduction, previous work, general concepts • Main part: • Locomotive model • The steering layer – Behaviors • Combining Behaviors • Experiments • Assessment
Who? • Craig W. Reynolds, born in 1953 • Creates ”Boids” in 1986: artifical life program that simulates the flocking behavior of birds • Interested the field since then, mainly working in Sony R&D dep. In the US • Worked also on the films ”Tron” ('86) and ”Batman Returns” ('92)!
What? • Paper discussed at the GDC 1999 (656 citations) • Early days: Matrix was not even a movie! • Among first attempts at formalizing a crowd simulation approach: details about choices of words and overlapping related fields
Introduction • Focus on autonomous characters meant as situated, embodied, reactivevirtual agents • Situated: share world with similar entities • Embodied: have a physical manifestation • Reactive: have stimuli-driven instincts • Virtual: not just simulation of a mechanical device (easy to describe) but real agents in virtual world
Introduction (2) • Behavior: ”improvisation and life-like actions of an autonomous character” • Classical AI instead defines steps to solve problems • Complex: can be divided in layers • We will focus on the middle one
Previous Related Work • Robotics: Arkin R. (1987) “Motor Schema Based Navigation for a Mobile Robot: An Approach to Programming by Behavior” • Perception → Action Mappings expressed in terms of potential fields (not procedural approach) • AI: Costa, M. Feijó, B., Schwabe, D. (1990) ”Reactive Agents in Behavioral Animation” • Artificial Life: Tu, X. Terzopoulos, D. (1994) “Artificial Fishes: Physics, Locomotion, Perception, Behavior”
General Concepts • Our ”pipeline”: Signals→(Loco)Motion→Animation • 3 Independent levels? Theoretically, yes • In practice: Signals have to compensate the lower agility of locomotion! Animation model must be able to adapt to different locomotion scenarios! • The paper will try to treat the locomotion level as completely separated from steering level
Locomotion Model • Very simple • Not powerful, but general and easy to extend • A steering force (vector) is applied to move it, then Euler Integration • Orientation stores a description of both global and local (different viewpoint) space • No explicit rotations used to update state!
Locomotion Model (2) • While moving we mainly have to deal with updating the UP and SIDE vectors • Basic: UP is perpendicular to forward (velocity) direction, SIDE is perpendicular to new UP Vehicle moving on surfaces → easy. UP vector is always aligned with the normal of the surface Vehicle flying → Tricky. Banking: align the local floor (hence also UP) with the apparent gravity due to centrifugal force during a turn
Intermezzo • We defined the scope of our problem • We have a locomotion model • Let's move to the above layer: steering • Formal description of many steering behaviors through geometric calculation of desired steer force
Behaviors – Seek and Flee • Seek: adjust velocity so that its velocity is radially aligned towards the target Character will eventually pass through target, then turn back • Flee: Similar to seek but the velocity points in the opposite direction
Behaviors – Pursuit and Evasion • Pursuit: target is another moving char Try to predict the future position of char, then seek the predicted pos Position T units of time in the future → scale char velocity by T, then add to current pos • Defining T is the key • Evasion: instead, flee from predicted position • Optimal techniques for both pursuit and evasion exist!
Behaviors – Offset pursuit • Offset pursuit: steering a path that passes near a moving target without never really touching it • Dynamically compute a target point which is offset by a radius R from the predicted pos, then use seek
Behaviors - Arrival • Arrival: like seek, but when close to the target, incremental slow down so that we stop at target position • Max velocity kept until we are inside a circle with radius R (predefined) centered in the target position • Then, velocity is decreased (linearly?)
Behaviors – Obstacle avoidance • Obstacle avoidance: both obstacles and character are approximated with spheres • Cilinder projected in the forward direction: If any obstacles intersect it, we just move in the side direction with respect to the center of the nearest obstacle
More Behaviors... • Wander, path/wall following, containment • More elaborated behaviors use the simpler ones
… Even More Behaviors... • Collision avoidance (unaligned): one/both of the two characters must slow down/accelearate • But which one? • Flow following: powerful way to define the steering behavior to be adopted in an area
Group Behaviors • Separation,Cohesion, Alignment: by combining just these 3 group behaviors we can simulate flocking
Combining Behaviors • Steering behaviors described since now serve as building blocks for more complex patterns • Sequential switching and Combining • Check whether two behaviors can be combined • How to combine? Blending → calculate both forces • Computationally expensive! → Maybe alternating for some sequential frames? Momentum will be a filter • Defining priorities
Wrap Up • The paper defined a new framework for (re)thinking crowd steering • It described both a locomotive model and a way to model the steering layer • The approach is based on the implementation of (averagely) small behavioral patterns: rather then calculating forces depending on a number of rules and constraints (force fields), we compute them in a sequential way depending on the current pattern (state) or by combining more than one
Experiments? • Wait, no experiments/application? • Not completely true: opensteer, an opensource framework started by Reynoldshttp://opensteer.sourceforge.net/ • Opensteer is now way more advanced, but fundamental principles (and some routines) are still the same
[Show the video] Experiments (2)
Assessment • I think the method presented has some nice advantages: + Easy to modify/tune our situation in order to make something happen • Potential fields define a set of rules, hard to tune! + Easy to interact with the other ”layers” because we are always quite ”in control”
Assessment (2) • … But there are also a number of drawbacks: - Implementing so many patterns can be long - The implementations of many patterns seem to be quite inefficient (linear in the number of agents, a lot of arithmetic) • Maybe we can apply some space-partitioning/LOD? - Organizing the patterns is not trivial - We will always be limited by the number of patterns and their combination: are they enough?
Assessment (3) • Many challenges arise! • What behavioral patterns are the fundamental ones in crowd simulation? • What's the best way to combine them in order to obtain complex behavior? • Can we make crowd phenomena emerge by just defining a small number of patterns and combining them in some way? • ”Big Fast Crowds on PS3” (2006) by Reynolds (PSCrowd) • ”Continuum Crowds” (2006) by A. Treuille, S. Cooper, Z. Popović