A marketing oversight on my part …

On August 26, 2010, in Marketing, Speaking From Experience, by Steffen Itterheim

I noticed that most of my recent posts revolve around the cocos2d book. It’s so very easy to forget one’s online presence while you’re frantically working on projects. I’ve seen it countless times and I don’t want to fall into the same trap. That is: create, create, create and then: announce. Boom. No one’s interested anymore. Everyone moved on. You lost your share of the Internet attention span. That certainly would be a shame because besides the book, I was working on other things over the past two months and I’m looking forward to making an announcement in the coming months. I think it will strike a similar nerve than the cocos2d book did. But it’s not limited to cocos2d, so it’ll get its own website, that much I can say. And yes, I love to tease. :)

I think programmers are especially prone to making the mistake of neglecting their online presence, their virtual alter ego that lives on the Internet 24/7. It’s all too easy to become deeply engrossed with what you’re working on, particularly if it’s a very technical thing. Once you’re done you get a burst of satisfaction and then you’re looking for the next fix which of course is spending more time on the project. In the meantime everyone else around you, and on the Internet that means blog readers, are wondering what you’re up to. If it goes on for a while without actually producing something, readers will stop wondering and start not caring anymore.

Numerous times have I read that you need to start marketing as soon as you start creating. At least that’s true for Indie developers. And how many times have I seen people fail at this? All too frequently. Typical scenario: our game is done, now how do we go about the marketing? Your blog should be your marketing instrument from day one. The other negligence for marketing simply stems from a deeply rooted repulsion for promoting one’s efforts and products. I certainly feel that too but I manage to live with it because it helps me strike a balance. I could only make a sales pitch like this one if I was primarily in it for the money (sorry Matt, that’s the impression the site is giving me because it’s too close for comfort to Internet marketer sites).

Most blogs die before they have even started. It’s hard to get readers attention in the first place but I think it’s much harder not to lose them over time. I learned it’s finding the right mixture of blog posts that will create the most interest and attention to readers, a careful balance that one needs to strike. Let me explain the categories of blog posts which I think are valuable but, if not mixed in with other categories, may be too niche to keep readers coming back more often. Unless you explicitly target a tiny niche, in that case a focused approach works quite well.

Concrete Learning Posts

Bloggers who provide sample source code and solutions for a particular platform fall into this category. You write a small tutorial or just a quick fix for a particular technology issue. The good side is that it shows off skill (sometimes) and that you’re being helpful. The downside of these posts is that, especially in the case of Tutorials, they attract a great number of readers but few will stay or come back. Smaller code solutions and quick fixes often get reader’s attention only through google, they copy the code and are gone. The blogosphere is saturated with information everyone needs to learn, because most of us are still learning. What’s often missing are the really hardcore ideas. Take that example and it makes me wonder, could this work to get cocos2d nodes to support NSCoding just by applying this concept? I’d love to try but I don’t have any need for that and it’s on the roadmap anyway.

The problem with the smaller code snippet posts, as I see it, is that they are often only losely related. You may find just the right piece of information but the rest may be too straightforward and already known to you that you don’t give it much value. Posts like these better fit on Q&A sites like stackoverflow.com. Also, before posting those bits of wisdom it may be wise to check if that information isn’t ubiquitious. Chances are someone else came to the same solution months before you. Posting what others have posted numerous times before does devalue your blog. In that case prefer a post that sums up all the other great posts on the topic. That works so much better since you’ll be sharing your own research.

And definitely share your current development status. I love those work-in-progress posts. I’ll be writing more of these in the future.

Concrete Experience Posts

You may be surprised how interesting your (development) life’s experiences can be. About a year ago I started a german Spieleentwicklerveteranen (Game Development Veterans) Podcast, in which I simply told my experiences within the game industry. How games come to be, what life is like as a game developer, why people start working for a games company and which kind of experiences they may be going through, from good to bad. Just a very hands-on, personal opinion approach with a couple anecdotal stories. I only produced two episodes though, mostly due to lack of planning and because it’s not really that much fun to do a podcast without a regular, reliable partner. Yet to this day I frequently get emails asking me for the next podcast.

Readers love to read and hear about experiences for two reasons: either they are less experienced than you are, and get a glimpse at what it must be like to be at your level. Or they actually are at the same level than you are, and they can relate. Suddenly they’re not so alone anymore.

Recently I spoke to a former colleague of mine who set out to write his own game, I think he has all the necessary skills and he certainly had the motivation and drive to go through with it. But as time passes by, and he kept working all by himself and more often than he wanted to, faced serious technological challenges that hindered his game’s progress. Not being able to actually talk to like-minded people and getting tips from a range of professions, as we were both used to during our time at game development studios, can be a serious motivation killer. And you guessed it, he has no blog and not even a Twitter account.

For me, one thing to fight off incoming demotivational phases is to converse with the people out there and blog my experiences, at least once in a while. I like helping others answer their question because I know how it sucks to be stuck, I also learn valuable lessons from it and I feel good to be able to help or at least nudge developers in the right direction. It also leads me to think in different directions and helps connecting the dots, so that’s where the interesting experience stories are actually born. Wait a second, I was in the exact same spot back then …

I believe experiences, if they provide a meaningful resolution are the most valuable blog posts anyone could write. But those don’t come natural to most developers (or people in general – but I’m not saying that developers != people). So that’s a conundrum. We programmers love the DRY principle (if you don’t you’re not a programmer yet), but that doesn’t translate to blogging and even less to marketing. Like my Starterkit, I know I should mention it more often to make a decent number of sales over the coming months yet the programmer in me tells me that, oh well, those who’ll like it will find it regardless. Trust me, they don’t. I am tempted to mention it more often, at least on Twitter, and maybe give away some promo codes or get someone to write a review. But what to say about it? Look, it’s here. The same thing from last week. Oh great. Yeah, I think you get the picture. It’s really hard to REPEAT YOURSELF without becoming obnoxious. We all know the kind. Personally, I don’t follow Twitter accounts whose tweets mention their own product(s) about 50% of the time or more, unless they provide interesting insights into their work.

Ramblings aka Opinion Pieces

Everyone loves to have an opinion. It’s very easy, tempting and almost natural to start blogging with a lot of opinion pieces. I started in 2007 with my gaminghorror.net blog and almost all early posts were opinion pieces. I think that, unless you know exactly what you’re talking about and can construct a careful argument, that those kind of posts can easily backfire. Either you’re an expert and a critical thinker and you are able to dissect your thoughts into constructive opinion, or else you risk being regarded as a loudmouthed idiot who doesn’t know squat. There’s a fine line to walk. Certainly no one cares about whether you like a certain product or technology more than another, or yet another opinion on the same issue unless you can provide a new, fresh argument. But if you have an actual pet-peeve, something that comes from your heart and that just totally goes against everything you believe in, that’s what should become a great insightful blog post.

For example, one of my pet peeves is to fight off the Piracy Problem by saying it doesn’t really exist. Except in our minds. We don’t have a piracy problem, we have a perception problem. We just make ourselves believe that most of the time piracy is bad for business. There is a real threat but it has a much less impact than the piracy numbers lead us to believe once you factor in human behavior. For App developers it’s widely understood and appreciated that, once their App is free for a day, the downloads jump through the roof. Ten or even 100 times more downloads for free than at the $.79 price point. Yet when we consider piracy, we see great numbers exactly because the software is free yet we forget to consider that, if any pirated software would cost just $.79 the piracy numbers would drop at least ten-fold. I can’t prove it, but I sure as hell believe it because that’s how software piracy works. It’s not a market, it’s a movement that exists only because there is no money involved, set aside a few scrupulous industrial pirates.

Paul Graham puts it best in his essay What you can’t say. It’s the things that might (or will) get you in trouble which perhaps should, or must, be said. The ideas that people fear might be true. Like Galileo’s moving earth theory. Ridiculous, isn’t it?

Conclusion

So what am I saying, I forgot to market myself? Not quite, I’d rather see it as an invitation. By writing more blog posts and allowing anyone who is interested to literally “read my mind” I invite you to take part. And dozens of developers have taken this offer so far.

I get a lot of emails and I answer all of them, even if it takes me a couple days to get to each and every one of them. There are valuable exchanges of information and knowledge and some of that would be of a general interest. But because I spend the time writing to a single person I tend to write less blog posts to a greater audience. I make observations and find solutions all the time and learn from them. Some of that actually goes into the book as I’m writing it. But what I should do more is to let everyone in on more of my insights or simply what I’m up to.

When I look at this website from an outsider’s point of view, I see too much focus on the book right now. A few valuable posts in between but not enough for my taste. I have a tendency that, once I start writing, I write a lot. This is bad because it costs a lot of time and effort. So I avoid it too often. Yet, often times it’s the tiny pieces that can be just as important. Because your time is valuable, too!

Going forward I vouch to write at least one blog post per week that’s not about the cocos2d book, and may not even be about cocos2d specifically, like this post, but still generally interesting to iOS game developers of course.

I also need to write shorter posts. The sun is setting … again?!?! :o

Prefer Composition over Inheritance

On June 11, 2010, in Programming, Speaking From Experience, by Steffen Itterheim

When the question came up whether to subclass CCSprite or use some model class to build your game entity hierarchy in the cocos2d forum, i stressed that one should try not to use inheritance and keep the inheritance hierarchy to as few levels as possible. I’ve worked with codebases with hundreds of thousands of lines of code, and hundreds of different types of actors in the world. Yet the inheritance hierarchy was 2 super (parent) classes for almost all objects, only very few game objects had 3 or 4 super classes. How can you make complex games this way?

The answer lies in composition, often referred to as Game Components by engines like TorqueX and the PushButton Engine (a Flash game engine from the original Torque developers). This video from the PushButton lead developer Ben Garney explains it very well and also illustrates the problem with inheritance over-use in game engines. Something that most developers new to object-oriented and/or game programming do in fact tend to over-use – i blame that on poorly written books and other introductory OOP sources which emphasize inheritance without discussing its disadvantages.

You can read more about PushButton’s Components system in their documentation. How they implemented Components in TorqueX and what the differences are to XNA Game Components further enhances understanding of the concept.

For further reading and arguments read the Wikipedia article on component based software engineering. As a matter of fact, the Objective-C language was invented to be able to create re-usable software components!

Scott Bilas’ GDC 2002 talk about A Data-Driven Game Object System (PDF) as used by Dungeon Siege contains more pointers on why inheritance fails for game developers and what the advantages (but also some caveats) are with component-based game engines. The talk may be old but it’s still as valid today as it was back then. In fact, in 2002 i started working on SpellForce which already had a component system built into its core, called Aspects, Abilities and Spells. It allowed us to enter all the game data in the database and programmers only needed to write the generic code that dealt with the data, as well as setting certain limits and validity checks (eg. you couldn’t use a damaging spell on yourself but if you wanted to you could target enemies with your heal spell, or have archers shoot buildings … errm).

During GDC 2009 a similar presentation was held by Radical Entertainment’s Marcin Chady. The talk was called Theory and Practice of Game Object Component Architecture (PPT).

Mick West wrote an article Refactoring Game Entities with Components which describes the challenges and benefits of changing the Tony Hawk codebase from an inheritance model to a game component system.

A somewhat more advanced read on component use is a collaborative paper called Dynamic Game Object Component System for Mutable Behavior Characters which talks about components in context of finite state machines and NPC behaviors with a rule-based activation system.

The Game Architect blog calls it an Anatomy of Despair and sums up very good what the cons of inheritance-based class design is and how composition solves them.

Article Collection

On May 5, 2010, in , by Steffen Itterheim

The information on this page may be out of date!

