Cocos2D Podcast: Sparrow Framework

On August 25, 2011, in cocos2d, podcast, by Steffen Itterheim

A new episode of the Cocos2D Podcast is now live. This time we’re joined by Daniel Sperl, author of the Sparrow Framework Objective-C game engine for iOS which is based on the ActionScript (Flash) API design.

Note: the Sparrow website is currently reported as “possibly malware” by Safari and Google. The culprit has been removed and the site is safe to visit. Read this blog post for more info about what happened.

Daniel has a secret he shared with us even though he couldn’t really say any details until the official announcement in a few weeks. Cocos2D also gets a couple honorable (or dishonorable) mentions as we compare it with Sparrow Framework, and come to the conclusion that documentation-wise it is leaps and bounds ahead of Cocos2D.

Cocos2D Podcast: Daniel Sperl (Sparrow Framework Developer)

Cocos2D Podcast on iTunes

Previous Cocos2D Podcast: Marketing your App

I forgot to blog about the previous Cocos2D Podcast in which Azam and I talk about marketing your iPhone app.

Cocos2D Podcast: Marketing your iPhone App

Cocos2D Podcast on iTunes

Unrelated but important: Steve Jobs resigns

In case you haven’t heard, Steve Jobs has resigned as CEO of Apple on August 24th, 2011. Here’s Steve’s (short and to the point) letter to the Board of Directors. Tim Cook was named as his successor. Read the press release.

I never really cared for who’s boss of a big company, just enough to get the ridicule. But Steve Jobs leaving .. I can’t help but feel sad.

I believe this is for one reason in particular: very, very few CEOs actually have a vision and follow it through. Or have the (will)power to follow it through without being bent or influenced through challenges and oppositions by corporate and outside politics. Steve was able to retain all of the drive, dedication and willpower that you have when you just start out as a company or individual trying to make a really great product that you believe in and want to be proud of.

Most large companies are simply unable to create such products because too many people work on each product, and there’s lots of money and risk involved in the process which, more often than not, turns potentially great companies into conservative, boring companies making lackluster products, following consumer trends. Apple under Steve Jobs has been the exception. Steve has repeatedly anticipated consumer trends, even created them through the power that is the Apple brand.

The really, really sad part however is what hasn’t been said. Steve being unable to meet his duties paints a grim outlook on his health. Not mentioning his health in his letter and Apple’s press release even more so. I just wish for him that it’s not as bad as one can imagine it to be if it forces someone of Steve’s caliber to resign from his position. Good luck and all the best, Steve!

Dropping Dead: OpenGL ES v1.x

On July 15, 2011, in cocos2d, Mobile Business, Technology, by Steffen Itterheim

Update: please find the iOS Device Sales Statistics for Q1 2012 here.

Currently Cocos2D is being overhauled for a v2.0 release. It will only support OpenGL ES 2.x and thus games made with Cocos2D v2.x will not run on 1st & 2nd generation devices (iPhone, iPhone 3G, iPod Touch 1 & 2).

The two development threads in the Cocos2D forum here and here are full of users expressing their disappointment (among other emotions/criticism) not to support a rendering core that supports both GL ES 1.x and 2.x. Even though it was said that if you still need to support all devices, you can simply continue to use the Cocos2D v1.x branch.

I’ve run some numbers and came to the following conclusion: if your game only supports OpenGL ES 2.x and comes out in Q1 2012, you will lose less than 10% of customers!

Here’s why I think OpenGL ES v1.x is currently in the process of dropping dead, and close to hitting the ground within the coming ~6 months.

iPhone Sales Statistics Q1 2011

Wikipedia has a nice list of iPhone sales statistics (totals) as they were reported by Apple each quarter. These statistics range from Q3 2007 to Q1 2011. Unfortunately, sales by Apple are not reported by device, so some quarterly sales are combined sales of iPhone 3G + iPhone 3GS respectively iPhone 3GS + iPhone 4.

I tried to extrapolate individual device sales by making the assumption that over time periods where two different iPhone devices were being sold, the newer one was likely to have sold more. Since we’re talking about Apple I choose a 70/30 split, meaning I assumed that 70% of the sales were for the newer device. This seems about right since newer devices have always sold better than the previous generation, but also according to some developer statistics.

For example the Bump developers reporting an iOS 4 adoption rate of 90% in January 2011 across all iOS devices (1st generation devices can not install iOS 4). Or the Surgeworks iOS 4 Adoption report which contains usage statistics of 1st generation device users of only 2.5% for one app, and 5% iPhone 3G users for another app.

The left side of the following pie charts shows the total number of iPhone devices sold to that date, with sales periods of two devices combined. The pie charts on the right show the extrapolated sales statistics for individual iPhone device generations, and which OpenGL ES version they support.

