Contents
Real-Time Cameras - Navigation and Occlusion
 
 
Printer-Friendly VersionPrinter-Friendly Version
 
Latest News
spacer View All spacer
 
November 22, 2009
 
Video Game Watchdog National Institute On Media And The Family Shutting Down [11]
 
Modern Warfare 2 Infinity Ward's 'Most Successful PC Version' Yet [14]
 
New Tech, Design Details Of Project Natal To Emerge At Gamefest In February
spacer
Latest Jobs
spacer View All     Post a Job     RSS spacer
 
November 22, 2009
 
Trion Redwood City
Sr. Environment Artist
 
Trion Redwood City
Sr. Evnironment Modeler
 
Sucker Punch Productions
Network Programmer
 
Sucker Punch Productions
Texture Artist
 
Sucker Punch Productions
Character Artist
 
Sucker Punch Productions
3D Environment Artist
 
Crystal Dynamics
Sr. Level Designer
 
Sony Online Entertainment
Brand Manager
spacer
Latest Features
spacer View All spacer
 
November 22, 2009
 
arrow Upping The Craft: Susan O'Connor On Games Writing [6]
 
arrow Small Developers: Minimizing Risks in Large Productions - Part II [7]
 
arrow iPhone Piracy: The Inside Story [50]
 
arrow And Yet It Grows: Analyzing the Size and Growth of the European Game Market [5]
 
arrow NPD: Behind the Numbers, October 2009 [13]
 
arrow Reflecting On Uncharted 2: How They Did It [5]
 
arrow Sponsored Feature: Rasterization on Larrabee -- Adaptive Rasterization Helps Boost Efficiency
 
arrow Postmortem: Wadjet Eye's The Blackwell Convergence [2]
spacer
Latest Blogs
spacer View All     Post     RSS spacer
 
November 22, 2009
 
Time Fcuk - A Postmortem [2]
 
Accepting the Inherent Value of Games
 
Planckogenesis, Part II: Song Structure & Gravy Train [1]
spacer
About
spacer News Director:
Leigh Alexander
Features Director:
Christian Nutt
Editor At Large:
Chris Remo
Advertising:
John 'Malik' Watson
Recruitment/Education:
Gina Gross
 
Features
  Real-Time Cameras - Navigation and Occlusion
by Mark Haigh-Hutchinson
2 comments
Share RSS
 
 
July 1, 2009 Article Start Previous Page 5 of 6 Next
 

Attractors/repulsors

Effective navigation assistance may be obtained by using attractors or repulsors, where the camera is literally attracted to (or repulsed from) pre-defined positions, regions, or other game objects. Often these positions are defined explicitly using script objects that are placed by the camera designer. Alternatively, offline analysis can be made of the environment to determine automatic placement; in practice this can be a difficult prospect without explicit rules governing their usage.

Advertisement

Both attractors and repulsors function by applying forces to the camera depending on the proximity (and possibly orientation) of the player or camera.

Note that these forces may not be implemented as part of the physical simulation (even if such a facility is available); rather they may simply influence the determination of the desired position or act as hard constraints during the actual camera motion.

The use of proximity as part of the calculation of forces suggests that the attractor or repulsor is spherical in nature, but this is not necessarily appropriate. Cylindrical shapes are frequently the most useful, often with their major axis aligned to the world up-vector.

Simplistic shapes are common because of the relatively low cost in the calculation of the proximity of game objects, and thus the forces required. Spheres, cylinders, and planes are common choices.

One specific example that is often problematic for cameras is navigation through doorways, particularly if the character moves quickly. Other than the problems of ensuring that the door does not physically close either between the camera and its target or on top of the camera, doorways are frequently a problem because they are often confined spaces and there are many opportunities for the player character to move in ways that may cause the camera to be left behind.

Vertical doorways are the most common case encountered, where the door is aligned with the up-axis of the game world. Horizontal doorways have additional challenges especially regarding camera orientation due to the potential for gimbal lock. Additional problems occur when external events may cause the door to close rapidly, leaving the camera behind the closed door (or worse, interpenetrating the door geometry).

To cope with such situations it is generally preferable that the door is held open while the camera is on the opposite side compared to the player, but this is not always possible. Thus, it is often necessary to implement a fail-safe to ensure that the camera is never left on the wrong side of a closed door.

If the camera system is able to track the proximity of the camera to doorways or otherwise be informed of how the camera is positioned and oriented relative to the doorway (e.g., by means of a trigger volume), an axis-based attractor may be used to help guide the camera motion through the doorway.

A proportional attractor can apply forces to the camera dependent upon the camera position relative to the axis of desired motion through the doorway. Care must be taken to ensure that these forces do not impart oscillation and that they are only applied when appropriate.

Considering the general case once again, the direction in which forces are applied by attractors or repulsors is also variable. Common usage would have the forces acting in relation to the physical shape of the attractor or repulsors; for example, a spherical attractor would pull objects toward its origin.

They can be based on a world-relative orientation; a cylindrical repulsor may determine its force from the player character's proximity to the central axis of the cylinder yet apply the repulsion force based on a fixed world orientation.

Attractors and repulsors are sometimes attached to (or form part of) other game objects. Thus, they may vary in their position and effects.

As with any force-based solution, care must be taken to ensure that such objects only apply their forces when appropriate. Stout discusses this in detail. Ensuring that forces do not adversely influence the camera is the most difficult part of their usage.

Cameras do differ somewhat from AI objects in this determination however, since there are additional aesthetic considerations to consider (such as the requirement to ensure smooth motion whenever possible). Thus if the camera incidentally moves past an attractor, it is not necessarily appropriate that it should be influenced. If the camera were moving away from the attractor, for example, we would not wish to apply any forces.

By careful choice of the attractor positions, camera motion can be made to avoid geometry or pass through confined environments without the necessity for complicated hand-scripted camera solutions. Indeed, the attractor or repulsors can be combined with regular game objects (such as doors) to assist camera motion without any additional scripting support.

 
Article Start Previous Page 5 of 6 Next
 
Comments

Jimmy Lee
profile image
Good read on an often neglected aspect of game development.

Luis Guimarães
profile image
As Blezinski has said "camera is everything"


none
 
Comment:
 


Submit Comment