Computer Animation Tim Weyrich March 2010 Behaviour Simulation Heavily based on slides by Marco Gillies Behaviour simulation Behaviour simulation • � Have a procedural model of a • � Sense - Action selection – Act character’s behaviour that decides what • � Flocking and crowds the character should do next • � A lot of overlap with AI Simulating behaviour Sense-Select-Act • � The “Agent” paradigm Character Sense • � Comes from AI • � The character is Action – � Autonomous Environment Selection – � Reactive Act – � Proactive
Sensing Action Selection • � Decide what to do next depending on • � To act the character needs to know what the character has sensed and its about the environment current state • � In a graphical world this is easy, you – � (if the character has no state then the have everything stored in the scene behaviour is called “reactive”) graph! • � This is the core of the behaviour • � Need some sort of filtering rule to make simulation sure that a character doesn’t know stuff • � Can be done based on a number of it shouldn’t (e.g. see stuff behind it) factors Action Selection Act • � Satisfying drives • � Implement the action – � Hunger, tiredness, social (e.g. The Sims) • � Turn the action specification into a piece • � Path finding of animation of the type we’ve talked about – � Getting around an environment • � Need motion specific to the action • � Emotion (which isn’t known in advance) – � Expressing emotion • � 2 ways of doing it – � Influencing actions – � Inverse Kinematics • � Goals – � Motion capture/hand animated – � Does actions which help achieve goals Act: IK Act: IK • � If an action involves: • � Pros – � Interacting with an object – � Allows exact placement of the hands (or other body parts) – � Moving the hand to a particular location – � Very flexible, allows a large range of – � Moving the hands to a particular place on actions the body (e.g. hands on hips) • � Cons • � Inverse Kinematics is an obvious choice – � Not as good quality motion as mocap or hand animated – � expensive
Act: Canned Motion Act: Canned Motion • � To get higher quality motion you need to • � Pros use canned motion – � High quality motion • � Either motion captured or hand – � Faster animated • � Cons – � Limited range of motions – � Either limits to a small number of actions – � Or you end up using inappropriate motion Act: Motion reuse Act: Motion reuse • � The best of both worlds would be to • � One way is to combine motions have a way of changing motion to fit the • � E.g. if you want to walk, turning left by current situation without reducing its 20 ° and you have a straight walk and a quality 45 ° walk • � There are many methods to do this • � Blend the two walks together (linear (though the quality often suffers a bit) interpolation • � Turn20 = slerp(straight, turn45, 20/45) Act: Motion reuse Act: Motion reuse • � Motions can be composed out of • � Apply one motion “on top of” another smaller sub motions • � E.g. if you have a motion (walking) you • � E.g. gestures can be composed out of can apply a posture to it (hunched over) small sub-gestures • � Want to have all of both motions (not • � Apply different sub-motions to different blending or separate joints) joints • � Quaternion multiplication will combine • � Or blend as before the effects q = q 1 q 2
Act: Motion reuse Craig Reynolds - flocking • � The first behavioural • � So we have 3 simple methods simulation – � Blend 2 motions (interpolate) • � Simulates the behaviour of – � Apply different motions to different joints flocks of birds (boids), – � Quaternion multiplication schools of fish or herds of • � Also more complex methods animals – � Combining IK with canned motion • � Extensively used in films and other applications – � Find IK solution that is closest to the motion • � “Flocks, herds and schools: a distributed behavioural model” Craig Reynolds SIGGRAPH 1987 Boids: Sensing Boids: Sensing • � The boids have direct access to the • � Need some filtering to provide realistic scene graph sensing • � They directly sense aspects of the • � (and reduce behaviour of other boids in their flock computation) • � They also “see” a simplified • � Only sense other representation of objects that can act as boids within a obstacles certain distance and angle Reynold’s 87 Boids: Action Selection Boids: Action Selection • � Craig Reynold’s work was an early • � Separation aspect of the artificial life field • � Steer away from • � He observed the behaviour of real flockmates that flocks of birds and tried to figure out are very close rules of their behaviour • � The resulting rules are surprisingly simple
Boids: Action Selection Boids: Action Selection • � Alignment: • � Cohesion: • � Match direction to • � Move towards the the average centre of mass of direction of nearby nearby flockmates flockmates Boids: Action Selection Boids: Action Selection • � There is also a rule to avoid bumping • � The behaviours take strict priority over into obstacles each other: • � Obstacle Avoidance: • � Obstacle Avoidance • � Steer to avoid any obstacles in the • � Separation scene • � Alignment • � Cohesion Boids: Act Craig Reynolds - flocking • � boids are very simple they have a • � Emergent Behaviour position, orientation and velocity • � These simple rules • � They are moved by changing the velocity produce surprising results • � Animations can be added on top • � Here is a flock splitting to avoid an obstacle • � They recombine afterwards, just like a real flock
Boids: Movie
Recommend
More recommend