Download the Excel sheet I used to create these charts:

Notice how in Q1 2010 about two third of all iPhone devices supported only OpenGL ES 1.x, but within a year the picture turned just the other way. In Q1 2011 two thirds of iPhone devices sold were capable of running OpenGL ES 2.x code!

This has a lot to do with two factors: the iPhone 4 sold like crazy, whereas the last OpenGL ES 1.1 iPhone being sold (iPhone 3G) was discontinued in June 2010. Meaning since Q3 2010 Apple does no longer sell OpenGL ES 1.1 iPhone devices. And OpenGL ES 1.1 iPod Touches stopped selling in Q4 2010 as well.

All iOS Device Sales Statistics Q2 2011

According to Unwired, Apple reported to have sold 200 million iOS Devices during the iOS 5 announcement. 25 Million of those were iPads. These are the most up to date sales stats, which I assume to be the Q2 2011 statistics.

Based on Wikipedia’s numbers which states 83 Mio. iPhone devices sold vs. over 60 Mio. iPod Touch devices sold, the remaining 175 Mio. should be 42% iPod Touch (74 Mio) and 58% iPhone (102 Mio).

The percentage of OpenGL ES 2.x capable iPhone devices to those only supporting OpenGL ES 1.1 was 31% in Q1 2010 and jumped to 64% in Q1 2011. Assuming the 1.1 to 2.x ratio is the same for iPod Touch, that gives us 137 Mio iOS devices (iPhone, iPod Touch, iPad) with OpenGL ES 2.x capability versus 63 Mio devices (1st & 2nd generation iPhone / iPod Touch) which don’t support 2.x.

This pie chart includes all iOS Devices and which OpenGL ES version they support:

That means 70% of all iOS devices sold to date support OpenGL ES 2.x. This leaves us with only 30% of iOS devices not capable of running OpenGL ES 2.x code.

I don’t want to lose 30% of my customers!

You won’t!

Keep in mind that these statistics are only about devices sold. They do not reflect what has happened to these devices since, or how they are being used today.

I can also assert that older devices are disappearing fast from the market. Even though 30% of the devices sold support only OpenGL ES 1.1, your potential customer base will be significantly less than the number of devices sold. This is for a variety of reasons:

  • device has been lost or was stolen
  • device broken beyond use/repair
  • device simply no longer in use
  • device owned by a person who is unlikely to buy new apps

Particularly the last item must be considered: the device user. Again, the user is your potential customer, not the device. And in general all of these items are more likely to happen the older the device is.

One commenter in one of the two GL ES 2.0 threads on the Cocos2D forum reported how happy users were to see a game running smoothly on their 1st generation devices. For me that is not proof that support for older devices is beneficial. To the contrary, I think it clearly shows us that old generation device users are much more selective about their purchases, are already giving up their love for their devices, and may be considering an upgrade because they may have stopped enjoying their devices. This contributes to the “less likely to buy new apps” factor.

You can also assume that users of older devices have less expendable income, or are satisfied with the device as it is. If a user is actually happy with an old iOS device, it’s likely that person prefers to use apps and plays few(er) games or just keeps using the apps & games already owned.

The number of potential customers you would lose – if you released an OpenGL ES 2.0 game right now – is maybe around 10% to 20% at most. Far less if your game is complex and visually rich, and would suffer some performance or visual degradation on older devices anyway.

What about the near future? (Q1 2012)

Considering that 6 months from now, in Q1 2012, we will have seen the release of new iPhone devices (iPhone 5, possibly iPod 5) and thus another boom in sales, it is a better deal to start making some cool visual effects with shaders that look great on iPhone 4 and 5 rather than trying to still support 1st and 2nd generation devices.

In particular if you need to put in some (or a lot of) effort to support the older devices, for example if you have to optimize the performance, reduce the feature set (eg no or limited Game Center support) or (god forbid) you need to ensure compatibility with iOS 3.0.1 or lower (CADisplayLink unavailable!). That time and effort are better spent on making a better OpenGL ES 2.x game!

Obviously the decision also depends on how visually rich your game is going to be and whether you can expect to run into performance and other issues on older devices anyhow.

Summary

I fully expect the market share of OpenGL ES 1.1 devices sold to drop to around 20% by Q1 2012. That puts the number of potential customers (for game developers) still using those devices and buying games to certainly much less than 10%. Then consider that the iPhone 5 may even already account for up to 5% (~10 Mio) of all iOS devices sold by Q1 2012.

By the end of 2012 the potential customer base (for game developers) still using 1st and 2nd generation devices will have become entirely negligible.

