This was a fun job :)
The original game had a fixed camera for one very simple and very unimaginative reason: I had no time. There is a game design concern, you don’t want levels too big, as individual characters will get left behind, and the player may become confused at relative location.
Camera movement within medium sized levels is however essential to creating the sense of increased scale which I want for this game. With that in mind, I sat down this week and designed a 2d scrolling camera.
Panning - I based this on my experience of scripting panning cameras in flash. Essentially, a target optimum position for the camera is set (in this case, to the active player). The camera then moves 1/100th of of the distance there on each update. The result is a camera pan with a quick start, but a nice smooth ease out. This feels right to me, it feels a lot like a cameraman reacting.. fast adjustment to change in focus, followed by smooth placement at the end. It’s basically the trick firefly pulled in every single space battle shot.
Level extents - Really simple, the camera object has 4 variables, one for each extent (top, bottom, left, right). If the camera target strays out of this imagined box, it is adjusted back in, pre camera move. This maintains the smoothness, while ensuring players don’t see my messy level edges :)
And here’s a video of the resulting camera. Looking forward to plugging this into a real level. Have to make one first…