Sprite Kit, GLKit, and Scene Kit: How Apple is shaping game development
Buried in the avalanche of publicity surrounding the release of iOS 7 was the introduction of a new framework, called Sprite Kit, designed to help developers more easily and efficiently build 2D games.
The news barely registered in the mainstream press, but it made a big splash at this year’s Worldwide Developers Conference, where many enthusiastic programmers attended a few sessions covering it.
Given the seemingly endless stream of games that land in the App Store, Sprite Kit may seem at first glance to be little more than a curiosity—one of many new features to debut in a new operating system release. In reality, though, it’s part of a long-running strategy that Apple has developed to make iOS a great place for gamers and developers.
With great power comes great complexity
Building a computer game has never been an easy task. All but the most trivial titles require considerable programming effort in areas ranging from graphics to sound to user interface. In the old days, this meant taking advantage of every trick in the book to squeeze performance out of computer architectures that were, by today’s standards, primitive. With GPUs nowhere to be seen until the mid-1990s, developers had to build their own tools almost from scratch.
Today, power is no longer a significant hurdle. The iPhone—a phone!—has more than enough GPU strength to render photorealistic graphics in real time, without requiring the kind of programming voodoo that developers had to rely on a decade or two ago. Even better, the industry has largely standardized on a small set of technologies—such as DirectX for Windows-based systems and OpenGL for everything else—that abstract away the quirks of individual hardware platforms, leaving programmers free to focus on how their games work and spend less time worrying about why they don’t work on a particular device.
That improvement doesn’t necessarily mean that coding a game has become easier overall, however. Developers often approach OpenGL expecting it to be a magical technology that will enable them to build incredible graphics with a handful of keystrokes, and instead discover that it builds the thinnest of layers on top of the raw GPU hardware. It’s a bit like shopping for a great sports car, only to be handed a jet engine, a couple of hammers, and an instruction manual written in a foreign language: The raw power is there, but the tools that OpenGL provides are rudimentary at best; and to take full advantage of them, developers must have a deep knowledge of the math and techniques involved in 3D graphics.
Start your engines
For that reason, almost no one builds games right on top of OpenGL (or DirectX); instead, developers rely on an additional layer of technology—an “engine”—that allows them to deal with complex graphics in a discrete way, rather than having to worry about every triangle and lighting algorithm.
As you can imagine, engines come in all shapes and sizes. Some, like Unity and the Unreal Engine are commercial, and offer complete three-dimensional programming environments that game designers can easily port from platform to platform.
Into the fray
From Apple’s perspective, both of these kinds of engine have severe shortcomings. The commercial products are often cross-platform and make it a little too easy for developers to build games that work across multiple operating systems.Given the choice, the folks from Cupertino would probably be happier if more titles were exclusive to iOS and OS X, instead of being available on competing platforms as well.
On the other hand, many open-source tools designed to work only with Apple technologies lag behind the advances introduced by newer hardware, and their haphazard growth sometimes results in confusing programming interfaces. This is particularly important because open-source engines tend to be used by the small independent developers who have been responsible for many of the best original games to hit the market in the past few years.
For these reasons, Apple has quietly begun introducing a series of frameworks that make developing games for its products easier. For example, iOS 5 included a framework called GLKit that simplifies interfacing with OpenGL. Starting with Lion, OS X began offering Scene Kit, which simplifies the process of rendering complex three-dimensional scenes. And with iOS 7—and Mavericks—comes Sprite Kit, which contains everything developers need to write a 2D game from scratch, without having to worry about OpenGL.
The gaming long tail
Obviously, these officially supported technologies play into Apple’s strategy of locking developers in to developing for its operating systems: You can easily port a Sprite Kit app from OS X to iOS, but you can’t reuse much of its code for an Android version.
But more is at play here. Great games aren’t just about the raw ability to push pixels to a screen—they are about user experience. Technologies that simplify access to the advanced graphics that power today’s iOS devices enable developers to work more efficiently and to focus on things like gameplay and artificial intelligence, which arguably affect the quality of video games much more than how many triangles you can display per second.
In a broader sense, frameworks like Sprite Kit are part of the same strategy that pushed Apple to create Game Center: Work hard to keep developers close to the company’s platforms while offering them better tools to build their software, and you’ll be rewarded with a rich ecosystem of high-quality games that are inexpensive to end users.
If history is any indication, we’ll see Apple take more and more steps in this direction in the future—which can only mean that the games we’ll be enjoying at the end of the process will continue to get better and better.