Smoothness. If there was one aspect of Osmos that we were psychotically obsessed with during development, it was smoothness. Just like driving on freshly laid asphalt, skating on a rink just after the Zamboni has gone by, skiing through light untracked powder, gliding down a trail on a mountain bike with 10 inches of suspension, or gliding your Mote through the Blobiverse to gobble up an Ovarium, we knew that smooth travel brings joy to the human condition.
We strove for smoothness in our visual design; the slow pulsing glow in the motes, the hypnotic drifting particles inside your player that slowly tumble out into the Blobiverse, the growing and decaying starfield in the background, and gentle visual transitions between scenes. We were careful too with audio. There’s no game event that can cause the music to suddenly stop with a crash like a drunkard stumbling into the record player at a party. We chose an ambient soundtrack without a dominant beat, so that the player doesn’t unintentionally speed up the Mote in response to the music. And to keep the music a part of the background noise of the Blobiverse, rather than just a soundtrack playing along with the game, we had to change the speed of the music when the player changes the simulation speed of the Blobiverse.
Bringing this artistic vision to the iPhone was a tough technical challenge. The phone is powered by a tiny lithium-ion battery about half the size of my thumb, and to make good use of this minuscule power source, the computing and graphics power of the phone are kept low. If either the CPU (computing power for physics simulations, gameplay, sound, and user input) or the GPU (graphics power for drawing the scene) hit their limit, the animation starts to get choppy, like a pot-holed highway in New Jersey. And so began a long two-pronged process of code optimization.
Seeing other iPhone games that have complex worlds full of people, buildings, cars, and guns you may wonder why it would be difficult to animate our 2D retro-style arcade game. The performance secret for a 3D game is walls. The player can’t see through walls, so once a portion of the screen is taken up by a barrier, the computer can just ignore everything that exists behind it. In contrast, everything in Osmos is translucent, giving the soft, glowing, jellyfish atmosphere to the game, and so the computer has to draw everything within the player’s field of view every frame.
After a few months of work, we were starting to be satisfied with the game’s performance on the iPhone, when Apple announced the iPad. We knew this large touch-screen computer would be the perfect device for Osmos. Being lowly Canadians, we couldn’t get our hands on an actual iPad till many months after the U.S. release. In the meantime, we developed Osmos using Apple’s excellent simulator software, but we didn’t know how the performance of the iPad would compare to the iPhone until we could actually run the game on the device. The 2nd generation iPhone had been GPU limited, the 3rd generation had been CPU limited, but we hoped that the iPad wouldn’t be limited at all. But we knew we wouldn’t get a free ride once several developers noted that the GPU on the iPad was somewhat underpowered.
The area of the iPad screen is 8 times larger than that of the iPhone, while the number of pixels on the screen is just 5 times larger. I now need to take a brief aside to laugh at the marketing term HD. HD stands for high-definition, which most people would interpret to mean high-detail, fineness, or in computer terms, pixels per square inch. The iPad has only 5/8ths as many pixels per square inch as the 3G iPhone, which means that all those iPad games that distinguish themselves from the iPhone version with the name HD, are actually lower definition than the iPhone. The iPad has even lower definition when compared to the high resolution 4G iPhone, with the iPad having 1/5 the pixel density. Of course, pixel density isn’t everything, and the iPad is a joy simply because the screen is larger. And I will now guiltily confess that when you install Osmos for iPad, Hemisphere Games also shows the name of the game as Osmos HD. But mom, Billy was playing with the chainsaws first.
Marketing silliness aside, the fact remains that the iPad has to process 5x as many pixels as the iPhone. Our tests indicated that the iPad graphics card was only 3x as fast as the iPhone. So once again, we had to put on our thinking hats, and see what last corners of Osmos we could optimize. The Apple documentation let us know that overlapping transparency is hard on the graphics chip and encouraged us to create opaque, easy to draw worlds, but we really wanted to keep the soft glow of Osmos. Still, it was time to make some concessions for the mobile platform, so we turned on our debugging tools to see what graphical element in Osmos was causing the most overlap. In the following debugging screenshot, black areas of the screen contain nothing at all (easiest on the GPU) dark green areas have lots of overlap (tough on the GPU), and the light green areas have 1 or 2 overlapping elements, perfect for creating that soft glow.
It was quickly apparent that our background star field was using up all the graphics power. In the PC version, the stars are created randomly at varying sizes to try and cover the background space of the Blobiverse. For the mobile versions we generated a grid and tried to distribute the stars evenly, while being careful that the visual effect didn’t look like a grid. The resulting stars look a bit flatter than the PC version, which had us disappointed for a while, until we regained some perspective and remembered that we were trying to run Osmos on a phone. The new stars made Osmos run twice as fast, which was a very exciting optimization.
Why did Apple, with the physical space and much larger battery reserves of the iPad, use an underpowered graphics chip? Well, the cynic in me suspects that they want you to buy another iPad when they release the next generation and describe the graphics card as being x-times faster. But given how important a successful launch of a tablet computer needed to be in an unproven market, I suspect the true answer reason is heat. A powerful graphics processor uses a lot power, generating a lot of heat, creating much discomfort in your lap.
In the end, we were very pleased with the buttery smoothness we could drag out of miniaturized low power devices. There’s still a few tiny hiccups and jerks that our OCD personalities would love to see disappear, but perhaps we’ll have to wait for the next generation of high technology to emerge from Apple.