Blog

Character Controller Requirements

Aug 17

Written by:
Tuesday, August 17, 2010  RssIcon

 

In one of the last posts we introduced our Character Controller Example. In the next posts, we will discuss character controllers for 3D games in more detail, including: general requirements, kinematic vs. dynamic character controllers, implementation, character controllers in virtual reality.

This post starts the series with a discussion of requirements of 3D game character controller.

Functional Requirements

Teleport

The first requirement is teleport because the character controller must be set to its initial position. A teleport sets the character to a new position. It doesn't matter where it was previously and if there are obstacles between the old and new position.

Recover from penetrations

Trusting Murphy's Law we can safely assume that each teleport brings the character into a position where it penetrates other objects. So it is good if the character controller has the ability to find a valid, non-penetrating position near the desired position.

Move

This is the basic operation that moves the character from its current position to its new position with a method that is often called "collide and slide" or "bump and slide". The character should stop before obstacles and slide along the obstacles to get as near to the desired position as possible without penetrating other solid objects.

Jump, Gravity

The player should be able to jump. There should be a restricted maneuverability (jump height and direction) while in the air. When the character does not touch the ground it should fall due to gravity.

Slope Limit

The characer should slide up and down inclined planes. There should be an inclination limit. Steep planes cannot be climbed. If slope limits are not supported, the level designer must place invisible walls to stop the player. (Even if slope limits are supported invisible walls are probably a good idea. Players will find all glitches.)

Step Up and Step Height Limit

The character should automatically step onto/over small obstacles. Stairs should also be no problem. There must be a limit for the maximal step height. If stepping up is not supported, the collision objects of stairs must be inclined planes.

Step Down

Stepping down sounds superfluous because the character will fall automatically - but stepping down is essential. In real life humans walking down stairs do not step into the air and let themselves fall down, they bend their knees and actively step down to touch the ground. If stepping down is not supported, a character moving down stairs or inclined planes will not move down smoothly. Instead it will bounce down on short ballistic curves and look very silly. - We refer to Fallout 3 if you want to see this behavior in action.

Modes

The character controller should support different operation modes, depending on whether collisions and gravity are enabled:

  • Collisions disabled, gravity disabled => Ghost mode. The character can fly and move through objects. Very useful for debugging.
  • Collision enabled, gravity disabled => Fly mode. The character can fly and slides along obstacles.
  • Collision enabled, gravity enabled => Walk mode. This is the normal mode where the character walks on the ground.

Theoretically there is a fourth mode:

  • Collisions disabled, gravity enabled => Falling mode. The character falls due to gravity and nothing stops him because collisions are disabled - not very useful.

Collision Filtering

It must be possible to define with which objects the character will collide and which are ignored.

Advanced Functions

The above functions cover the basics. A lot of other functions are desirable:

  • Changing the height of the character controller, crouching
    (Note: Before a character stands up, it must be checked if there is enough room to stand up.)
  • Swimming
  • Climbing
  • IK for hands and feet
  • Pushing dynamic objects and being pushed
  • Moving with elevators or conveyor belts
  • Additional movement smoothing
  • ...

Non-Functional/Qualitative Requirements

Avoid penetrations

The character should not penetrate solid objects. But: A small amount of penetration should be allowed for stability reasons.

Avoid tunnelling

Fast moving characters should not "tunnel" through thin or fast moving objects. That means, all collisions must be detected.

Avoid jitter

The character controller should not jitter when running into a limit, e.g. when running against a steep plane or into a sharp corner.

Avoid getting stuck

Does your character controller get stuck in this situation?

image

Many games like Warhammer Online or World of Warcraft have auto-unstuck features to move the character to a safe position once he gets stuck.

Limit the maximal velocity

The maximal velocity or movement per frame must be limited to avoid glitches.

Test Obstacle Course

To test our character controller implementations we have an obstacle course similar to the level in our Character Controller Example. In the course we test the following:

  • Movement over small obstacles on the floor.
  • Moving up/down stairs with steps of different height.
  • Moving up/down inclined planes with different angles.
  • Sliding down planes above the slope limit.
  • Sliding along a wall and other objects.
  • Running full speed into paper-thin objects.
  • Movement over height fields and meshes.
  • Running into corners.
  • Obstacles where the character controller could get stuck (see picture above).
  • Crouching and trying to stand up in places where there is not enough room to stand up.
  • Running and jumping with inclined obstacles above the character.
  • Sliding down planes/stairs while sliding against a wall.
  • Moving/jumping diagonal. (Diagonal movement should not be faster than straight movement.)


Your name:
Gravatar Preview
Your email:
(Optional) Email used only to show Gravatar.
Your website:
Title:
Comment:
Security Code
CAPTCHA image
Enter the code shown above in the box below
Add Comment   Cancel