Jarrah Technology logo

March 27, 2013

Category: News

Author: Charles

Zoom and Scale Twitter Facebook Share on Google+

The last couple of weeks of Concealed Intent development have been focused on improving the way players move the camera around the 3D playing space. Part of this magnifying the view or seeing more of the whole scene - the same affect as zooming/unzooming with a camera lens. This is a fairly standard mechanism in strategy games and there are couple of ways to implement it. I am coming to the conclusion I picked a very bad way to do it.

In a camera, zoom is achieved by changing the focal length of the lens. I am not aware of any computer game that does zoom this way, generally everything is in focus at once (tilt-shift being a notably exception). Instead it appears (from playing various games in the last few days) that the most common way to implement camera zoom is changing the field of view. That is when zooming the angle of the camera’s view is changed, the lower the angle the less “space” is shown at the same distance from the camera. Hence as the screen size doesn’t change, everything in the view seems bigger. This effect is most obvious when a game allows the player to look down the sights of a gun (a sniper view). Everything in the view is magnified at the cost of losing peripheral vision.

Unity3D has a simple setter for fieldOfView. Combined with Levels of Detail, using this technique for zoom is quite easy. I didn’t do it this way.

Concealed Intent currently uses a third technique - scaling. When a player zooms, they are actually changing the scale of the viewed simulation. That is, “zooming in” means the camera is unchanged but all the models get bigger and the space between them gets larger (and vice versa for zooming out). At Unite12 Universe Sandbox said they were using this technique to help ensure mathematical accuracy. Also, in Concealed Intent two ships very close to each other are displayed as a single ship (with note to say there are multiple ships present). By using scaling these ships would separate as zooming increases the space between them.

The downside of scaling is the complexity. Every time the scale changes (and it tends to change in small amounts so the transition looks smooth to players), everything needs to change position and size. All this results in extra code and maths I had to add myself with custom events. It took about a week to get right (so far). Now I’m not sure the work was worth it.

People are coming back saying the zoom acts a bit weird, probably because they are not familiar with it. The complexity is only increasing (everytime I add a new type of object to the screen - like movement trails) and the benefits don’t seem so important anymore. I fear the best course of action may be to spend the time removing the scaling and replace it with field of view zooming. Then I can chalk the whole thing up to experience.