320 likes | 327 Views
Dive into the connection between computer code and animation, focusing on action selection and emotional modeling. Learn about Finite State Machine, Behavior-Based AI, and more.
E N D
Autonomous Characters Professor: Bill Tomlinson Fall 2003 Tuesdays 3-5:50pm HIB 335 Meeting 3
State of the Union • We’ve covered the two big topics that we’ll be addressing this semester. • Still lots of things to come, but we’ll be focusing throughout on the link between computer code and animation.
Go Over Assignments • Any troubles getting things to compile? • Other questions?
Go Over Readings • Lasseter – Other approaches to animation?
Go Over Readings • Picard/Wilson – Emotional modeling. Too simplistic?
Go Over Readings • Burke/Tomlinson – Any questions about the system?
Go Over Readings • Stein – any code questions?
Action Selection – Why? • Make a list of reasons that animate entities need to choose different actions
Behavior • Connection between stimulus and response
Learning • Connection between an action and consequences
Behavioral change over time (over different time scales) • Action • Learning • Development • Learning
Emotional change over time • Emotion • Mood • Personality
The Craft of Acting • Making decisions appear meaningful. • Connecting actions and emotions.
Drama • Action selection • Showcasing that action selection – staging, lighting, responses from other actors, etc.
Action Selection – How? Once we decide what we want it to do, how do we code that? Finite State Machine: Make a graph Behavior-Based AI – layered behaviors – Make a tree
Action Selection – An Example Vec3 myPos = new Vec3(); this.getPosition(myPos); if (myPos.mag() <20) { SoundSystem.play( "w:/sound/beep.wav"); }
Perception • What can people sense?
Perception • What can the characters sense?
Perceivable things • Come up with a list of environmental things that might provoke emotional change.
Conditionals • if (something) { do this;}
Vectors • Vec3, in particular • Similar to a point, but more active. • Represents what you have to do to one point in order to change it into another point. • Vec3.add(a, b, c); • Vec3.sub(a, b, c); • thisVec3.mag();
Navigation • navSys.goTo(camPos); • Will walk emotively • sets “action” when .goTo is called, so be careful not to replace it with some other action later.
Play a sound • SoundSystem.play("w:/sound/beep.wav");
Rules on copying code • Cut and paste reuse is fine with me, as long as you understand what the code is doing. • Please put comments in your code to show me that you understand. • Black-box behavior
Some code examples:Get position of camera • public Vec3 camPos = new Vec3(); • camPos.setValue(CameraSystem.getPosition()); • System.out.println(“CamPos is “+camPos);
Some code examples:Get position of other character • Vec3friendsPos=newVec3(); • research.World.getWorld().getCreature( "PersonACE_01 number 0").getPosition(friendsPos); • System.out.println("PersonACE_01 number 0's pos = "+friendsPos);
Some code examples:Get distance from me to other character • Vec3 distanceBetweenUsVec = new Vec3(); • Vec3.sub(myPos, friendsPos, distanceBetweenUsVec); • double distanceBetweenUsDouble = distanceBetweenUsVec.mag(); • System.out.println(“Distance between us is “ + distanceBetweenUsDouble);
Assignment 3 • Program character to have an emotional response to its environment. Attach emotional change to some perceivable phenomenon.
Emotional assignment happiness = .5; OR this.getPosition(myPos); happiness = myPos.x(); OR …
Assignment 3 • Don’t forget comments, println.
Readings for Oct 21 • Braitenberg (handout) • Acting - Cohen (handout) • Vectorpark (link) • Stein (Ch 4)