That means, if you start developing an OpenGL ES 2.x game within the next 3 months, and your game takes 3+ months to complete, you will lose very few customers by only supporting 3rd generation and newer devices. And you may actually be able to win more customers by cleverly supporting the new devices!

I think it’s wise to start using Cocos2D v2.0 as soon as it is production-ready, which may be in around 3-6 months according to the comments and current progress.

Game On, Cocos2D 2.x!

Kobold2D: Cocos3D Project Template

On June 25, 2011, in cocos2d, cocos3d, Kobold2D, by Steffen Itterheim

Today I completed the first draft of the Kobold2D chapter which will be in the second edition of the Learn Cocos2D book. In that chapter I’m also giving you an introduction to cocos3d, the official 3D add-on library for cocos2d. I ported cocos3d’s Xcode project template to Kobold2D and spiced it up a little with some cocos2d nodes in the back- and foreground:

Notice the “incoming network connection” warning. This is caused by the iSimulate library which is distributed with Kobold2D and activated by default for Simulator builds. You still need to buy the iSimulate App to benefit from it though. If you don’t you can also choose to ignore the dialog or simply disable iSimulate by commenting out a line in the project’s BuildSettings-iOS.xcconfig file.

I’ve also had great fun with the augmented reality option that the cocos3d CCNodeController class provides. And setting it up is one line of code. Here’s the “camera as live background” demo in action:

Since a picture doesn’t really do it justice, here’s a video:

Admittedly it could run a little faster on my iPhone 3G. It’s pretty taxed and averages around 20 fps with the camera background view and rendering a 3D model. My iPod Touch 4 averages at around 40 fps and it feels a lot smoother.

Kobold2D Todo List

One of the biggest items on my todo list for Kobold2D is to design the website and get rid of the “coming soon” page. This includes setting up the wiki and filling it with content, documentation for the most part. And, well, paying $150 each month because I don’t see any alternative to using Confluence. I want to enjoy working on documentation, and I want you to enjoy browsing and reading it.

I also want to create more template projects. Currently, as you can see in the first screenshot, there’s Hello Kobold2D (iOS & Mac), Hello Cocos3D (iOS) and Hello Cocos2D-X (iOS). I want to add two more templates, one for Chipmunk with SpaceManager (iOS & Mac) and one for Box2D (iOS & Mac). I also want to add the projects from my book as project templates, namely Doodle Drop, the Shoot ’em Up game, the Orthogonal and the Isometric Tilemap projects, and the Cocos2D With UIKit project (all iOS).

Even though Kobold2D won’t have Xcode 4 Project Templates I still want to give you a quick and easy way start a new project based on one of the template projects. Notice the distinction between “project template” (those in Xcode’s New Project dialog) and “template project” (a regular, already existing project). I started writing a tool that allows you to create a copy of an existing Kobold2D template project and rename it, so that the workflow is just as convenient as doing it within Xcode. It works for the specific template I tested it with, but I still have to design the user interface and make the code fail-safe.

In case you wonder why Kobold2D won’t have Xcode Project Templates: they are not nearly as powerful as they would have to be. And they’re a pain in the rear to create and maintain without some tool support. But worst of all, you have no way of including files in an Xcode 4 project template that must not be added to the Project Navigator. Like, for example, .xcodeproj files.

Kobold2D Meets Cocos2D-X

On June 17, 2011, in cocos2d, Kobold2D, by Steffen Itterheim

Kobold2D is well and alive. Actually so much so that I thought: “Hey, it’s crazy, but maybe not … I’ll give it a shot and see how far I get.”

The thought was to try and add the cocos2d-x engine (cocos2d in C++) together with the Hello World example project to the Kobold2D workspace. The result: it took about 90 minutes, most of that figuring out the correct build settings and header search paths. And it just worked.

Surprise! 😀

Right now this is just the iOS version. A cocos2d-x Mac project will be added as soon as the Mac platform is officially supported by cocos2d-x (or does it already and I missed that?). Then developers would have the choice between using either Objective-C or C++ as the primary language for developing their iOS & Mac OS X games.

It also made me think: “Hey, there’s this other open source 2d game engine … hmmm….” :)

Tagged with:  

This one is for the “techies” among you who would like to know about low-level performance specs of the iOS devices. Maybe you’ve heard of Mike Ash before? He’s a Mac programmer who writes about his profession on a weekly basis and Mike’s development blog is well worth browsing for highly interesting material. Back in March 2008 he published one of the first iPhone performance comparison for common operations.

Stuart Carnie then took this performance comparison and updated it with results for iPhone 4 and iPad, and published them in his Micro-Benchmarking blog post along with the source code. If you’re interested to learn how long it takes to perform a floating point division or a 1 MB memcopy across several iOS devices, these are the tests you were looking for.

Page 2 of 212