Tuesday, October 13, 2009

Gamasutra on Android Game Development

Gamasutra, a great website devoted to "the art and business of making games", has an article today on developing games for Android. Of course, about half of the article is spent discussing the success of the App Store and making comparisons to it.

Although I like the article, there are a few things in it that I take exception to. On the first page, for example, the article says that Android uses the "more developer friendly Java". What the hell does that mean? I've done both Java and Objective-C for a living, and neither one has ever waved to me or gotten me a cup of coffee. They're programming languages. Sure, there are more people who already know Java than Objective-C, but if that's what he meant, there were far more accurate ways of saying it.

It's also just plain wrong in terms of game programming. Objective-C is a superset of C and you can write entire games in C or C++ with the exception of a small amount of code to set up and configure your OpenGL ES view. Please don't even try to tell me that, from the perspective of a game programmer, Java is more "user friendly" than writing OpenGL code in C or C++.

Overall, the tone of the article is very optimistic, almost like a recruitment article hoping get people interested in Android development. They point to statistics to show that Android is gaining momentum and the iPhone is losing it. Well, you know what Disraeli said about statistics1.

If you follow the link in the last paragraph, the iPhone chart clearly does not show a decline in anything except in an artificial comparison to Android in terms of "percentage of projects started" (a dubious metric, at best). The iPhone is showing a slowdown in growth when looking at new projects being started, but there is still growth, and considering just how big and successful the store has been, that's kind of amazing. On the other hand, look at the Y-axis label on both charts. They are using completely different scales. If they were charted together on the same graph, the Android "flurry" of project starts would barely get over the first line, and it would do that in only one of the months charted. Also, while the iPhone may be experiencing a slowdown in new project starts, that's more than being offset by an increase in interest from the large gaming interests like EA and the fact that many more big, long-term projects are being started.

I don't want to come across as too down on Android. I think right now, of all the smart phones in the race, it's in the best position to be a real competitor to the iPhone, and a strong competitor is definitely something the iPhone needs. If I had to bet on which platform might overtake the iPhone someday, it would be Android, but I would not be betting a lot of money. There's still an open field for second place and a long distance between the pack and the current leader. Nobody currently jockeying for second place has begun to move substantially away from the pack toward the leader. At some point, somebody undoubtedly will break away and gain ground on the iPhone, but nobody - including Android - has started the kick yet. They might have a little better odds on placing, but they're still a long shot for winning.

Androids greatest advantage in that field also be its Achille's heel in terms of game development, which is the fact that Android is hardware agnostic. It will run on a variety of devices from different manufacturers with different CPUs and different GPUs. It will run on phones with touch screens and phones with keyboards. That's going to introduce a lot of complexity and make it hard to write apps that work perfectly on all Android devices that ever have been made or ever will be made, or even to identify how well it will run on any potential customer's phone. The only way for a developer to know if their game will perform well on any particular phone is to buy them all and test. That just isn't a possibility for the stereotypical garage game developer. This hardware agnosticism also means that optimizing game code for performance might result in improvements on one platform and then unexpectedly cause degradation on another. Those are issues that big game companies have the resources and experience to deal with, but are not so easy for smaller independent game developers.

Despite the issues, despite the difficulty competing in an increasingly large App Store that's beginning to get populated with big-budget games, I feel strongly that the iPhone is still the best game in town for the small, independent game developer, and it will continue to be well into the foreseeable future. Yes, you will still have to market your game. Yes, there is a chance of failure. The App Store is not magic, it's just a great opportunity.

Now, this equation will change over time, and this what I'm saying not be true a few years from now, but it's going to take time for Android to build momentum and gain ground. Right now, the games in the top ten on the Android Store are averaging well less than $100 a day income, and that's just not enough potential money for most people - big companies and independent developers alike - to see it as a viable opportunity proposition yet.

1: "There are three kinds of lies: lies, damned lies, and statistics." It was originally said by British Prime Minister Benjamin Disraeli. Sometimes it's wrongly attributed to Mark Twain. Though he certainly popularized it in America, the quote does not originate from him.


Heath said...

Java has better:
Stack traces/error reporting
Source code editors
Static analysis tools
Runtime Analysis tools
Library support (for almost any task under the sun, a Java library exists)
Source Code access

