• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/50

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

50 Cards in this Set

  • Front
  • Back

Why is there overlap between animation and AI?

Both involve movement

What level of our AI model is movement AI?

The lowest level

What is the basic form of all movement algorithms?

Take in geometric data about the world and output a movement based on that data.

Does a movement algorithm that requires obstacle avoidance require more or less input?

More, because it needs to know the location of objects in the world.

Your movement algorithm outputs a direction and vector; this is an example of:

Velocity

What is kinematic movement?

Movement that does not account for acceleration and the current movement of the character.

If our movement algorithm simply calculates velocities (direction + speed) at regular intervals, what kind of movement is this?

Kinematic; it does not use the current movement or calculate acceleration.

What is dynamic movement?

Movement which looks at the current motion of the character.

What do dynamic movement algorithms output?

Forces like acceleration that change a characters velocity.

Dynamic movement algorithms are also known as?

Steering behavior

Movement AI typically considers the character as how many points?

A single point

What is orientation?

The direction a character is facing

What does rotation change?

Orientation

What axis is the plane of the ground in 3d games?

X, and Z. Y generally is the direction opposite of gravity.

What is a 2.5 game?

A game that uses 3d graphics but only allows movement in a 2 dimensional plane.

Mortal Combat is an example of a what?

2.5 degree game

How is orientation represented in a 2.5 degree game?

Orientation will only change in a single 2 dimensional plane. (Think where the character looks in Mortal combat)

True 3D games differ from 2.5D games how?

Neither orientation or movement are restricted to 2 dimensional planes.

What is the computational advantage of 2.5D games?

Much simpler, more flexible calculations because we don't have to calculate for changes in 3D space.

In a 2D/2.5D game, the Z axis typically points where?

Straight down

In a 2D/2.5D game, initial orientation is set to what?

0, along the Z axis.

In a 2D/2.5D game, orientation is mathematically represented by what?

An angle representing counter clockwise (right hand) distance around the y axis from the z axis.

In a 2D game, positions are represented by what?

A vector with an x and y number.

What coordinate is added to the position vector in a 2.5D/3D game?

A y coordinate.

What kind of movement/behavior is needed to create realistic movement that works with Newtonian physics?

Dynamic movement AKA steering behavior, that keeps track of the characters position/velocity.

For movement AI, at minimum characters need what two pieces of information?

Position and orientation.

What is the kinematic data that characters need for steering behaviors?

Position, Velocity, Orientation, Rotation.

Write the kinematic struct that holds the information for characters:

struct Kinematic:


2Dvector position


float orientation


2Dvector (or 3D vector) velocity


float rotation

Write the steering struct:

struct Steering:

2Dvector (or 3D vector) linear


float angular


Steering behavior requires what kinds of data?

A 2D or 3D vector that describes linear acceleration, and/or a floating point that represents angular acceleration.

Write simple code for updating the position of a character.

xPos += (xVelocity * time)


zPos += (zVelocity * time)

Write simple code for updating the orientation (theta) of a character, given a right key press and a angular rotation dtheta. Limit it the turn to -1.0

public void gamePressedKey(int keyCode){


....


case: keyEvent.vk_RIGHT


theta -= dtheta


if (theta < -1.0) theta = -1.0;

Write pseudocode representation euler-integration updates of position and orientation

position += velocity * time;


orientation += rotation * time;

Write pseudocode representing euler-integration updates of velocity and rotation

velocity += steering.linear * time;


rotation += steering.angular * time;

In dynamic movement, before we can calculate the changed position/orientation, we must calculate what first?

velocity and rotation

How do we get around laggy movement due to variable framerates?

By using a time variable multiplied by a velocity at each frame rather than simply a velocity. If we just used a per frame velocity, than whenever framerate slowed, movement would slow too.

Write code to change velocity and position by direct control of velocity

public void gameKeyPressed(int keyCode) { switch (keyCode) { case KeyEvent.VK_UP: mVZ -= deltaV;


...


} }




...(update)


posX += VX*t;


posZ += VZ*t;

Write code to change velocity and position using a steering wheel and forward acceleration

case KeyEvent.VK_UP: S += S; break;

case KeyEvent.VK_DOWN: S -= S; break;


case KeyEvent.VK_RIGHT: theta -= dtheta; if (theta < -1.0) theta = -1.0; break;


case KeyEvent.VK_LEFT: theta += dtheta; if (theta > 1.0) theta = 1.0; break; }




...(update)


omega += (S/R)*theta*dt; mVX = S*Math.sin(omega);


VZ = S*Math.cos(omega);




...




posX += (int)(VX*t);


posZ += (int)(VZ*t);



What are kinematic movement algorithms?

Tried and true processes that take in static data (position, orientation) and return velocities.

What is seek behavior?

A movement algorithm that returns a velocity that points straight at the target, or another point if we are doing a variant of seek behavior.

Write code for a basic seek behavior

# Create the structure for output


steering = new KinematicSteeringOutput()




# Get the direction to the target steering.velocity = 16 target.position - character.position




# The velocity is along this direction, at full #speed




steering.velocity.normalize()


steering.velocity *= maxSpeed




# Face in the direction we want to move character.orientation = getNewOrientation(character.orientation,steering.velocity)




# Output the steering


steering.rotation = 0


return steering

Write code for the kinematicSteeringOutput struct that our different seek behaviors use

struct kinematicSteeringOutput()




velocity


rotation

What is flee behavior?

A variant of seek behavior where the character moves the opposite direction of the target rather than towards it.

Take the relevant line of code in seek behavior and change it to make the character flee

# Get the direction away from the target steering.velocity = character.position - target.position

What problem does the arrive variant of seek solve?

It prevents the characteristic wiggle of seek that results from it approaching too fast and overshooting its target, by slowing the character down as it approaches.

Write the arrive variant of seek code

SEE BOOK FOR CODE

Write the alternate code for the steering seek method

SEE BOOK

What is clipping?

Clipping is setting a max/min value for a certain property. It is uses to set max speeds, level boundaries, etc.

Write code to implement border clipping (stop at walls) for the x coordinate

if (mX < mRadius) { // if we're at left side

mX = mRadius; }

Write code to implement max speed clipping

if (mS > maxSpeed) mS = maxSpeed;