Download presentation
Presentation is loading. Please wait.
1
CIS 488/588 Bruce R. Maxim UM-Dearborn
Steering Behavior CIS 488/588 Bruce R. Maxim UM-Dearborn 12/5/2018
2
Alife Focuses on behavior of individual creatures that combine into complex pattern The interaction of simple patterns can create incredibly sophisticated simulations Alife can be used to simulate crowds in complex environments using streering behaviors This was the basis of Conway’s game of life 12/5/2018
3
Assumptions Steering behaviors assume the existence of a lower-level of the engine to handle locomotion The locomotion system processes each characters position and velocity When player stops pressing a key movement stops (heavy duty friction) In many games a key press is likely to control velocity and not acceleration In this chapter velocity persists and the AI applies an acceleration to effect steering 12/5/2018
4
Seeking and Fleeing Seeking Fleeing Pursuit Evasion
Steering behavior moving creatures toward target Fleeing Steering behavior moving creatures away from target Pursuit Seeking a moving target Evasion Avoiding a moving target 12/5/2018
5
Enhancements - 1 Wandering Projecting Targets
Make random behavior appear a little more purposeful Patterns should be slightly unpredictable, but not arbitrarily random Could accumulate steering values and filter them using the sin function (gives both + and – values) Projecting Targets Look ahead randomly for point where target is predicted to be and move there 12/5/2018
6
Seeking Implementation
#compute velocity vector toward target desired_velocity = truncate(position_target,max_speed); #compute steering force steering_force = desired_velocity velocity; Arrival behavior can be simulated by slowing down the velocity to something less than max_speed within some distance from target 12/5/2018
7
Fleeing Implementation
// compute velocity vector toward target desired_velocity = truncate(position_target,max_speed); // compute steering force steering_force = - desired_velocity velocity; 12/5/2018
8
Modeling Flocks There are additional steering components needed (e.g. alignment and cohesion) when modeling group behaviors These require position and orientation information for neighbors rather than surrounding obstacles 12/5/2018
9
Generalized Obstacle Avoidance
function avoid_obstacles { project future position based on velocity if collision predicted project empty position away from collision compute turn to get to empty position } if obstacle is within critical distance determine braking force // slow or stop apply steering and braking forces 12/5/2018
10
Comments Application of steering and braking forces is easy since our interface outputs turn and move values The challenge is in acquiring the inputs used to determine future collisions This algorithm requires environment knowledge, intersection tests, collision normal forces, and location of nearby empty spaces This makes it unsuitable for implementation 12/5/2018
11
Updated Obstacle Avoidance - 1
function avoid_obstacles2 { check sensors for free space front, left, right if front collision predicted find furthest obstacle on right or left determine best side to turn toward compute turn to seek that free space } if front obstacle is within critical distance determine braking force // slow or stop 12/5/2018
12
Updated Obstacle Avoidance - 2
if obstacle on left adjust steering to step right if obstacle on right adjust steering to step left apply steering and braking forces } Implementing this involves simple translation to C++ and finding suitable parameters during experimentation phase 12/5/2018
13
Enhancements - 2 Forced Exploration
Keep track of previous positions a flee from them Done using single vector (provenance)pointing toward last position Coefficients a + b = 1 provenance = a * previous + b * provenance 12/5/2018
14
Advantages - 1 Simplicity Reliability Predictability Efficiency
Hard to find a simpler architecture Reliability Most situations can be identified requirements Predictability No ambiguity, each rule written explicitly Efficiency Very low computational overhead 12/5/2018
15
Disadvantages - 1 Local traps Testing
Can still get stuck in corners, if it begins to turn one way and then decides the another way might be better Testing This approach requires extensive testing because there are so many parameters to play with 12/5/2018
16
Disadvantages - 2 Realism Scalability
Robotic movement is not as smooth as it might be (local decisions are not integrated into a plan) Scalability Additional behaviors are added by adding additional lines of code and recompiling 12/5/2018
17
Marvin Uses obstacle sensors and steering behaviors to prevent collisions in a reactive fashion Uses chapter enhancements to improve its wandering behavior 12/5/2018
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.