I've got several player-controlled objects (at least 4, perhaps more in future) on screen and a single camera. The camera needs to keep all players on screen at all times. The camera should only move a limited amount, something like the camera in Super Smash Bros., which tracks the players across a nominally 2D level, panning and zooming as necessary.
I know it will require some method of centring the camera on the group, and then some function to make sure the camera is zoomed out far enough away from the group that all four (or more) of them are in view at the same time (this should be done by moving the camera, not changing the FOV).
I'm not great at mathematics, so this makes my head hurt a bit. Any help would be greatly appreciated!