I compiled most of this list in 2009 or maybe early 2010 (don’t remember exactly). Do expect some broken links and out of date information. I’m no longer updating or maintaining this page, I leave it here only for reference.

cocos2d for starters

The cocos2d homepage – this should be obvious but since most people land on the google source code repository page for cocos2d iPhone instead of the real homepage www.cocos2d-iphone.org i wanted to post it here. Usually the most noteworthy threads from the forum as well as important blog posts by others are posted on the blog, and of course any new releases and updates to cocos2d.

cocos2d iPhone documentation – a post on the official website explains where you can find what kind of documentation.

Things i wish i knew when i started with cocos2d – Troubleshooting, Tips & Tricks for everyone

Ray Wenderlich (formerly Mythic Entertainment) posted a great tutorial on how to make a simple iPhone game with cocos2d. Take a look around at his website as he keeps writing new tutorialistic articles such as creating buttons in cocos2d and an intro to the box2d physics engine which is also part of cocos2d.

Introduction to 2D game programming with cocos2d iPhone

The cocos2d iPhone programming guide in the cocos2d Wiki.

Introduction to cocos2d iPhone visual effects (aka Visual FX).

Apple’s excellent Objective-C Programming Language reference (PDF)

Open GL ES 1.1 reference – only needed if you intend to do OpenGL programming – you don’t need to know about OpenGL if you’re using cocos2d but it may come in handy sometimes.

As for books, i can NOT recommend iPhone Games Projects by Apress. Repeat: not recommended! It’s a badly written collection of blog posts about the kind of games most game developers would not want to make (chess etc). It does not contain particularly good or reusable examples of code and the choice of projects is questionable to say the least. It has generally very little value for a cocos2d iPhone developer as all examples are either written in Cocoa Touch or plain OpenGL.

cocos2d, Cocoa and Objective-C code fragments

Have a look at my proposed CCDirector drawScene method which redraws the screen anytime you may need to.

Blog Post: efficiently reusing Default.png for landscape mode – Note: Ricardo has since integrated this in Sapus Tongue source code.

Integrating other APIs into a cocos2d application or game

First of all, here’s a tutorial on how to integrate the cocos2d API reference into Xcode.

Integrating Facebook Connect with cocos2d. See also the forum post for the user comments. In addition watch this video about adding Facebook Connect to your Xcode project since the necessary steps aren’t covered in the integration tutorial. And once again, Stackoverflow strikes with an excellent link collection for Facebook Connect iPhone developers.

Integrating AdMob with cocos2d iPhone Applications

Integrating OpenFeint with cocos2d iPhone Applications

Integrating Agon Online into cocos2d iPhone

Combining SIO2 with cocos2d, with source code

SpaceManager – an Objective-C wrapper for Chipmunk

There are already ports for cocos2d iPhone, one focuses to port cocos2d iPhone to Mono .NET using C# and the other cocos2d port is Java-based for Android development.

Generally useful tools & knowledge for cocos2d iPhone developers

How to handle device orientation and how to implement autorotation for a cocos2d app or game.

A list of editors useful for cocos2d development is described on the cocos2d’s homepage blog in two parts: part one and part two. It includes tile editors, Texture Atlas and Bitmap Font generators.

Ernesto’s pseudo-code on Pixel-Perfect collisions. It was hard to find and others seem to have problems finding it as well yet people already know it as “Ernesto’s post”, so it deserves a mention here. In this forum post is one implementation of pixel-perfect collision code and here is another implementation of pixel-perfect collisions. Finally we learn about the intricacies of endianness in pixel data, meaning how pixel data changes depending on the platform (iPhone vs Mac).

Zwoptex Texture Atlas tool for use with cocos2d iPhone (and probably others)

Finding memory leaks using the CLANG static analyzer. Don’t leak memory. That’s terrible. Read how you can run a program that tells you with impressive accuracy where there are memory leaks in your code, at least potential ones. Make sure you also read the comments further down since they contain more command line samples that fix some issues for iPhone OS 3.x among other things.

