camera angles
DESCRIPTION
Camera angles . By Chris Hinkey (cmh209) Standard game camera angle techniques Camera controllers Replay camera angles . Don’t need to do much if the game is in 2D When your game is 3D and dynamic is when some problems come in . Why we need a good camera system. - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Camera angles](https://reader036.vdocuments.us/reader036/viewer/2022062813/568164d8550346895dd71938/html5/thumbnails/1.jpg)
Camera angles
• By Chris Hinkey (cmh209)
• Standard game camera angle techniques
• Camera controllers
• Replay camera angles
![Page 2: Camera angles](https://reader036.vdocuments.us/reader036/viewer/2022062813/568164d8550346895dd71938/html5/thumbnails/2.jpg)
• Don’t need to do much if the game is in 2D
• When your game is 3D and dynamic is when some problems come in
![Page 3: Camera angles](https://reader036.vdocuments.us/reader036/viewer/2022062813/568164d8550346895dd71938/html5/thumbnails/3.jpg)
Why we need a good camera system
• If done right cameras will not be noticed • If done wrong everyone will notice the
slightest flaw • Jittery cameras are not good for fun game
play• If you can not see the hero well it is hard
to react successfully • Having to fix the camera manually as a
user is annoying
![Page 4: Camera angles](https://reader036.vdocuments.us/reader036/viewer/2022062813/568164d8550346895dd71938/html5/thumbnails/4.jpg)
Requirements of a good camera system
• Able to change from user input • Continuously see a clear view of the desired
character. • Give special attention to important events • Anticipate characters movements as well as
possible• Have a clear view of the path of the character
![Page 5: Camera angles](https://reader036.vdocuments.us/reader036/viewer/2022062813/568164d8550346895dd71938/html5/thumbnails/5.jpg)
Problems with doing this
• Not able to pre-process the environment
• Not able to hard code where the camera needs to go
• Avoid obstacles from being in between the camera and the character
![Page 6: Camera angles](https://reader036.vdocuments.us/reader036/viewer/2022062813/568164d8550346895dd71938/html5/thumbnails/6.jpg)
Avoiding obstructed view
• How to do this, pros and cons
– Raycast collisions
– Multi-raycast
![Page 7: Camera angles](https://reader036.vdocuments.us/reader036/viewer/2022062813/568164d8550346895dd71938/html5/thumbnails/7.jpg)
Attraction points
• The camera moves to different pre defined points depending on where the character is located
• Works well for small maps• Could possibly cause a jittery camera• Doesn't work as well with a dynamic
environment
![Page 8: Camera angles](https://reader036.vdocuments.us/reader036/viewer/2022062813/568164d8550346895dd71938/html5/thumbnails/8.jpg)
Raycast collisions • Cast out one ray from the character to the
camera
• Set the camera from any clear path in between the camera and the character
• This causes sudden camera movements
• Some ways around this?
![Page 9: Camera angles](https://reader036.vdocuments.us/reader036/viewer/2022062813/568164d8550346895dd71938/html5/thumbnails/9.jpg)
Multi-raycast
• Send out four rays from the character around where the camera should go
• Should the camera move away from object?– If any of the four rays is hit by an object move away from that
object
• Should the distance be shortened?– If a clear path can be obtained zoom in
![Page 10: Camera angles](https://reader036.vdocuments.us/reader036/viewer/2022062813/568164d8550346895dd71938/html5/thumbnails/10.jpg)
More on Multi-raycasts
• Smoothing– Used to deal with tunnel situations – Use more zooming in to get around obstacles
• Camera transitions (switching characters)– a function occurs to calculate the new
camera position for the new character.
![Page 11: Camera angles](https://reader036.vdocuments.us/reader036/viewer/2022062813/568164d8550346895dd71938/html5/thumbnails/11.jpg)
Intelligent Camera Control
• Typical architectures and the problems
• A better way to build a camera control system
![Page 12: Camera angles](https://reader036.vdocuments.us/reader036/viewer/2022062813/568164d8550346895dd71938/html5/thumbnails/12.jpg)
Typical camera architectures• Starts with a few monolithic behaviors that only
work well for predictable behaviors • Then fixes are added for certain cases where
the camera is broken • This causes a very fragile camera system to
code • Trade off between fixing a problem and possibly
breaking something else• This focuses more on the subject not the camera
![Page 13: Camera angles](https://reader036.vdocuments.us/reader036/viewer/2022062813/568164d8550346895dd71938/html5/thumbnails/13.jpg)
A better way to do things
• The camera should be thought of as a primary character
• Should be based on lightweight behaviors to allow easy design process
• Easy addition of new behaviors• Easy way to switch between these behaviors
• How do we do all this
![Page 14: Camera angles](https://reader036.vdocuments.us/reader036/viewer/2022062813/568164d8550346895dd71938/html5/thumbnails/14.jpg)
Implementation
• Camera fragment class – Simple math processor– Camera behavior– Updates camera every frame – Receives camera location matrix and
generates the new camera position – Generalized code that can be reused in many
projects
![Page 15: Camera angles](https://reader036.vdocuments.us/reader036/viewer/2022062813/568164d8550346895dd71938/html5/thumbnails/15.jpg)
Camera Fragment class
• Three update components – position– Height with respect to terrain – Look at and field view (make sure object is in
view)• These are to be preformed in order
![Page 16: Camera angles](https://reader036.vdocuments.us/reader036/viewer/2022062813/568164d8550346895dd71938/html5/thumbnails/16.jpg)
Implementation continued • Camera Controller class
– An interface between the game and the Camera Fragment class
– In charge of creation/destroying, ordering, activation and updates to different fragments
– Will create fragments and put them in a specified order
– During each update the controller will cascade through the fragments and generate a new location
– No way to turn fragments on and off
![Page 17: Camera angles](https://reader036.vdocuments.us/reader036/viewer/2022062813/568164d8550346895dd71938/html5/thumbnails/17.jpg)
Adding some AI • There is some lack of flexibility, lets fix that • Rules
– Add rules that turn fragments on and off– Used within both controller and fragment classes– Fuzzy rules would add a level of flexibility (too close,
not too far)– Works better for systems with fewer fragments – Hard to reorder fragments using this technique
![Page 18: Camera angles](https://reader036.vdocuments.us/reader036/viewer/2022062813/568164d8550346895dd71938/html5/thumbnails/18.jpg)
State Machines
Controller class can have a simple Machine having a rule set to traverse through the states
• Each state can be a set of fragments that are active
• Allows easy reordering of fragments
![Page 19: Camera angles](https://reader036.vdocuments.us/reader036/viewer/2022062813/568164d8550346895dd71938/html5/thumbnails/19.jpg)
Other AI
• Messaging – This is a good way to keep track of game data in the
controller class without using a lot of processing time – Used to trigger rule system
• Scripting– Can abstract out code for messaging, switching and
ordering– Helpful for doing replays
![Page 20: Camera angles](https://reader036.vdocuments.us/reader036/viewer/2022062813/568164d8550346895dd71938/html5/thumbnails/20.jpg)
Camera angles in replays
• Important for sports games • Give the player the ability to see some of
the minor details of the game• Common problems • Different styles
![Page 21: Camera angles](https://reader036.vdocuments.us/reader036/viewer/2022062813/568164d8550346895dd71938/html5/thumbnails/21.jpg)
Problems
• Player must be entertained continuously
• Frustration – Accuracy (use better recording schemes )– Poor performance– Player must feel in control of the replay
• Restart, pause, speed control, jump forward and back, and change camera
![Page 22: Camera angles](https://reader036.vdocuments.us/reader036/viewer/2022062813/568164d8550346895dd71938/html5/thumbnails/22.jpg)
More problems
• Boredom
– Have a fast paced interesting replay – This is hard to do because you need to create
the replay on the fly – A rule based AI system can help in this– These rules can be based on film making
camera work
![Page 23: Camera angles](https://reader036.vdocuments.us/reader036/viewer/2022062813/568164d8550346895dd71938/html5/thumbnails/23.jpg)
Different styles
• Intro Camera– Introduces you to the stage and actors – Starts at a distance and then moves toward
the subject– When it get to the subject circle around the
subject– Only used at the beginning when everything is
stationary
![Page 24: Camera angles](https://reader036.vdocuments.us/reader036/viewer/2022062813/568164d8550346895dd71938/html5/thumbnails/24.jpg)
First person camera
• Presents the stage from the subject’s point of view
• Useful in racing games • Important to have a frame of reference on
the subject• Can be used often but for only short
periods of time
![Page 25: Camera angles](https://reader036.vdocuments.us/reader036/viewer/2022062813/568164d8550346895dd71938/html5/thumbnails/25.jpg)
Follow or Third-person camera
• Shows part of the scene and the subject from behind
• Many variations of this camera from different heights and distances
• Used as a calming section after an action sequence
• This camera can be used for up to 50% of the replay
![Page 26: Camera angles](https://reader036.vdocuments.us/reader036/viewer/2022062813/568164d8550346895dd71938/html5/thumbnails/26.jpg)
Matrix camera• Pauses some or all the action and then circles
around the subject
• This gives a very dramatic effect
• Should be used when something spectacular is happening
• Use this camera very sparingly
![Page 27: Camera angles](https://reader036.vdocuments.us/reader036/viewer/2022062813/568164d8550346895dd71938/html5/thumbnails/27.jpg)
Circle camera
• Slowly circles the subject while looking at them
• Good for a slow portion of the replay
• Can be used as a transition from side to side of the player
![Page 28: Camera angles](https://reader036.vdocuments.us/reader036/viewer/2022062813/568164d8550346895dd71938/html5/thumbnails/28.jpg)
Still frame camera
• As the subject passes, the action is paused at regular intervals simulating photographs
• Used in conjunction with photographers on the sidelines
![Page 29: Camera angles](https://reader036.vdocuments.us/reader036/viewer/2022062813/568164d8550346895dd71938/html5/thumbnails/29.jpg)
Camera switching rules
• Don’t cut to the opposite side of a player it is disorienting
• Subject should always be in sight• Transitions from camera to camera should
be fluid • Special cameras (matrix) should be used
sparingly
![Page 30: Camera angles](https://reader036.vdocuments.us/reader036/viewer/2022062813/568164d8550346895dd71938/html5/thumbnails/30.jpg)
Camera Switching rules cont…
• Use follow cameras a lot to serve as breathers between other cameras
• All cameras should know where to switch to in case they lose sight of the subject
• Make sure the camera types used are appropriate for the game type
![Page 31: Camera angles](https://reader036.vdocuments.us/reader036/viewer/2022062813/568164d8550346895dd71938/html5/thumbnails/31.jpg)
Some good tools
• Switching the subject of each camera • Taking screen shots • Stop subject while the rest of the scene
continues • See and change what camera the current
camera is going to switch to• Tools to allow an artist or designer to fine
tune the replays
![Page 32: Camera angles](https://reader036.vdocuments.us/reader036/viewer/2022062813/568164d8550346895dd71938/html5/thumbnails/32.jpg)
Freak Out - Extreme Freeride
• Snow boarding sports replay
• Shows examples of the different kinds of cameras
• http://www.youtube.com/watch?v=Axwy2j2E84M
![Page 33: Camera angles](https://reader036.vdocuments.us/reader036/viewer/2022062813/568164d8550346895dd71938/html5/thumbnails/33.jpg)
Super Mario Galaxy
• Good camera implementation
• A lot of open field areas without many obstacles
• www.youtube.com/watch?v=v7bN-YhEEtI
![Page 34: Camera angles](https://reader036.vdocuments.us/reader036/viewer/2022062813/568164d8550346895dd71938/html5/thumbnails/34.jpg)
Legend of Zelda: ocarina of time
• Boss battle with terrible camera implementation
• http://www.youtube.com/watch?v=ef4z7SQi5Oc