Figure 1-1: Mockup title screen.
Chapter 1
Getting to Know Android Gaming
In This Chapter
Learning the background of Android
Approaching Android as a gaming platform
Planning your first game
You love games and now want to make some of your own, specifically for smartphones and tablets. You’re in luck! These are exciting times for the mobile game industry. Mobile device adoption is exploding, and mobile games are the hottest segment of mobile applications.
Android in particular is experiencing enormous growth. That means your games will be available to millions of users around the world. Android is also a great platform for developers, with flexibility and freedom unparalleled on other mobile platforms.
Seeing the Potential of the Android Platform
Whether you want to make games for Android as a personal project or as part of a plan to launch your own game studio, the platform has a lot of things going for it. For starters:
Android is an open platform.
That means fewer restrictions on what you have access to and what you can do.
Android is the fastest-growing mobile platform.
That means more people to download and play your games.
Where Android came from
Android started out as a secretive startup in 2003, and luckily got bought by Google in 2005 as a way to enter the mobile software market. The first version of Android was released on the G1 (also known as the HTC Dream) in late 2008.
Hard to believe there was a time when there was only one version of Android running on one phone. Now there are hundreds of different models running Android!
Android was built using Linux at its core, and the philosophy was simple: Make a powerful mobile operating system that is free and open-source.
Manufacturers can focus more on hardware when they don’t have to develop their own OS.
Anyone can take Android and customize it any way they want!
Google bet big on this strategy to lead to widespread adoption, and it has worked like a dream.
And where it’s going
As of this writing, Android is big and growing:
Over 300 million people worldwide own Android devices.
Over 850,000 new devices are activated every day. That’s about another 300 million added per year.
Android is in version 4.0 (codename Ice Cream Sandwich), soon to release a new major version.
In just a few short years, the advances in screen size and resolution and processing power are staggering. Even though it started out on a single smartphone, Android is now used in phones, tablets, and even television!
The future is bright, and Android shows no signs of slowing:
Market share is expected to continue to grow
More powerful multi-core devices will continue to allow for richer, more sophisticated gaming.
What You Must Know about the Mobile Gaming Industry
Smartphones and app stores have revolutionized the way people play games, as well as how developers make them. The game industry has continued to boom, with the budgets of games for the PC and consoles sometimes exceeding those of Hollywood blockbusters. Teams of dozens or hundreds of professionals, working for months or years, are required to make such big-budget productions.
But mobile gaming has gone a long way in returning game development to its early roots, when lone developers working in their basements could churn out fun, cool games in their spare time and possibly hit it big.
Handhelds and smartphones
With the release of the Game Boy in the late ’80s, Nintendo changed the way people play video games, allowing them to play on the go. The Game Boy ushered in a new era of handheld gaming devices, electronic gadgets that fit in the palm of your hand, dedicated to playing video games. The introduction of smartphones lets people game wherever they are, but without buying a specialized device.
Anyone can develop for Android
Other than the expense of a computer and fees associated with selling through a market, it’s free!
iOS or Android
These days smartphone users and developers usually fall into one of two camps when it comes to smartphones:
iOS
Android
They are both great platforms, with their own advantages and drawbacks for development.
iOS development has several advantages:
Tight integration of software and hardware
Fewer hardware/software configurations to develop for
Apple actively checks applications for quality
But there are drawbacks to developing for iOS:
Mac-only development environment
More restrictive ecosystem
Apple may reject applications for confusing or arbitrary reasons
Android development has a different balance of advantages and drawbacks.
Android is much easier and (in most cases) more flexible to develop for:
Java development environment runs on Linux, Mac, or PC
Less restrictive ecosystem
No screening process to block releases
Okay, Android development also has a few drawbacks:
May make less money than on iOS, because Android users generally buy fewer apps.
Many more hardware/software configurations to worry about
Absence of screening process, which can lead to
• More spam
• Lower-quality apps and games on the market
If starting a business is your focus, you may have varying results between the platforms
• Some studies have suggested that Android users are less willing than iOS users to purchase apps.
• In-app purchases and advertising are other ways to monetize apps and may find more success on Android.
I’ve had great success on Android with both
• Selling apps
• Generating ad revenue.
Android has lots of other markets besides Google Play.
The most notable at this time is the Amazon App Store. Like iTunes, it requires quality screening. I’ve had good success there, as have other developers, so it looks like a solid complement to Google’s official market.
How Android Is Suited to Mobile Gaming
The biggest advantage to developing games for Android is the low level of investment needed to get started:
The SDK and all associated development tools are free.
A number of game engines are free.
But there are some aspects of Android that make it particularly appealing as a platform.
Growth
For the past few years Android has been the fastest-growing mobile gaming platform. The number of activations per day has risen steadily each quarter and continues to rise.
A recent report showed that nearly 50 percent of cellphones in the US are smartphones. That means smartphone adoption will continue in the US.
For the global market, Android is poised for even more growth.
Freedom
You want to develop
The next great physics-based game?
A local multiplayer game?
An asynchronous multiplayer game?
With the standard SDK and the ability to use any number of third-party libraries to develop your games, the sky is the limit.
And (as mentioned earlier) with no review process for the official Android market, the moment you choose Submit your app is live.
Potential
Because Android is an open platform, it’s going to be adapted to more and more uses:
Although Google TV (which also runs on Android) has not panned out so far as a viable market for developers, potential exists for gaming with undreamed-of new systems running Android.
With the rapid cycle of hardware and software development, gadgets sprout new
• Interfaces
• Mechanisms
• Form factors
That means all sorts of interesting possibilities for game design, such as augmented reality games (those that blend the digital and real worlds), which currently make up only a small percentage of games on the mobile market.
Thinking Through Your Game Project
Before you download the SDK or even boot up your development machine, the first thing you should do is flesh out your game plan. You have a lot of decisions to make before coding your game, and they are all important.
Chapter 2 delves into these questions more deeply and guides you through more specific design issues:
What kind of game do you want to make?
Who is your target audience?
What range of devices are you going to target?
Do you want to focus on tablets?
Do you want to Target as wide a variety of devices as possible?
How will a player navigate through your game?
How will a player control what happens?
Do you want to try to make money with your game?
How can you monitize your game?
Pen and paper
Your favorite graphics program
Designing first
Let’s consider the broad design questions first:
Simple turn-based games have been popular throughout history.
The simpler they are, the wider their audience and appeal.
So let’s start with a simple card game that even kids can learn and play.
We also want to learn how to make faster-paced games.
Let’s stick with the simple-is-better mantra and design a single-player game that can also be for all ages.
The games chosen for this book can be
Played by one player
Learned in only a few minutes
Controlled with a purely touchscreen interface to promote universal compatibility.
This book walks you through the development of two complete, fully functional games:
Crazy Eights, the children’s card game.
This card game is played against a computer opponent.
Whack-a-Mole, a fast-paced action game.
For our initial design considerations, let’s mock up the two main screens in the game:
A title screen
A play screen.
A title screen should have
The name of the game
The main menu
Figure 1-1 shows my title screen mockup for Crazy Eights:
Figure 1-1: Mockup title screen.
My mockup only has two buttons for
Starting a new game
Displaying credits
High scores
A feature for sharing information about the game via e-mail or a social networking site
The other mockup is for the play screen (Figure 1-2), and we have a lot more decisions to make when designing this screen.
We’ll definitely want to display the core game components,such as
Each player’s score
Each player’s hand
The draw pile
The discard pile
Figure 1-2: Mockup play screen.
In this mockup, text by each set of cards indicates how many cards are in that set.
Probably the biggest design decision is how to display the user’s hand:
In Crazy Eights, players must draw until they can play, so their hand size may grow very large.
A player could hold more than 20 cards! How do we want to display very large hands? There is simply not enough space on the screen to display more than 20 cards, unless we stack them or shrink them — both of which make them more difficult to interact with via a touch interface.
My initial proposal is to only display seven cards at a time. If the hand gets larger than seven cards, the user may use an arrow button to cycle through his or her hand in “carousel” fashion. This may not be the best way to do this task, but we can always change it later.
Following a structured development process
If you’re working on a team, even a small one, most likely you’ll want to use some form of software version control, such as
Subversion (SVN)
Concurrent Versions System (CVS)
Even if you work alone, you may want to consider using such a system:
Games can often be very complex
You may find yourself in a situation where something breaks and you may want to backtrack instead of banging your head against a particularly nasty bug.
Oracle maintains a resource on naming conventions at http://www.oracle.com/technetwork/java/codeconv-138413.html
.
Whether or not you use formal source control, you will definitely need some way to back up and restore versions of your code. In terms of workflow, whether or not you follow a formal software development process, you will definitely want to follow some version of the following steps:
1. Think about what you want the user to experience.
2. Design with that experience in mind.
3. Build your game based on this design.
4. Test the build incrementally.
5. Revise based on testing.
You will end up iterating through a lot of changes late in the process, and with games especially you will want to do a lot of testing. Get the game into the hands of your friends and family (or random strangers if you can!) and let them play it.
The most important question is: Is it fun? But you might not even get there if the interface is confusing and the users can’t figure out how to play your game.
Of course, playing games should be fun, and most of the time making games is fun, too. But the more disciplined you are about the development process, the better your game will be when you launch it into the world.
Deciding on distribution
How you distribute your game will depend on your goals. Do you want to make money?
If you make your game available for free, life becomes a lot simpler:
• You just upload it for free to every market you can find.
• you may want to distribute it directly from your website.
If you want to make money, things become a bit more complicated in terms of distribution.
Some markets have restrictions on how much you can sell your game for (such as stating that the app can’t sell for less on their store and more on another).
Chapter 11 is all about monetizing your games, but it is an issue you’ll need to think seriously about up front, as it can drastically affect the design of your game:
If you want to monetize using ads, you will have less room on the screen for game content.
You want to think about where the best place to put your ads might be.
You might annoy users if ads are easily clickable because they’re too close to game controls (advertisers won’t like that either!).
Knowing What Tools You Need
When you’re building games for Android, you need the following essential tools.
Required
Besides the PC, everything is free:
Development computer
Any PC will do, since the development environment is Java. Faster is better, of course. The Android SDK comes bundled with emulation capabilities so you can create virtual Android devices on your PC, but they run extremely slowly.
Java Development Kit (JDK)
An integrated development environment (IDE)
Android SDK
Chapter 3 walks you through where and how to download and install all the software you need to get started.
That’s all you need to start making games for Android, but there are a number of other items you’ll probably want in your toolkit as well.
Recommended
At least one Android device.
Google continues to make improvements to the emulator, but there really is no comparison in testing between an emulated device and a real one:
• You’ll save time waiting for the emulator to start up.
• Testing your game with a mouse is very different from playing it on an actual device.
You don’t strictly have to own an Android device in order to develop for Android, but it’s really not a good idea.
The more devices you can add to your test suite, the better. Especially if you want your game to look and perform well on higher-resolution devices like tablets, you should invest in at least one.
A good graphics program.
• Even if you hire an artist to create the graphics for your game, at some point you will likely need to crop, resize, or otherwise edit them.
• If you don’t hire someone, you’ll need to create all the graphics on your own, even as placeholders.
GIMP is a free graphics editor with a lot of power, though not very user-friendly. Otherwise, purchasing a good, user-friendly graphics editor will be a sound investment.
Sound-editing software.
Audacity (audacity.sourceforge.net
) is a wonderful, free piece of sound-editing software that should take care of all your needs, whether you purchase or create your own sound effects and music.
Capitalizing on Your Game
A lot of game developers make games just for fun. If you want to take it one step further — and try to turn your ideas into a business — you will need to think about how you plan to do so.
Chapter 11 is all about monetizing your game, but this section will give an overview of the ways in which you can make money from a game (and potentially help you think of new ways!).
The tried-and-true approaches
The traditional (and obvious) way to make money from your app is to sell it! When you publish to a market, list the price at what you think is a good price point. Most paid games sell between $0.99 and $2.99 USD, but big-budget or high-demand games might ask for even more.
The price point is something you can experiment with as you try to optimize sales. If you’re going this route, there are really no particular design decisions that will affect development. Just build a great app! (Simple, right? Maybe so. Just stick with this book.) Realize, however, that paid apps get far fewer downloads than their free counterparts, so if what you’re seeking is as wide an audience as possible, asking the players to pay isn’t the best option.
Most markets have a minimum price (usually $0.99 USD).
Some markets (such as Google Play) don’t allow you to switch to free and then back to paid!
Another option for making money from games is to give them away. Wait a second . . . how do you make money from a game if you don’t charge for it? The so-called freemium model has been mastered by the creators of Android.
Google gives away most of its products and services, most of which are incredibly useful and high-quality. How does it make billions of dollars in revenue a year then? Advertising.
You can do the same with your game. Give it away for free and place advertising in the app. You can either
• Try to find your own advertisers.
• Use one of the many ad providers to serve ads in your app.
Typically you’ll only get paid when someone clicks one of the ads, but if your game is popular, you can profit quite well from this approach.
If you want to serve ads in your game, some users won’t like the ads, and you’ll need to be careful about how you place them so they don’t interfere with play.
Another freemium model is to give the game away for free, but then charge users to upgrade to a full version, which might include more features or remove ad visibility. This could be either
• A one-shot payment
• A subscription model
Incorporating such a system is a little more complicated than serving ads, so be aware of the technical issues.
In-app purchases offer a rich potential revenue stream. While the game itself could be offered for free, in-game upgrades such as virtual goods or level unlocks can be sold to the player in exchange for real money. Some developers have made a fortune employing this monetization strategy.
Some games are naturally suited to this model, such as
• Simulation
• Role-playing games
In general, you shouldn’t try to shove a round peg in a square hole. If your game isn’t a good fit with in-app purchases, don’t try to force it.
The free versions contain ads and are sometimes feature-limited.
The paid versions have no restrictions.
The free versions point to the paid versions as a form of advertising. I’ve tried releasing just one version or the other, but this particular strategy has served well.
The moral of the story: Even though my idea didn’t pan out, you shouldn’t necessarily constrain yourself to existing models. If your game is innovative enough, there just may be a novel way to make money from it, and you just may be hailed as a pioneer in mobile gaming!