What is Kobold2D?
It’s the Ultimate Cocos2D Project, of course. Or more precisely, the official name for it. Right now, the website www.kobold2.com is only a “coming soon” page while development is under way.
What’s in a name?
Calling it “The Ultimate Cocos2D Project” all the time would have become tedious rather quickly. I wanted a name that is reminiscent of Cocos2D yet completely different. As luck would have it, I’ve recently watched a lot of Battlestar Galactica episodes. You might remember that in this show humanity’s home planet is called Kobol. I couldn’t help but think of COBOL all the time.
From there it was a small step to Kobold, which in germany is widely associated with a famous cartoon Kobold called Pumuckl. As a kid, I was a big fan of Pumuckl, so picking Kobold2D as the name was a no brainer. Even more so since it has the same ring to it than Cocos2D.
Why create a new brand name?
For one, giving the project a name of its own clearly makes it more attractive. It expresses a certain dedication to the project. It should also signal that it’s no longer just about Cocos2D. With all those extra libraries and additional glue code, plus an experimental project I’m working on, I’m tempted to call it a Game Development Kit (GDK). That’s the long term vision for Kobold2D: more power, easier - for everyone!
Speaking of long term, that’s another reason to give it its own brand name. The visionary thought being that ultimately, something like Kobold2D could be implemented for other game engines as well, with the same core values: give the developers more power, greater flexibility but at the same time make it easier for them to get started.
The Kobold Team
I’m not the only developer who is aching for a more professional work environment. Kobold2D is a joint-venture with another senior software developer and a couple helping hands who help out wherever and whenever they can. We agreed to share the development burden on a voluntary basis. We all have different stakes and interests in the development of Kobold2D.
For me personally the most important aspect is my ambition to develop a project for its users, both professional and casual. I know I can build professional systems that are easy to use, well documented and thus get the job done painlessly. This basically sums up what I’ve been doing for the past 10 years.
What we’re not doing …
There’s one issue I think i going to come up, which might confuse some people, so I want to be clear about this: we are not creating a branch of Cocos2D. We have no intention to do so. We use the library as is, and we stick to the stable builds. The same goes for all other libraries of course.
At the same time, we don’t push each and every line of our additional code back or even contribute to the development of the libraries in Kobold2D. That’s not what we set out to do, and we simply don’t want to spend too much time consulting with and compromising on changes with others when our code is already there and working for us. Our code uses the MIT License, so it’s there for the taking.
In very few cases we can’t get around to modify library code. We only do this where necessary, for example if it breaks our build and the fix is rather simple. Other than that, if a library doesn’t work to our satisfaction, we try to add our fixes and improvements on top, either by subclassing or by making use of Objective-C categories. So far this has been working very well and allows us to keep updating the underlying libraries with far fewer hassles.
Next steps
One big task that I set myself out to complete before continuing with Kobold2D is figuring out the Xcode 4 template format for File Templates and Project Templates. I almost have everything together after spending practically the whole week on it. I’m also documenting all my findings and I’m going to publish the Xcode 4 Template Tutorial / Reference / Documentation / Manual (not sure about the name yet) by the end of the month.
The goal for Kobold2D is to have various project templates, which is why I’m doing extensive research on the new Xcode 4 template format. Unfortunately at the moment it seems that it will not work satisfactory with cross-referenced Xcode projects, but I remain positive that I can find a solution.
Kobold2D private beta!
There will also be a private beta test for Kobold2D starting in a couple weeks (couple == definitely more than 2 weeks). Reply to the private beta sign-up thread if you want a chance to be picked for the private beta test.
I almost forgot about the Cocos2D-Project on github. While it works flawlessly with the latest v0.99.5 stable release of Cocos2D, it was still bundled with only the RC1 (release candidate). So I’ve updated the cocos2d version in the repository.
In case you don’t know what Cocos2D-Project is:
Cocos2D-Project is a great way to start any Cocos2D-iPhone based project.
It eases up- and downgrading the Cocos2D game engine at any time. It includes additional source code as well as multiple targets and build configurations for Ad Hoc & App Store distribution (creates the necessary IPA/ZIP files) and debugging of memory leaks and related issues.
Cocos2D-Project is free, open-source, uses the MIT License and comes already bundled with the cocos2d-iphone version that it currently works with “out of the box”.
It’s not affiliated with or endorsed by cocos2d-iphone.org and Ricardo Quesada. You will get support for Cocos2D-Project on Cocos2D Central.
Future updates
With the help of others, the Cocos2D-Project development has taken on a life of its own. The current work in progress is much more than a simple Xcode project referencing just the Cocos2D game engine. I’m looking forward to announce a big update in a couple weeks. Stay tuned.
You can get Kobold2D from www.kobold2d.com which is an easy to use wrapper (and installer) for cocos2d and related libraries plus many example projects. If you want to support development of the new, modernized version of Kobold2D then please consider joining KoboldTouch.
Installing Cocos2D Xcode Templates
If all you want to do is to install one of the latest cocos2d version’s Xcode templates, type this in a Terminal window:
First, change to the cocos2d-iphone directory using the cd command, for example if you unpacked cocos2d to ~/Documents the command would be:
1 |
cd ~/Documents/cocos2d-iphone-2.0 |
Then run the Xcode templates installer script, -f forces overwrite of any existing cocos2d templates:
1 |
./install-templates.sh -f |
You can find more details in my blog post about enabling ARC in a cocos2d project.
If you’re new to cocos2d or Objective-C programming, make sure you enable ARC in all your projects! Not using ARC will be a painful experience, it makes it harder to write correct Objective-C code, it will slow you down, it might even demotivate you. Use nothing but ARC. Please. I still see way too many cocos2d related questions on stackoverflow.com which would not be an issue if the users had simply enabled ARC.
My Cocos2D Xcode project is now on Github. Open-source, free, properly MIT Licensed, includes the rootViewController and supports Cocos2D v0.99.5 rc0.
I’m also working on (with) a greatly enhanced version of the Xcode project. It integrates wax (Lua) and a Game Object Component System that i termed “gocos”. Also comes with a lot more useful convenience classes.
But the big idea is to actually upload (or link within github, if I can figure out if and how that works) all dependent projects into one repository, so that you can download everything at once and it works out of the box. Currently there are 3 projects referenced by cocos2d-project: gocos (let’s call it a library of convenience and gameplay code for Cocos2D), wax (Lua support) and obviously cocos2d-iphone. So everything that’s needed is going to be bundled in one big package, which voids all of the version incompatibility issues.
You can still experiment with different versions of these libraries but in that case I think you know what you’re doing and that issues are to be expected. But being a github repository, you can of course clone and commit changes.
Appetizer
Here’s what I’ve done with Lua. I’m currently using it only as a better plist replacement for settings. It’s better than plist because you can comment on each item, you can sort them easily, you can run functions and algorithms to generate values or load additional data, and in general it’s a lot easier to work with than the plist editor. Here’s a reduced config.lua that is loaded at runtime into a hierarchy of NSDictionary objects:
[cc lang=”lua”]
local config =
{
AccelerometerControls =
{
UpdatesPerSecond = 60, — 60 Hz
Responsiveness = 0.997,
SensitivityX = -2,
SensitivityY = 2,
MaxVelocity = 100,
},
}
return config
[/cc]
And this line of code loads these values and assigns them to the correspondingly named properties of the target class:
[cc lang=”objc”]
[Config loadPropertiesFromKeyPath:@”AccelerometerControls” target:self];
[/cc]
That’s all you need to do to transfer the values from config.lua into a class instance. Huge timesaver! The only drawback is that it currently can’t differentiate between float, int and bool (due to NSNumber), so it currently only supports float properties.
Due to a number of breaking changes in the recent Cocos2D beta versions, including the rename of the Cocos2D project to cocos2d-ios.xcodeproj, I’ve made an update to my Xcode project. You know, the one from this tutorial that allows you to keep Cocos2D completely seperate from your own code, which in turn enables you to easily and safely up- and downgrade Cocos2D by merely replacing the Cocos2D folder.
So now it also works with Cocos2D and here is the download:
Download the Xcode Project (Cocos2D v0.99.5 beta 3 and later)
What you have to do to upgrade the project, in case you already started a project with my older Xcode template but would like to upgrade to Cocos2D v0.99.5 beta 3:
- remove the cocos2d-iphone project from your Xcode project
- follow these instructions from Select the Project itself up to and including Drag & Drop Libraries to Target
- (don’t forget to repeat the instructions for all targets you’re using, not just the current one)
- clean all targets and build
Note: depending on the iOS SDK version you’re on, you may have to Get Info on the Xcode project as well as the cocos2d-ios project and on the General tab set the Base SDK to iOS 4.x, then close and re-open the project (Xcode should update the SDK version immediately but sometimes it doesn’t).
If you plan to use Cocos2D v0.99.4 then the Xcode project supporting this Cocos2D version is still available here.