Chapter 1

Getting to Know Android Gaming

In This Chapter

arrow Learning the background of Android

arrow Approaching Android as a gaming platform

arrow 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:

check.png Android is an open platform.

That means fewer restrictions on what you have access to and what you can do.

check.png 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.

check.png Manufacturers can focus more on hardware when they don’t have to develop their own OS.

check.png 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:

check.png Over 300 million people worldwide own Android devices.

check.png 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:

check.png Market share is expected to continue to grow

check.png 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.

tip.eps Developing for smartphones is also a lot easier than for the handheld market, which usually requires an expensive software development kit (SDK) and authorization from the manufacturer. Smartphones have democratized mobile game development, lowering the bar of entry for those interested in making mobile games:

check.png Anyone can develop for Android

check.png 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:

check.png iOS

check.png Android

They are both great platforms, with their own advantages and drawbacks for development.

iOS development has several advantages:

check.png Tight integration of software and hardware

check.png Fewer hardware/software configurations to develop for

check.png Apple actively checks applications for quality

But there are drawbacks to developing for iOS:

check.png Mac-only development environment

check.png More restrictive ecosystem

check.png 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:

check.png Java development environment runs on Linux, Mac, or PC

check.png Less restrictive ecosystem

check.png No screening process to block releases

Okay, Android development also has a few drawbacks:

check.png May make less money than on iOS, because Android users generally buy fewer apps.

check.png Many more hardware/software configurations to worry about

check.png Absence of screening process, which can lead to

• More spam

• Lower-quality apps and games on the market

check.png 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.

check.png 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.

tip.eps If you have a great game idea, consider developing your game for both of the dominant smartphone platforms. See Chapter 14 for tools that make cross-platform development easier.

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:

check.png The SDK and all associated development tools are free.

check.png A number of game engines are free.

remember.eps All you really need is a computer and an idea!

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.

check.png A recent report showed that nearly 50 percent of cellphones in the US are smartphones. That means smartphone adoption will continue in the US.

check.png For the global market, Android is poised for even more growth.

Freedom

You want to develop

check.png The next great physics-based game?

check.png A local multiplayer game?

check.png 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.

tip.eps Developing and publishing on Android is probably the easiest end-to-end process of any platform in gaming today.

Potential

Because Android is an open platform, it’s going to be adapted to more and more uses:

check.png 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.

check.png 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:

check.png What kind of game do you want to make?

check.png Who is your target audience?

check.png What range of devices are you going to target?

check.png Do you want to focus on tablets?

check.png Do you want to Target as wide a variety of devices as possible?

check.png How will a player navigate through your game?

check.png How will a player control what happens?

check.png Do you want to try to make money with your game?

check.png How can you monitize your game?

tip.eps Initially, one of the best ways to think through a lot of design issues related to your game is to sketch out what the game might look like with either

check.png Pen and paper

check.png Your favorite graphics program

Designing first

Let’s consider the broad design questions first:

check.png Simple turn-based games have been popular throughout history.

remember.eps 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.

check.png 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

check.png Played by one player

check.png Learned in only a few minutes

check.png Controlled with a purely touchscreen interface to promote universal compatibility.

technicalstuff.eps

This book walks you through the development of two complete, fully functional games:

check.png Crazy Eights, the children’s card game.

This card game is played against a computer opponent.

check.png Whack-a-Mole, a fast-paced action game.

For our initial design considerations, let’s mock up the two main screens in the game:

check.png A title screen

check.png A play screen.

A title screen should have

check.png The name of the game

check.png The main menu

Figure 1-1 shows my title screen mockup for Crazy Eights:

Figure 1-1: Mockup title screen.

9781118235997-fg0101.tif

My mockup only has two buttons for

check.png Starting a new game

check.png Displaying credits

technicalstuff.eps For now, keep it simple. However, you may also want buttons for something like

check.png High scores

check.png 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

check.png Each player’s score

check.png Each player’s hand

check.png The draw pile

check.png The discard pile

Figure 1-2: Mockup play screen.

9781118235997-fg0102.tif

In this mockup, text by each set of cards indicates how many cards are in that set.

technicalstuff.eps In terms of playing the game, some of this information isn’t all that useful (such as how many cards are in the discard pile), but when you’re initially laying things out, it’s often a good idea to include too much — with an eye toward paring down to essentials later.

Probably the biggest design decision is how to display the user’s hand:

check.png 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.

check.png 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.

tip.eps Just get your initial ideas down somewhere, and you’ll save yourself a lot of headache down the road when you start to code.

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

check.png Subversion (SVN)

check.png Concurrent Versions System (CVS)

tip.eps These tools help organize any revisions made to your source code; it’s a great help in keeping things straight if you need to roll back to a previous working build of your code.

Even if you work alone, you may want to consider using such a system:

check.png Games can often be very complex

check.png 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.

tip.eps Try to follow standard conventions for naming your packages, files, and variables. For variables, use mixed-case names that are descriptive, such as highScore instead of x1. Even if you don’t extensively comment your code, naming elements in your code in an intuitive way will help others who may need to work with your code. If you revisit your code after a long period of time, good naming conventions will help you understand your own code as well!

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?

check.png 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.

check.png 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:

check.png If you want to monetize using ads, you will have less room on the screen for game content.

check.png You want to think about where the best place to put your ads might be.

warning_bomb.eps 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:

check.png 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.

check.png Java Development Kit (JDK)

check.png An integrated development environment (IDE)

check.png 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

check.png 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.

tip.eps 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.

check.png 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.

check.png Sound-editing software.

tip.eps 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.

warning_bomb.eps You may want to run a sale on your for-pay app periodically, or during holidays. But be aware:

check.png Most markets have a minimum price (usually $0.99 USD).

check.png 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.

check.png 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.

warning_bomb.eps 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.

check.png 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.

check.png 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.

tip.eps With many of my games, I have used a two-pronged attack, offering most of them as both free and paid.

check.png The free versions contain ads and are sometimes feature-limited.

check.png 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!

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset