Get the latest Education e-news
  • The Curse of the Camera

    - Frederic Poirier
  •  [Vortex Green developer Frederic Poirier offers several helpful hints for developers struggling with the tricky issues raised by in-game camera angles.]

    It's very rare that you can play the same game with very different points of views. In fact, some game genres are defined entirely by the camera: for instance, First-Person Shooters, Third-Person Shooters, Dungeon Crawlers and Strategy Games (isometric or view-from-above), and platformers (usually side-views). In developing Vortex Green, I have challenged myself to design a game that would be playable using different camera views. You can play it as a first-person shooter, and then replay it as an isometric game for a very different experience.

    If you think it's as simple as changing the camera position and angle, read on. If you've ever played a game with a bad camera and thought "why didn't they just fix the camera?", again, read on. There is much more to the camera than meets the eye.

    A simple change of camera angle changes the following: (1) how you control your character, (2) what you see and don't see, and ultimately, (3) gameplay focus, along with level design and game balance. Because gameplay is so fundamentally tied to what you can see, I will discuss those two topics jointly.

    Part 1: How You Control Your Character

    1.1 Transforming to the new screen coordinates

    Players using the keyboard and mouse will often use the "wasd" keys to move. In isometric games as well as first-person shooters, it's common for those keys to be used to move your character in a given direction, with perhaps the space bar to jump and the left ctrl key to crouch. However, in a side-view platforming game, it is common for "w" to be used for jumping, and "s" for crouching.

    This means that if the camera angle changes, the function of keys need to adapt. Ideally, developers include a way for players to assign keys to functions. However, in a game where the camera can change drastically, developers need to include both "smart keys" and "fixed keys". Smart keys change function based on camera angle; in other words, we could make "w" move forward in first-person but jump in side-view. Fixed keys always perform the same function. For instance, "space" would always perform a jump, regardless of view.

    1.2 Interpreting the mouse

    Mouse movements should always translate into movements that approximately match screen coordinates, because it makes mouse usage more intuitive. What this means inside your game depends on the camera angle. In first-person, mouse coordinates translate directly to left-right and up-down angles that your character is looking toward. In isometric view, mouse coordinates translate directly to left-right and far-near distances. In side-view, mouse coordinates translate directly to left-right and up-down distances.

    You can use trigonometric transformations to go from screen coordinates to world coordinates and back. This may be unavoidable if you want to make sure the cursor doesn't exit the screen, and actually interacts with the objects it points to. When doing so, keep in mind that you are going from a 2D coordinate system to a 3D coordinate system. That is, when interpreting screen coordinates, you will need to assume a third coordinate: for instance, if players either want to interact with objects at the same depth as their character, or with the nearest object that can be seen at the cursor's location.

    Note that each view poorly handles one type of information: first-person poorly handles distance, isometric poorly handles height, and side-view poorly handles depth (see section 2.3 on the next page).

    1.3 Joystick functions

    The same concerns that apply to mouse and keyboard also apply to joysticks, except that joysticks are not restricted to work with screen coordinates like the mouse is. Nevertheless, the concept of smart and fixed functions discussed above (see section 1.1) should be extended to joysticks.


comments powered by Disqus