I would be happy to be proven wrong about any of the above statements. Of course, I've only got about 3 months of ObjC/Cocoa experience compared to 10 years of Java experience, so I'm sure I'll get happier with ObjC/Cocoa over time, but I doubt it will ever reach parity with Java in terms of developer friendliness.

Your other points about Android's weaknesses compared to the iPhone are valid. If you want to ask questions of a talented Android and C developer, you might check out Doug Schaefer's blog:

Jeff LaMarche said...


I don't want to get into an argument over something that essentially boils down to personal taste. I spent nearly a decade doing mostly Java development work for a living, and I don't agree with many of your claimed benefits of Java but don't really see a point in arguing them. If you're happy with Java and like it better, that's great. Really.

The point you seem to be missing, though, is that Objective-C is a superset of C, and by using Objective-C++, Objective-C code can use C++ objects and templates. Please don't try and tell me that there's more libraries or available source code for Java than C, C++, and Objective-C combined, because that's just laughable. Yes, there are more Java libraries than Objective-C frameworks, but that's not really a fair comparison since Objective-C isn't limited to using just Objective-C frameworks.

Better source code editors? I didn't realize that source code editors were tied to language. The ones I've used have supported multiple programming languages, and since Xcode supports external code editors, I'm really confused how this is even something that can be compared between the two languages. We can compare IDEs, sure (but personally, I like Xcode much better than Eclipse), but source editors? That's more of an OS issue than a language issue.

I've had this same basic argument with a few other Java programmers and it gets tiresome. If you're going to give me a list of ways where one thing is better than another, please show me that you've got a decent basis for the comparison and then provide some facts to support it. Three months versus ten years tells me you're lacking a basis for a fair comparison and are comparing what you know about Java with what you think or assume about Objective-C.

I've worked with both Java and Objective-C for over a decade each and have done both professionally. I feel like I've got a fairly decent and comparable amount of knowledge about the two, and I simply don't agree with any of your points.

That's not to say that Java is a bad language, just that it's not "better" than Objective-C in any kind of universal sense. They are very different languages that require different design patterns to use effectively and a different way of thinking. Because you're more comfortable or familiar with one doesn't make it objectively better.

But, a lot of that is really meaningless because all I asked was why would Java be "more developer friendly". It's a vague and mostly meaningless term in this context, and that was my main point. It didn't serve any purpose. I think it was just a poor choice of words chosen by the author to express the fact that there are more people who are already familiar with Java then with Objective-C, which is true, but an oversimplification, since Objective-C sits firmly atop C, which many developers certainly do know. Apple provides a template that sets up an OpenGL context, so the obstacles for experienced game programmers are relatively low. I know, because I know several developers who used to do PC or console games that are now developing for the iPhone.

Heath said...


You're right that I don't have enough experience with ObjC/Cocoa compared to Java. I was hoping that you would shoot me down on my various points about ObjC and help me learn where I can find more info about the areas where I believe Java to be superior to ObjC.

Are there ways to get Java-like stack traces in ObjC/Cocoa? Getting a bunch of address pointers isn't very helpful.

You are right about source code editors. I was really talking about the default IDE's (Eclipse/XCode). I'm finding XCode to be severely lacking compared to Eclipse, both in functionality and quality. Instruments looks pretty cool, but its just a GUI wrapper over DTrace, and Java can use DTrace, too. I don't want to discount the entire Apple tools ecosystem yet because I haven't really used it all. I'm trying my best to learn to do things the Apple-approved way.

XCode and GDB don't give me the same power I can get with Eclipse's debugger. In Eclipse, I can customize the structures I see for an object on the stack. Thus, instead of looking at the internals of a java.util.Map, I can see it as an array of name-value pairs. I wish I could do this in XCode's debugger. I also wish I could execute arbitrary methods on objects from the debugger. I can do this from Eclipse.

Of course you are right about libraries in total, but I find that Java libraries are easier to find with Google searches.

My biggest problem is not being able to see Cocoa source. Seeing JRE source is very helpful when debugging, and also shows the software patterns that the (hopefully) best Java developers use. I miss that a lot when working with Cocoa.

