Making the most of OpenGL

Backflip Studios's latest game Harbor Havoc 3D just went live on the App Store, and the studio is certainly keen to reveal more about the development process.

It's provided us with a breakdown from one of its engineers Andrei Gradinari about some of the features it used.

Andrei Gradinari: A lot of work went into making Harbor Havoc 3D look like it does. Initially the idea was to make a 2D boat routing game, but part way through development, we decided to make the whole thing in 3D.

Harbor Havoc ended up being a 3D rendered game with gameplay happening in multi-layered 2D.

A common misconception among iPhone game developers is advanced 3D graphics effects can only be done with the iPhone 3GS. Unfortunately, this means some of the really beautiful games end up only running on the 3GS.

The iPhone 3GS is indeed an amazing device, but the original iPhone, iPhone 3G, and iPod touch are capable of doing many things too. So, one of the challenges we set for ourselves was to make a 3D game that would look gorgeous, but at the same time run on all of the devices in the iPhone/iPod touch family.

On the graphics side, Harbor Havoc 3D features:

3D units and environmentsAs the name of the game implies, Harbor Havoc is rendered in 3D. Vehicles and effects are rendered in real time, while the levels are designed in 3D and saved as sets of pre-rendered images.Animated waterTo implement water we use a set of pre-rendered tileable animated water images. As the texture is being animated, the engine smoothly interpolates between animation frames to give an extra smooth feel to the water surface movement.Underwater caustics effectIn the underwater level called Atlantis, we overlay an animated caustics image to create the feel of light rays passing through the water surface and ending up distorted on the sea bottom.

Animated explosionsEveryone loves big explosions and BackflipStudios members are no exception. We put a lot of work into making the explosions as fun and dramatic as possible. The explosions are implemented using texture animation with smooth interpolation between texture frames.

Shockwave distortionWhenever an explosion happens in the game, a shockwave is radiated out from the explosion centre. As the shockwave expands across the screen the image in the area affected by the shockwave is distorted, just like it would in real life.

Underwater animated distortionIn the underwater level, the scene is smoothly distorted over time to further enhance the feeling of being submerged.

Panoramic menuA game experience starts with the main menu. We figured that if we wanted the game to look great we probably wanted the menu to match it. Harbor Havoc 3D features a coverflow style menu with a camera inside a 360 degree panorama composed of menu items.

Level menu items feature full resolution game snapshots, allowing for a seamless transition from menu to game and vice-versa. From the OpenGL standpoint, the menu is pretty heavyweight on memory usage since we use 480 x 320 uncompressed texture images, but the amount of the iPhone graphics memory available for the application is enough for this functionality.

Real-time lightingIn order to light everything properly we use the built-in OpenGL per vertex lighting system.

We also wanted to implement bump mapping - an advanced lighting technique used to achieve high visual detail on lower polygon models. However it turned out bump mapping wasn't very noticeable on the small 3D models, so we decided to leave it out.

But we are definitely implementing it in our upcoming game Ragdoll Blaster 2, and again, the effect will be available on all the devices in the iPhone/iPod touch family.

Harbor Havoc 3D is out now, priced $1.99, €1.59 or £1.19. Hit the 'Buy It!' button to go direct to the App Store.