Click or drag to resize
DigitalRuneCharacter Controller Requirements

This article discusses the requirements of a 3D character controller for games.

This topic contains the following sections:

Functional requirements

A character controller should support following functions:

  • 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 character 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.

  • 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 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
    • Etc.
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 tunneling: 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: The character should not get into situations where it cannot move anymore. A situation where a character controller might get stuck, looks like this:

    Character-Stuck

    Many games 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 use an obstacle course. 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.
  • 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.)
  • Etc.