Saturday 30 November 2013

Stop, Camera Time!


So for today's little blogging adventure, I have decided that I am going to be covering the topic of cameras in Games!  Cameras play such an important role not just in allowing the player to see what is occurring, but also with setting the mood of the game and adding another layer to the immersion.  Now there are a few different types of cameras that can be used for different games and I will be getting to those shortly, but first I am going to give a little explanation to what a camera is and how it fits into our game space!

By now, you should know that a camera in a game does not really function in the same way that a camera in real life does.  It does not record images onto film or digitally and allow the player to pull them up for their enjoyment at a later time.  Instead a camera creates a technical window into which our player can view the action that is occurring on the screen.  Now, even though many of the games that we play our classified as 3D, we still are not able to play them in a 3 dimensional space. (Unless of course you can afford a 3D TV!)  It is the cameras job to capture the 3D action occurring in the game world, and display it to the player on the screen in the form of a 2 dimensional image.  In a way, this makes current generation 3D games feel as though they should be called 2D games with very nice 3D models!

This is done by the use of creating a viewport that the player can look through to view the game in front of them.  In a perspective camera, much like the ones we use in Maya while modeling our characters, we are able to view our images in what is called the frustrum.  The frustrum of a camera is the distance between the near clipping plane and the far clipping planes.  For those who may be confused, a near clipping plane will not load any objects past its threshold (set distance away from the camera), while a near clipping plane will not load any objects in the viewport that are closer than its threshold.  Now, in a renderable scene there must also be an aspect ratio.  This ratio is determined by setting the width of a scene, as well as a height, then dividing the two in this order.  Since cameras work in the way they do, with a near and far clipping plane, objects that are closer to the far clipping plane will appear smaller than objects closer to the near plane.  This is how we create distance on screen and a sense of 3 dimensions!  The other form of camera used generally is called an orthographic camera.  This camera does not create a sense of distance and is therefore generally unpopular in gaming.

A classic perspective Camera
Now that we know that it is necessary for a camera to be involved for 3D images to be displayed with distance on screen, we can understand why its so important for games!  When it comes to cameras, a developer has a very important decision to make.  How will my camera system work?  There are more options than one would think, from the simple single camera system that follows the player from A to B throughout the entirety of the game, or will my game have many cameras, making the player feel as though they are immersed in a movie.  This important decision can not only impact how the player will play the game, but also the feelings and emotions they will have as well.  For this reason, camera choice can not be taken lightly.  So, before a designer can choose how they want there camera to function, they must first choose which camera type they would like to use, fixed or dynamic.

When I think of fixed cameras, there is really only one game that stands out in my mind, and that is the God of War franchise.  I am not sure if this is by my own personal preference, or if this is the result of three years of lectures with Dr. Hogue.  Even if this is not by my own choice, I can not argue with my professor on his choice, as the GOW series has a fantastic camera system.  This is because the camera is not meant to only be focusing on the main character constantly.  In my opinion, this camera system is best used for creating a very cinematic and epic gaming experience for the player.  The camera does not follow the player on a 1-1 character to camera movement basis, instead the player works inside the camera interpolates around the screen at its own pace.  The character is always kept in the frame, while still giving the player the sense that the camera is mounted on a swivel in another area, capturing the most cinematic of shots.  The cutscenes follow this trend as they are laid out in a way that the player feels as though they are watching a movie and they are the main protagonist.

This can be seen as Kratos is not perfectly centered like most camera systems.
These systems are beautifully executed in the game, but they are not a hard concept to grasp when some thought is put into the idea.  A camera such as this could be set up in Maya with the use of locators in different positions around the current level.  These could then be exported and simple interpolations could be implemented between each of the locators.  As the players moves about the level, the camera will smoothly pan from one location to the next, giving a very cinematic and cutscene like feeling to the levels.  Although fixed cameras do have their perks, many games have been implementing the second form of camera systems, Dynamic cameras.

These cameras, unlike their counter-parts, are definitely harder to understand when it comes to implementing them into games.  As discussed earlier, dynamic cameras are those that follow the player in a 1-1 manner.  If the player moves forward on the X axis, the camera will also move forward on this axis.  Since this is the case, a designer of a game has to ensure that this camera style will fit into the mood of the game they are trying to portray.  If a cinematic feel is what they are after, they should probably stick with the fixed system.  This camera style does have the advantage of putting the player directly into the action of the character however through the use of the first person camera.  The first person camera is great for games such as where the player wants to take on the role of an entity in the game, as the camera view is through the eyes of that character.  This is relatively easy to set up, as the cameras position is centered on the head area of the character, looking in the same direction that the eyes would be.

Through the eyes of the hero - First Person View


Setting up a camera location for the other form of dynamic camera, third person, is another story.  The third person camera view has the player from an over the shoulder perspective.  Most or all of the characters body is in view, and generally allows the player a more in depth view of the space the character is holding in the world.  This can be difficult to implement into games however, as the designers have to be very aware that the camera is actually slightly behind the players physical entity in the worldspace.  This can cause problems when a character runs toward the camera, while simultaneously running towards a wall, causing the camera to malfunction or show the character through a wall.  These are the challenges facing those who decide to implement a third person camera. 

Many fixes have been implemented into games over time however, and some work much better than others.  A way that has always thrown me off personally is having the camera reset to the behind the back position, upon coming into contact with a wall, while still allowing the character to keep running.  This always disoriented me, and made for a very un-enjoyable gaming experience.  A successful fix for this problem involved having the camera travel upwards along the wall so that the player was looking down at the character.  This doesn't have the disorienting effect that the other method has and it still allows the player to keep their thumbstick pointed in the same direction. 

Hopefully this blog has helped to outline the importance that cameras carry when being implemented into a game.  Although a bad camera system may just show the player what is occurring on the screen, I believe that a great camera system can involve the player on a whole new level, making them feel apart of the action taking place in front of their eyes.










No comments:

Post a Comment