Apple's new Sprite Kit development framework aims to make it easier to create 2D arcade style games for both iOS 7 mobile devices and the Mac desktop, and hints at a future strategy for games on Apple TV.
Source: Apple
Sprite Kit is named after "sprites," the independent graphic elements in a video game that are typically animated over a separate background layer (think of the alien ships in Space Invaders or Pac Mac and the ghosts that chase him).
In addition to animating sprites (which can include other media elements such text and video) within a scene, Sprite Kit also simulates realistic physics to depict the force of gravity and inertia (such as in the swinging, weighted candy in Cut the Rope or the motion of balls bouncing off the banks of a billiard table) and can, like Motion, generate particle effects (such as clouds of fog or the flames erupting from a rocket's thrusters).
Sprite Kit offers a higher level framework for games developers that animates the components of their game artwork on the screen without requiring advanced knowledge of the underlying OpenGL code it abstracts below it, running at a much lower level on a device's graphics processor cores.
This puts Sprite Kit on a similar level to Core Animation, a framework Apple introduced with the iPhone to enable app developers to build smooth transitions and other graphic effects without needing to master the complexities and specialized GPU programming involved with coding raw OpenGL.
Zynga and Cocos2D
The concept behind Sprite Kit isn't at all new; iOS developers can already use one of a variety of third party gaming frameworks, such as Cocos2d-iphone, to get similar functionality.
However, by building its own Sprite Kit, Apple not only gained the ability to tightly integrate the framework with its Xcode development tools, but it also can ensure that its developers have access to tools that will both be around in the future, and grow in directions Apple desires.
One issue facing existing third party gaming frameworks is that, despite often being open source like Cocos2D, they may be acquired and taken in directions that aren't great for either Apple or its OS X and iOS developers.
In the case of Cocos2D, this happened last summer when Zynga hired Ricardo Quesada, the project's lead developer, leaving the project's future direction in question.
Months prior to his hiring, Quesada had described plans to bring Cocos2D to the Mac, but now that he's working for Zynga, that project's future is also unknown.
Zynga has since refocused the development of Cocos2D on cross platform web development, noting in a February press release that its new JavaScript version was "the next big thing in the Cocos2D universe."
It also told developers they could now use its new Cocos2D JS to "write your code just once and have run in all major web-browsers through HTML5 and with close to native performance on iOS and Android devices."
Zynga's interests in focusing on HTML5 apps do not align with Apple's desire to have iOS remain the best native platform for gaming, and it doesn't do anything to help port great games to the OS X App Store either.
Apple storms the castle for 2D games on iOS, OS X
Apple has increasingly moved away from depending upon third parties to supply strategic components of its platform, whenever possible.
From developing its own Safari web browser to writing its own implementation of SMB to declaring its independence from Adobe Flash, Apple is working to avoid having its platforms hijacked in the pattern of Office, Adobe apps or Google Maps.
Writing about Apple's Sprite Kit launch, games developer Steffen Itterheim notes that, in possessing its own framework, Apple can make sure developers don't suffer through "compatibility problems with new [iOS] software releases," stating that "Sprite Kit will work flawlessly with new versions of Xcode, iOS, OS X, and whatever other software Apple changes.""Sprite Kit is beginner-friendly. It has the typical well-designed, trimmed, sleek API youâd expect from Apple."
In particular, Apple can maintain very similar versions of its Sprite Kit for both iOS and OS X, and even deliver an Apple TV version the moment it decides to opening up an HDTV App Store, something a third party web app publisher or a resource-constrained open source project is unlikely to even have on its radar.
Itterheim, who literally wrote the book on developing with Cocos2D, said the framework "was constantly being changed. Practically every new version introduced some changes that forced developers to change their code," and added that the "Cocos2D API leaves a lot to be desired," and that "concise, consistent and complete documentation does not exist anywhere."
In contrast, he expects Apple's new Sprite Kit to remain stable, predicting that developer's "half-life of knowledge, tutorials and books will increase, perhaps tremendously so."
He also states, "Sprite Kit is beginner-friendly. It has the typical well-designed, trimmed, sleek API youâd expect from Apple. Itâs got excellent documentation thatâll stay up to date and is complete."
Quesda, the lead developer of Cocos2D, agreed in a tweet: "Sprite kit is very good," he wrote. "less features than cocos2d but better. I like the physics integration."
Sprite kit is very good. With less features than cocos2d but better. A like the physics integration.
â Ricardo Quesada (@ricardoquesada) June 12, 2013
Apple and 3D development
Itterheim also stated that he doesn't expect Apple to rush to next deliver a 3D gaming engine like Unity and Unreal, which are used by a specialized set of major game developers including id Software, Epic, Ubisoft and EA.
"3D games are dominated by big game developers and publishers," he states. "Itâs one way they can distinguish themselves most easily from Indie productions."
In 2011, Apple introduced Scene Kit as OS X-only framework designed to import COLLADA 3D objects and build scenes composed by cameras, lights, and meshes.
The framework provides tools for manipulating the bounding volumes, geometry and materials used in the scene, acting as a middleware between low level OpenGL and higher level frameworks like Core Animation or Sprite Kit.
Apple's gaming push
However, Apple hasn't yet ported its Scene Kit framework to iOS yet, which has kept it isolated from the mainstream of App Store development. Instead, Apple is targeting the mass market for 2D arcade style games in iOS 7, the types of titles that make up the majority of downloads in the App Store.
Combined with this new software push, Apple is also working to define standard game controllers as part of its "Made for iPod/iPhone/iPad" programs.
Along with iOS 4's Game Center, which Apple ported to OS X Mountain Lion last year, the company's most recent efforts to standardize, monetize and facilitate game development in the App Store points to an increasingly strong position in mobile gaming that many observers expect the company to eventually transition into the living room.
35 Comments
About bloody time. I was holding off on Cocos2d for many years in anticipation of a move from Apple into this arena. I can't wait to have a play.
I'd just like to point out that Itterheim shouldn't really be considered a Cocos2D expert, given that his book on it is absolutely terrible.
This is particularly great news. I have a game in early development that was relying a lot on Cocos2D through the use of Kobold2D (which abstracts the two iOS/OS X Cocos versions away), but I'd much rather something that will be guaranteed supported. Will have to get my hands on the SDK now to start porting over what's already done to Sprite Kit.
What does this provide beyond current Core Animation features?
Moreover, this is unsettling for fans of cross-platform game development. Just as I discourage devs from getting locked into DirectX (and hiring a 3rd party for a rushed OS X port), I think it would be better for more devs to use OpenGL rather than getting locked into Core libraries. Unless Apple has a master plan to fold Core Animation and Sprite back into the OpenGL spec, similar to how they contribute to Webkit.
It also told developers they could now use its new Cocos2D JS to "write your code just once and have run in all major web-browsers through HTML5 and with close to native performance on iOS and Android devices."
Zynga's interests in focusing on HTML5 apps do not align with Apple's desire to have iOS remain the best native platform for gaming, and it doesn't do anything to help port great games to the OS X App Store either.
Of course it doesnt align with Apple desire, powerfull HTML5 tools is an ecosystem destroyer. But, from my experience, interpreted code will always underperform native apps.
On the plus side you can develop a single app for Windows,OS-XAndroid, iOS, ... and avoid paying a cut to the app store.
On the down side, the app store is a powerful marketing tool and graphic intensive apps just wont work in HTML5 unless the hardware is overkill for them.
I can see in the future some kind of Webapp "search engine" or "appstore" that is platform independant. Once consumers start using this tool in volume, this will slowly take a blow at all the ecosystems.
To me, ecosystems is the single most important thing right now. This is why I think Apple is way way to slow to enter the game console and TV markets. I am glad to see them enter the car business and I like the watch rumors, but they need to spread faster. The nest termostat initiative is also a great example of hardware fitting into an ecosystem. But it could be so much more, like for example vacuum robots.