Building The Ultimate Cocos2D Project

On February 25, 2011, in Kobold2D, by Steffen Itterheim

The Ultimate Cocos2D Project is: Kobold2D!

Put simply: Kobold2D is designed to make Cocos2D developers more productive.

Original Post

First Friday update after the teaser post. I’m working on a new project. I’m still fleshing out the details of the “killer-feature” and making tests, so I can’t really talk about that. But I can tell you what I have already up and running.

The Ancestor: cocos2d-project

You may remember the Xcode Cocos2D project tutorial I wrote almost a year ago. The goal of that was to use Cocos2D as an external library in order to be able to update Cocos2D simply by pulling a new version from git, or just by replacing the Cocos2D folder. I gave the resulting project a boring, uninteresting, generic name (so typical for a programmer): cocos2d-project.

The new and improved cocos2d-project not only has a spiffy name (to be announced) but also raises the bar not one but two or maybe even three levels, depending on perceived value. It’s definitely leaps and bounds ahead of the Cocos2D distribution project, especially if you care for how source code projects should be composed.

One Xcode project for both iOS & Mac OS X Targets

One thing that really bothered me when Cocos2D became capable to build Mac OS X applications was that it required a separate Xcode project for each platform. If you’ve ever done cross-platform development you know this isn’t going to make you happy. Every action needs to be done twice, add a resource in one project, then you must also add it in the other. Change a build setting in one project, also change it in the other. Build and run in one project, then build and run the other project with a completely different window layout and probably duplicating all the floating windows aka “Is that the Mac OS debugger or is it the one for the iOS project?”. You name it.

I did some research, then a test, and It turns out: it’s entirely possible to target both the Mac OS X and iOS platform from within the same Xcode project. It works like a charm!

Really the only thing you need to keep in mind is that Xcode doesn’t give you the option to change the Active SDK by default. But if you click the Overview dropdown while holding down the Option key, you can select any SDK that’s installed on your system (see the image). The key here is to first change the Active Target to the Mac target, then Option-Click again and select Mac OS X 10.6 as the Active SDK. And the other way around to change back to iOS. So it’s a two step process but still way more comfortable than managing two seperate Xcode projects.

XCConfig Build Configuration

Behind the scenes there’s an additional step required to make this work, which I’ve been wanting to do for a long time: to use XCConfig files for build settings. Cocoaphony has a blog post Abandoning the Build Panel describing the technique. The good part is: there’s less confusion between project-wide and target-specific build settings. Even more importantly, if you build several different libraries you want to build them with the exact same settings – with XCConfig files this is easy to do, manually changing the build settings of several projects with multiple targets simply isn’t practical.

Plus you can document each setting and you can still use the Build Settings Panel for your own needs while allowing me to use system-critical changes to the Build Settings. For example, if a certain build setting causes issues (eg like the switch to LLVM GCC) then I can change the setting and release a new version of the project, or just the build config file separately. You can then replace that file and it should fix the build (assuming you haven’t change that exact setting in the Build Panel). All of your customized Build Settings will remain untouched of course.

Those are only two very fundamental improvements on a system engineering level which probably won’t excite you too much if you focus on making games with any means necessary. I’m keeping the good stuff for a future update, hopefully in 3 to 4 weeks I’ll be able to give you some first details about the “killer-feature”. :)

A Teaser

On February 22, 2011, in Announcements, by Steffen Itterheim

I’m sorry for having been so absent lately. It just so happened that a couple events lead to taking some time off away from my computer, and then I realized how much I actually enjoyed not being at my computer all day long. Respectively how little motivation I had to go back to what I was used to doing because something was off, didn’t feel quite right. So I took some time off away from almost everything computer-ish, and started recreating and pondering.

Eventually I realized I was missing something:

  • a bigger-than-life goal
  • an actual, meaningful, worthwhile project that serves this goal

Once I had this realization, finding the right goal was easy:

The Goal

I want to create something new that will have a lasting impact on how we make games.

Nothing less. I could be more specific but I’m not willing to give that away yet.

The Project

I know exactly what I’m going to have to do but you’ll have to bear with me on the details – I’m just starting. Everything seems to have fallen in place and became so obvious. In fact, I’ve done it many times over in my professional career. What I’m now working on will enable you to make games faster and with fewer technical issues. It will trade performance and complexity for rapid development and ease of use.

I can’t stand it anymore

Quite frankly, I die a little every day I see nothing done to improve the miserable state new and inexperienced game developers face when they are starting out with Cocos2D. I am furious when I see that something as essential as the API reference isn’t even complete, and either no one but me notices or no one cares to mention it. Cocos2D is neglected in areas that I consider to be more important than the source code itself.

Cocos2D will soon support OpenGL ES 2.0 and shaders. That’s fine for some people and great news for a select few who actually know how to leverage the GL ES 2.0 features. However, I know in my heart this will only cause more headaches and frustration for the majority of users because for them more options only means they’re going to face more issues they don’t understand fully, which they can’t solve by themselves. Yet they’ll be tinkering with it because new technical toys are just too damn cool. But in the end it will only keep them from finishing their games. I’m much more concerned with fixing the recurring issues the majority of users are having. And helping them getting their games finished and out there.

I can’t change how Cocos2D is developed and how decisions are made. So I’m starting my own project to change the landscape, to raise the bar and set expectations to a level that satisfies the professional software engineer in me. I’ll stop trying to crack tough coconuts for you, instead I’ll lead you to new and greener pastures where the fruits are hanging low and have much softer shells. Poetically speaking. :)

My project will not be for everyone, but even for the seasoned developers there’s going to be something worthwhile in it. And you won’t have to give up on Cocos2D completely because even I will only slowly transition away from it.

When? What? Where? Etc.

The specifics of this project will be announced in due time. Just like I did with the book I’ll write a weekly, Friday-ish update post about recent developments and revealing new features. Also I will share with you my insights and thought processes and my approach to software development and what I’ve learned.

These posts serve an important purpose: by making public announcements, by writing down my goals and committing to them publicly, and by recording achievements my motivation will remain high, and I will keep enjoying what I’m doing. It also allows me to kick myself in the butt if I have to because I can’t possibly let you down. This will keep me going and will have me striving for nothing but excellence.

In the coming weeks and at least during the initial development phase I will focus almost all of my time on either project development, or recreation away from my computer. I will also try my best to avoid any and all distractions like forums, Twitter, email, unnecessary research, funny videos and generally just wasting time. If the past few weeks were any indication I will be harder to reach and even slower to communicate with. I will not be able to respond to every personal message because I need to focus my attention on the task at hand, or living my life as a crucial counter-weight. I will focus my attention more on speaking to the overall community via my Blog, Twitter and the planned Cocos2D Podcast with Mohammad Azam.

Watch this space for more info, and definitely join my Newsletter and follow me on Twitter.

I would like to preemptively thank you for your outstanding display of collaborative patience!

I’m off to building a better future! :)