How to obtain the iPhone crashlogs from your beta-testers and costumers. And then there’s Apple’s manual on how to debug crashdumps. In short: always compile both debug and release builds at the same time, then keep both dSYM files and make sure you can later identify to which version and build they belong to. It’s easiest to use source control here and simply flag or label the version you used to create distributed Ad-Hoc or App Store versions with.

iPhone Apps can be opened via URLs that also allow passing what some might call “command line arguments”. Here are a few websites that document those URLs for various apps: URL schemes for various iPhone Apps, then there’s the handleOpenURL: website and finally AppLookup.com.

Specifically for linking to the App Store you will find Apple’s iTunes Link Maker useful. On Stackoverflow you can learn how to create links to your App that you can send via email. And finally, this Ars Technica article covers all the finer details of creating an App Store link that works for the iPhone’s App Store, including opening the App Store app with a search term – which is the only way to show all the apps of a particular company or developer on the iPhone’s App Store.

8 confusing  Objective-C Warnings and Errors explains some of the more confusing things Xcode (actually: GCC) throws at you and leaves you wondering. After reading this article you’ll know what you’re dealing with the next time it comes up.

Provisioning Profiles Gotchas – we all have one of these issues sooner or later (or frequently).

App Store Rejection reasons – be sure to go through this checklist before submitting your App to iTunes Connect to avoid your App being rejected due to some commonly made mistake or oversight.

How to build an IPA file from Xcode shows you how to setup a build target in Xcode that will output an IPA file. Those are very helpful for Ad-Hoc distribution of your App, as IPA files do not get as easily mangled (leading to errors such as “resources have been modified”), especially on Windows machines. It also makes installing Ad-Hoc builds easier since a simple double-click suffices to open iTunes and install the App. Plus it’ll have a proper icon in iTunes’ Application folder.

How to properly set your App’s iTunes Release Date and the things to watch out for. If you’re about to release an App you must read this otherwise you risk your App not being listed on the “What’s New” list.

How to calculate the App Store size of your iPhone App before approval. It’s not magic nor random, it can actually be calculated to within a rather small margin of error. The good thing is, the error will be that the calculation gives you the maximum size your App could possibly have on the App Store. With experience you’ll learn how good your Apps compress after approval, and that depends highly on the game engine used. Unity is hit especially hard by this, typically Unity apps get added another 4-5 MB to the zipped App you’re uploading, in some cases even more.

How to set and change the list of supported languages in iTunes: according to this post on Stackoverflow all you need is one localized file. What i do is, under Resources, i add a new .strings File and leave it empty. Then right-click, choose Get Info and on the  General tab click “Make File Localizable”. Then go back to the General tab and click “Add Localization” until you’ve added all languages your App supports. Note that you do not have to reference or otherwise use that file in your code – it just needs to be there. If you look into your App Bundle (right click: Show Package Contents) you’ll notice that new folders like English.lproj, German.lproj etc. exist. Those are scanned by iTunes to create the supported languages list.

How to change an App Icon’s name depending on the iPhone’s language setting. While we’re at it you can also learn how to figure out more quickly if a specific name still fits under the App Icon without being shortened.

My iPhone & iPad Design Templates for OpenOffice Draw

Open Office Draw Templates for designing iPhone & iPad games. They offer you a canvas to create the visual elements of your game and pitch your ideas. I use them to pitch my ideas or create concept drawings of iPhone/iPad apps and games.

You can either use Open Office Draw to draw on them, or just print out the images and draw on it. Both versions have at least one image where the screen background is white, so you can easily draw on it. The iPad version also has a vector graphics representation, so if you worry too much about the completely dark space for printing – turn it into light gray or even transparent with just the border lines shown.

Download the iPhone Design Template for OpenOffice Draw.

Download the iPad Design Template for OpenOffice Draw. For the iPad i took extra-care to scale the images to close to original size, and i also recreated the iPad as vector graphics in almost exact original size.