Fighting Game Cameras

In this article I'm going to be going over the very basics of how to calculate the position of a fighting game camera each frame. It's not super complicated but it's something that I had to work out through trial and error so I wanted to have it written down somewhere for future fighting game designers.

Horizontal Position

So for 99% of fighting games, the camera should focus on the average of the two players' horizontal positions. However it gets more complicated if you're making a tag game.

If you're making a tag game, you'll usually want the camera to focus on the average point between the furthest left and furthest right characters. There is another option however.

Marvel VS Capcom 2 instead had a system where the camera doesn't follow anything in particular. It actually doesn't move at all unless a character is about to go off screen. If a character is too close to the edge of the screen then the camera will pan over to meet it.

But there's a large grace period in the middle of the screen where characters can move quite a bit without the camera following them.

Vertical Position

Vertical position pretty much follows the exact same formula for every good fighting game.

The camera's vertical position should be the highest of the follow heights: