Written by: Tuesday, August 17, 2010
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.
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.
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.
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.
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.
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.)
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.
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.
The character controller should support different operation modes, depending on whether collisions and gravity are enabled:
Theoretically there is a fourth mode:
It must be possible to define with which objects the character will collide and which are ignored.
The above functions cover the basics. A lot of other functions are desirable:
The character should not penetrate solid objects. But: A small amount of penetration should be allowed for stability reasons.
Fast moving characters should not "tunnel" through thin or fast moving objects. That means, all collisions must be detected.
The character controller should not jitter when running into a limit, e.g. when running against a steep plane or into a sharp corner.
Does your character controller get stuck in this situation?
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.
The maximal velocity or movement per frame must be limited to avoid glitches.
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:
0 comment(s) so far...
A collection of the most useful blog articles can be found here:
Article Collection (on Documentation page)
DigitalRune is a trademark of Garstenauer Information Technology OG.
Garstenauer Information Technology OG Weingartenstrasse 35, 4452 Ternberg Austria (EUROPE) office@digitalrune.com