Whaaaaaat?
You heard right: if you want to forget about using retain, release and autorelease in your code, then the newly introduced automatic reference counting (ARC) mechanism (aka “automatic memory management”) is the way to go. And guess what?
Kobold2D Preview 6 fully supports ARC out of the box!
You may have heard that Cocos2D is incompatible with ARC at this time, and you’re right. However, the Cocos2D version in Kobold2D Preview 6 released just now has been improved to work with ARC. This post explains the most important changes to make Cocos2D compatible with ARC. All 15 Kobold2D example projects compile with and without ARC, just like the other libraries Kobold2D makes use of!
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)
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
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!
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.
As promised a while ago my Xcode 4 Template Documentation efforts have finally produced a result. Please refer to the product page for more information.
I’ve put in roughly 70 hours. Might have been even more, I didn’t keep track. I would appreciate your support by purchasing the documentation!
I also checked again if any new source of information on Xcode 4 Templates has come up, but couldn’t find any new sources. As of today and roughly 4 weeks after I started with my Xcode 4 documentation endeavour, there’s still very little documentation about Xcode 4 templates on the net. The following are the only external sources I referred to:
- Minimal Project Template with example
- List of replacement placeholder strings
- Solution on how to place files in subgroups
The marketing dude in my mind tells me I should probably mention that the information you get from the above links is just a fraction of what you’ll find in my Xcode 4 Template documentation.
Happy Easter!
Or to be politically correct: Happy Holidays!
What you’ll get in bulletpoints:
- Five tutorials on how to create File and Project templates
- Extensive reference for all known TemplateInfo.plist items (keys) and settings
- Explanation of the placeholders (eg ___FILENAME___) and variables (eg ___*___)
- Frequently Asked Questions answered
- Many tips and tricks
- Total of 70 pages of documentation (PDF) from 70+ hours of experimentation
- File and Project Template example files
Synopsis
This unofficial but comprehensive Xcode 4 Template documentation explains how to create File and Project Templates for Xcode 4. Xcode 4 uses a template format significantly different from the one used in Xcode 3, which renders all previous information on Template creation useless. The new format is also much more complex and allows for greater flexibility, for example a template can now consist of multiple inherited templates.
This Xcode 4 Template documentation first gives you a quick overview what File and Project templates are. Step-by-step tutorials show you how to create your own File and Project Templates. In the reference section the format of the TemplateInfo.plist and related files are meticulously documented. Finally there’s the Frequently Asked Questions (FAQ) section with answers to common questions. The documentation is fully hyperlinked so that you can quickly look up keywords in the reference section. Several example files for File and Project Templates help you get started and can be used as the basis for your own templates.
Available for free
The documentation is now available for free:
Download Xcode 4 Template Documentation (ZIP, 6 MB)
Disclaimers
This is not official documentation. I can not guarantee that the documentation is 100% correct, much of the information was found out through lots of trial and error. Nevertheless this documentation contains a lot more information than what is currently available on the Internet.
THE DOCUMENTATION IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE DOCUMENTATION OR THE USE OR OTHER DEALINGS IN THE DOCUMENTATION.
Today I tweeted:
“How to be efficient? Don’t try to master the art of perfection.”
That seems to have caught some attention. I must admit it wasn’t entirely devoid of any meaning to my work. For all the time when I was an actual employee and someone else was paying me to do a certain job within a specified time frame as good as possible, it remained an elusive notion that one day, you want to do a job “right” for once. Because there’s always either time or budget cutting into what’s possible or worse what’s reasonable.
I always considered myself to be a pragmatic, and while I liked the notion of one day doing one’s work as good as one possibly can - a mantra some of my colleagues were more keen than others to repeat - I accepted that it would never happen. That was until I became responsible for my own work and financials. I recently started digging into the Xcode 4 Template system, at first out of interest and requirements for the Kobold2D project, and then to make quality documentation for the new Xcode 4 template system. I think that was about 3 weeks ago now, and recently I noticed I’m not going very far, I keep finding the roadblocks and dead ends and generally quirks and issues which end up in countless of hours doing nothing but trial & error with little results to show for.
And there I was, fighting with myself trying to figure it all out - I mean literally everything. And it was getting harder to finish the job because it became more and more demotivating not being able to find a good (or even a working) solution to my problem.
How not to get the job done, after it’s done
I fell to the elusive thought of documenting the Xcode 4 template system perfectly. I couldn’t succeed because almost by definition you can’t perfectly document a system that is in itself imperfect, flawed, incomplete and merely designed to be used for the things it is used for, no more no less. It’s not even designed to be used by others, or it would have been documented by Apple. I now have a very good understanding of why it was never documented, it just makes sense. My suspicion is that they don’t even edit the templates manually but instead rely on tools to do most of this job. And there seem to be a couple bad hacks in there too.
I had to accept that I’ll have to look for other ways for Kobold2D users to start new projects because of several technical limitations of the Xcode 4 template system: it can’t deal with cross-referenced projects and it’s unbearable for projects with hundreds of files. One of the important goals for Kobold2D was to provide a variety of meaningful, working project templates. Very simple demo games. They’ll have to be created somehow, and sadly I had to come to terms that this won’t be possible within Xcode (4) and has to be done through some other means (and ideally not manually).
Trying to find a solution for Kobold2D project templates kept me working on the documentation even though I should have realized that I have already documented way more than what most people would need for their file and project templates. I couldn’t stop looking for a Project Template solution for Kobold2D, it seemed so close and other solutions so far - so I didn’t even spend time considering those other solutions. Awww, the horror of working alone. No one to kick your butt in the right direction, away from perfection and towards getting the job done.
Decision
So today I decided that I’ll wrap up the Xcode 4 Template documentation I have so far, which is quite a lot nevertheless (currently 57 pages as PDF), and then start selling the document for $10 instead of $15 because it’s not as complete as I intended it to be. Watch for it in the next few days. I’ll let you know.
Xcode 4 Template Documentation
UPDATE:
You can get the Xcode 4 Template Documentation here!
The Xcode 4 Template Documentation has grown to nearly 40 pages (PDF) now, with only a few images and just reference material. The reference materials are nearly complete, including placeholders, variables and explanations for the use of every key available for Xcode 4 templates and a FAQ section. I still have to add the step-by-step tutorials (including example templates) for creating your own File Templates and Project Templates, and final proof reading and corrections.
Because the Xcode 4 Template Documentation has grown so big and I’ve already invested 50+ hours in it I want to try an experiment to see if creating documentation at this level of detail is sustainable. I’ll charge a small fee for access to the document, the standard price will be $15 and I’ll start selling it at an introductory price for a short period of time.
If this works out well in terms of revenue vs time investment I will likely offer more such in-depth documentation in the future. I was thinking that 50+ sales per month at $15 is a reasonable goal, and at this rate it would certainly be a welcome incentive for writing more documentation - next to me being generally inquisitive and interested in digesting challenging and diverse subjects.
I think the success of my book also ought to tell me that I can provide such in-depth treatments of game development topics. There’s certainly a lot of need for documentation on Cocos2D in general, but also there’s a big gap in general between what online documentation and tutorials offer (which often are only written for absolute beginners and/or to capture search engine traffic) versus the need of developers to learn more about a challenging niche subject in detail, including hard facts, recommendations, tips and tricks.
Cocos2D Podcast: coming soon …
Mohammad Azam aka @azamsharp recently approached me with the idea of creating a Cocos2D Podcast series. Azam has a lot of experience with creating podcasts and screencasts for the .NET crowd, and he has been a Cocos2D developer for about 6 months now with 4 kids apps already published to the App Store.
Two weeks ago we had a first dry run using Skype and liked the results, so we’re ready to record our first podcast this weekend if nothing gets in the way. I’m excited to try and see where we can take the Cocos2D Podcast and how you will like it.
The first podcast will be an introduction about ourselves and how we ended up working with Cocos2D, before we move on to trending topics in the Cocos2D space. If you have a suggestion for what we should discuss, or if you have a particular question that you like to get answered, please let me know (write a comment).
An apology
Lastly I wanted to apologize for missing last week’s update and not having much to report on this week. I was sick with a bad cold for the last ~10 days so nothing much happened in terms of Kobold2D or the Xcode 4 Template documentation. I’m still working on both of course.
I’m also responding to fewer and fewer emails, comments and forum posts as I’m getting swamped with them while spending a lot of time on other tasks. I realized I have to face the fact that as I gain popularity (much of it thanks to my book) I can no longer tend to everyone. Instead I’ll focus on listening in and providing value for a greater number of developers rather than responding to individual request. I’m sorry and I hope you understand.