I have done it again. I've created a game camera for yet another game and forgotten what I learned from all previous projects. I have 9 sheets of paper in front of me with pencil graphs and equations written on both sides and plenty of eraser crumbs all over.
It is time I documented my solutions in a place that won't be lost in bad handwriting in a drawer of a desk where I no longer work. Let's see if I can dig up some of those notes and remember some of those ideas of games shipped and make public posts about them.
Right now my stack of sheets contain a solution to find an optimal position for a camera to see a number of things on a screen taking into account some covered parts of the view. This is something I already solved in both Playstation All-Stars and Sonic Boom and I keep having to start over because I don't have a reference to my old notes or code.
Game cameras are often asked to do too much, including showing the desired perspective of the game; maximizing the size of the player; maximizing how much you see around the player; showing the direction forward; showing all the enemies around you; showing something in the distance that is relevant to what you should do and more and more, to the point where the game camera is simply a spatial and rotation optimization problem and not an opportunity for creativity.
With experience and constant persuasion from those I work with I've found that many limitations can be avoided by digging a little deeper. Since I've done this many times I feel I can share some of the solutions.
Much of my work has involved Bezier splines applied in different ways to cameras, some games have 2D cameras, most projects have user controlled cameras and lots of features require robust smoothing functions, and many implementations of camera collision. I worked on game cameras for most of my games, including Pocahontas for Genesis, Pac-Man World 2, Shrek 2, Kung Fu Panda, Playstation All-Stars Battle Royale, Transformers: Revenge of the Fallen and more. I might not have the notes or source available but I do have a good memory.
Future posts will include actual notes about game camera programming.