Sponsored By

Third person camera design with free move zone

I propose here a way to design a following third person camera with a free move zone. It's mainly oriented for quite "nervous" controls which needs to have a reactive camera, trying to being "smart" following you the best way possible.

Yoann Pignole, Blogger

September 28, 2015

6 Min Read
Game Developer logo in a gray background | Game Developer

Introduction

The camera design I'm about to expose is oriented for quite "nervous" controls which needs a reactive camera, trying to being "smart" following you the best way possible.

It's probably not the best design for shoot-oriented games but it's more relevant for plateformers/navigation-oriented ones.

As for a classical game design document in the industry, I extracted the parameters which are needed by the game designer to tweak the camera. Of course, even if it might be an evidence, a good camera is a good mechanic but also a right tweaking regarding what you want to do in your game.

And to give credit where credit is due, this design is partly based on  several games camera systems like mainly Assassin's Creed series, Lego City Undercover and Infamous series.

Basic setup

The basic setup is the "default" camera position, when the player didn't move the camera freely, and the one used for "standard" follow mode.

Design  parameters :

  • Height from ground (unit)

  • Distance from character (unit)

  • Pitch rotation (unit)

  • Horizontal angle of view (degree)

  • Horizontal offset (unit)

For parameters, units are in parenthesis. The terme "unit" means the distance unit used in the project (more often meters).

Free move zone

The "free move zone" is a zone where the character can move without any camera reaction/follow. It contributes to the player's feeling of freedom and gives a more "cinematic" mood.

This is considerated here as a cylinder.

This cylinder moves as a "child" of the camera, "locked" to it (so, always at the center of the screen) except that it always stays vertical relating to the world (in other words, the pitch pivot for the camera is the center of the cylinder).

Design  parameters :

  • Height from ground (unit)

  • Distance from character (unit)

  • Pitch rotation (unit)

Free cam controls

Using an X/Y input (more often a mouse or a pad stick), the player can move the camera freely on a sphere around the character, always looking at him.

This move use a specific acceleration/max speed couple.

The camera move is vertically limited by a limited angle.

Design parameters :

  • Free move radius (unit)

  • Free up move distance (unit)

  • Free down move distance (degree)

Follow

The basic functionning of the follow behaviour is quite simple : as soon as the character exits the "free move zone", the camera defines a new position/orientation to replace it inside the zone.

Depending on horizontal or vertical follow, and if the player moved the camera with the free cam controls, different constraints/rules lead the cam new position/orientation choice.

Design parameter :

  • Follow smooth inertia (factor)

  • Front angle to return from free to standard mode (deg)

  • Max pitch angle (deg)

Yes, the first parameter is quite obscure. The reason is the computation behind a follow behaviour is often quite complex if you want to have a "smooth/elastic" feeling (which is highly recommended in a modern game). So, I think the best way for the designer to tweak this behavior is to have only one value which represents how much the camera follow "with inertia" : lower is the value, more immediate is the camera reaction and higher is the value more "smooth/elastic" is the reaction.

Horizontal follow

Standard mode

In standard follow mode, the cam can only use forward / backward translation and yaw rotation to keep the character in the cylinder horizontally.

Free cam mode

As soon as the player moved the camera with the right stick the follow is in "free cam mode" :

  • The camera can only use translations to keep the character in the cylinder horizontally.

  • If the player exits the free move zone in specified front angle (relative to camera view) AND is not touching the free cam input anymore, the camera returns to standard mode AND interpolates to basic setup position/orientation.

Vertical follow

Standard mode

For the vertical follow, the camera acts like a trailer.
Decomposing this behavior, it means a pitch around the cylinder pivot in addition to a downward/upward translation.

The pitch is limited with a maximum angle. So, as soons as this angle is reached, the camera just translate to keep the character in the cylinder.

As soon as the character is grounded again, the camera interpolates to its basic setup (if not still in free mode).

Free cam mode

If the player touch the right stick while in the air, the camera switch to free cam follow mode :

  • The camera can only use translations to keep the character in the cylinder vertically.

  • If the player exits the free move zone vertically AND is not touching the free cam input anymore, the camera returns to standard mode AND interpolates to basic setup position/orientation.

Vertically, the return to standard more is easier than horizontally as in a lot of games, when you start falling, you often want to know quickly where you will land (so have the standard plunging camera). In some games with special gameplay mixing long falling phases mixed whith shoot, you may want to have more control before returning to standard follow mode in the air, using a timer from the last time the player touched the free cam input, for example.

Speed and camera distance

Design parameters :

  • Min speed to start increase distance (unit/sec)

  • Max speed to stop increase distance (unit/sec)

  • Max distance from character (unit)

There are a max speed and a max distance to clamp this behaviour.When the character exceeds a specified front speed, the camera starts to increase the distance with the character for the player to have a better view on where he goes.

Collisions / occlusions

Design parameter :

  • Min distance from the free move zone (unit)

The camera collider (sphere around the camera) can't enter a collision and slides on it. This rules takes priority over all the other ones.
The camera should never come closer to the minimum distance from the free move zone (particulary if it slides on ground/roof when being moved by player).

If the character is hidden behind an obstacle, the camera check if the character is visible from a new position in order :

  1. Rotating around the "free cam sphere", with prior to horizontal rotation

  2. Coming closerto the character respecting the minimum distance from free move zone

  3. Coming closer to the character respecting the minimum distance and rotating around

  4. Coming closer to the character, not respecting the minimum distance (until being inside the character mesh) --> it should be the last solution and a very rare case.

Read more about:

Featured Blogs
Daily news, dev blogs, and stories from Game Developer straight to your inbox

You May Also Like