I do appreciate your blog, and I have a copy of your book. I chose to come to this platform specifically because I wanted to get closer to the metal, and I wanted not to be afraid of native code. I understand that I've got a long way to go before I'm as good at ObjC as I am at Java.

K. A. Barber said...

Java vs
Obj-C vs
ActionScript vs
Javascript/DHTML/CSS vs
C++ vs ..........................

If you are making your platform choice based solely on the primary development language of the platform then you might not be ready for game development. The knowledge and understanding necessary for making something as complicated transcends programming language.

The majority of the current iPhone game developers are people from other platforms that recognized an opportunity in the iPhone. Install base, App Store viability and handset hardware capability are the major concerns not programming language.

peterkirn said...

What K.A. said...

I'm focused more on Android development than iPhone development, but I read this site because I appreciate its excellent coverage of mobile development issues relevant to everyone.

I'll say this - while I generally agree with the points here, I have to disagree that hardware agnosticism is the Android's biggest problem for game development.

* Screen resolution: It's absolutely practical to write games for multiple resolutions. Resolution is an issue you *can* test on an emulator, for one. And you can expect devices are likely to gravitate toward certain resolutions and aspect ratios. Google has meanwhile done a great job with SDK 1.6 of making these variations manageable. This is a plus, plain and simple.

* Hardware capabilities: Well, here's where OpenGL comes in. If you're smart enough to do OpenGL development, you're smart enough to make things run across devices. Again, you have robust tools for querying a device for what it can do and adapting accordingly, and you're not talking an unlimited number of variations, more like having to switch between a couple of baselines (OpenGL ES 2, for instance).

Oh yeah, and, incidentally, you have the same problem as an iPhone developer, so... you get the point. :)

* Sensor differences: This one does matter, and will likely limit the use of novel sensors as an exclusive input device. I don't expect the iPhone will be immune to this, either, however.

* Buying multiple devices: See also iPhone. Of course, the good news is that Android is an open OS. I expect I'm going to wind up blowing some cash on Android devices, yeah, so I do see your point, but I think it will be possible to be strategic and not to have to test on everything. That's been the case on PC game development, and mobile development is comparatively simpler.

There are some significant issues, however. OpenGL programming in Java can be clumsy and adds some overhead (the JNI calls use up memory, which isn't remotely noticeable on a desktop but can be on mobile). And the hardware difference that's more of a pain is the lack of an FPU on certain hardware. That suggests we may see other sub-par hardware in future, though only time will tell.

I think generally iPhone is a more robust platform for game development, particularly through its support for native code. Now, that's coming from someone who chooses to focus on Android, but I do think Google has more work to do in expanding native code support and OpenGL support. Both of these are promised and we are seeing progress, so watch this race to get more interesting.

K. A. Barber said...

The Android Mobile OS is designed/expected/marketed to work on handsets with different capabilities and form factors created by an array of manufacturers.

Some of those manufacturers will create handsets with capabilities analogous to the iPhone.

Some of those manufacturers will create handsets with less/different features for different user demographic profiles.

And yes, some of those manufacturers will create handsets with capabilities greater than that of the iPhone.

The observation/point that is being made is that since the feature set of the handsets that Android OS supports may be vastly different from each other it will be almost impossible to write a performance game that targets all of the supported handsets.

You could target just the high end handsets but that chops up your market and still may not guarantee consistent feature set.

At least for right now all of the iPhone OS handsets are almost identical in feature set. Yes, I know there is no phone/GPS on the Touch and that OpenGL is evolved on some of the newer Apple hand sets but the commonalities out weigh the differences. This allows you to focus more intensely on creating a good gaming experience..

Frankly, I don't have a problem with Android. I was just stating that in game development, programming language selection becomes moot quickly.

On a side note, I have been reading Gamasutra and receiving GD Mag since the late 1990s and love everything about it. There is so much good information/code there you could lose yourself.

kelly said...

i really liked d blog post

peterkirn said...

I think it would be a mistake to assume Android devices will have "vastly different capabilities" relative to the iPhone. Or to look at it another way, the differences on iPhone/iPod in OpenGL ES, camera (like not having one), GPS, sensors, and audio I/O can indeed be vastly different, depending on what sort of app you're writing! (As it happens, that's a list of the things that especially interest me and many of the people I know!)

