A couple months ago I wrote a tutorial explaining how to upgrade Cocos2D in an existing project.
I was able to cut the description down to only five concrete steps, but there’s still a lot of text to follow and caveats to consider. I designed Kobold2D exactly to make it easy to solve the issue of upgrading projects to newer versions of the game engine.
The Goal
Kobold2D users should never have to run a bash script, ever. Any project or asset management task most users will want to perform should be done with a visual tool.
The Problem
I mentioned before that I had problems turning the Kobold2D project templates into the Xcode 4 Project Template format. In fact, it turned out to be impossible due to the nature of Kobold2D’s workspace setup.
Since I want to have a wide variety of project templates in Kobold2D, and definitely more than the three rudimentary templates that cocos2d-iphone offers, I needed some way to allow users to start new projects based on a template.
The Solution
What I came up with is the Kobold2D Project Starter Tool:
Simple and elegant. This tool scans the projects in Kobold2D templates folder, which are regular Xcode projects with a common naming scheme (eg. _Hello-Kobold2D-Template_), and presents them to the user including a description.
Select a project template, give it a name and click Create. The tool will copy the template project to the Kobold2D folder next to all the other projects. All occurrences of _XXXX-Template_ are renamed to the user supplied project name (which is cleaned to remove illegal characters). Then the project is added to the Kobold2D.xcworkspace which the tool will open right away.
The Benefits
I think the biggest benefit by far is that anyone can turn his or her Xcode project into a template, simply by following the naming scheme. Anyone can create and distribute their own Kobold2D project templates.
Note: in the screenshot there are only 7 templates listed. I’ll definitely add more for the Kobold2D v1.0 release, most will be based on projects discussed in my Learn Cocos2D book. The first preview version (v0.9x) of Kobold2D will be available in about two weeks.
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….”