I think the nature of mobile development is having to account for such differences, whether on an Apple platform or an open platform like Android.

I do agree to the extent that different processors could pose a big issue, but we just don't know what it looks like yet. I'm glad I bought the G1 as it seems to be an effective baseline for performance. I think it will be more complex than iPhone, no question, but I don't see this as radically different (and I continue to play around with iPhone, too).

Anyway, this article glosses over this stuff. It's worth going to the source. Google does have a plan for classifying those different devices. For instance, this covers screen resolution:


Romain Guy is a terrific writer and doing good work.

The bottom line - the Manifest is everything. You'll be able to say "I need x, y, and z" for an app and run on the devices that support it, ignoring those that don't. I wish Apple would do a better job of this, in fact. There are "iPhone" apps that should run on the audio capabilities of the iPod touch.

To me, the Manifest system is demonstrably better, and having this sort of hardware flexibility - when you adjust accordingly - is a good thing. That's not to say the iPhone doesn't also have things I prefer, but I just have to observe that this is *not* an Achilles' Heel to everyone. It's more like a Fact of Life in Mobile Development, regardless of platform.

Rogelio GudiƱo said...

I agree, and yep, the key to the iphone's success is that there is only one device, developers don't have to worry about compatibility, same goes for mac computers, Android, Windows, and Linux on the other hand have to worry about drivers and all that so that their OS works on most of the hardware.

In other words, imagine if Sony, Nintendo or Microsoft decided to make their console's OS compatible with different devices, developing games on them would be a pain in the...

blog said...

We are here for betting store online, online gambling sites, play online gambling is so popular you ll meet lots of new friends. betting store online provide you online gambling, online betting, online betting news an many more. Play online games at bettingstoreonline.com.

blog said...

Hi i m visit your blog it's a really nice blog and casino informatie please visit my blogs and send me comment.
Bingo City UK, UK Bingo Space, Play Bingo Online, 88 Bingo, bingo king uk and more blogs here related to bingo information.


ck.seoexpert said...

i would suggest java to be the best for that .

Online Slots | Online Casino

Edwin said...

scrub m65 kamagra attorney lawyer body scrub field jacket lovegra marijuana attorney injury lawyer

Curtis Hewett said...

Jeff's comments are spot on, esp those regarding Objective C as a subset. And regarding the language of Java being more "friendly" for programmers, especially those involved with game programming, I think the meaning of this is not as ambiguous as is contended.

Pavel said...

In the business and social sector mobile applications are very popular due to custom use for meeting particular needs of users. Growing use of mobile phones & custom mobile application by businesses is directly creating favorable situations for mobile application development. Businesses use mobile applications for advertising purpose in the modern business environment at global level.
java software company | software development company | java web development | blackberry application development | iphone application development | android application development | java outsourcing | it outsourcing services | http://www.tenaxtechnologies.com

Mobile Application Development said...
This comment has been removed by the author.
Mobile Application Development said...

Today there are lots of good developers for mobile application; this is the things makes mobile application successful. And it is also interesting to develop mobile application.

Mobile application Development

h4ns said...

What youre saying is completely true. I know that everybody must say the same thing, but I just think that you put it in a way that everyone can understand. I also love the images you put in here. They fit so well with what youre trying to say. Im sure youll reach so many people with what youve got to say.

Arsenal vs Huddersfield Town live streaming
Arsenal vs Huddersfield Town live streaming
Wolverhampton Wanderers vs Stoke City Live Streaming
Wolverhampton Wanderers vs Stoke City Live Streaming
Notts County vs Manchester City Live Streaming
Notts County vs Manchester City Live Streaming
Bologna vs AS Roma Live Streaming
Bologna vs AS Roma Live Streaming
Juventus vs Udinese Live Streaming
Juventus vs Udinese Live Streaming
Napoli vs Sampdoria Live Streaming
Napoli vs Sampdoria Live Streaming
Fulham vs Tottenham Hotspur Live Streaming
Fulham vs Tottenham Hotspur Live Streaming
AS Monaco vs Marseille Live Streaming
AS Monaco vs Marseille Live Streaming
Alajuelense vs Perez Zeledon Live Streaming
Alajuelense vs Perez Zeledon Live Streaming
Technology News | News Today | Live Streaming TV Channels