Mastering Android Game Development with Unity
eBook - ePub

Mastering Android Game Development with Unity

  1. 352 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Mastering Android Game Development with Unity

Book details
Book preview
Table of contents
Citations

About This Book

Create enthralling Android games with Unity Faster Than Ever BeforeAbout This Book• Develop complex Android games with the help of Unity's advanced features such as artificial intelligence, high-end physics, and GUI transformations.• Create amazing Graphical User Interfaces (GUIs) with Unity's new uGUI system• Unravel and deploy exciting games across Android devicesWho This Book Is ForIf you are a Unity 5 developer and want to expand your knowledge of Unity 5 to create high-end complex Android games, then this book is for you. Readers are expected to have a basic understanding of Unity 5, working with its environment, and its basic concepts.What You Will Learn• Develop your own Jetpack Joyride clone game• Explore the advanced features of Unity 5 by building your own Action Fighting game• Develop remarkable Graphical User Interfaces (GUIs) with Unity's new uGUI system• Enhance your game by adding stunning particle systems and complex animations• Build pleasing virtual worlds with special effects, lights, sky cube maps, and cameras• Make your game more realistic by providing music and sound effects• Debug and deploy your games on different Android devicesIn DetailGame engines such as Unity are the power-tools behind the games we know and love. Unity is one of the most widely-used and best loved packages for game development and is used by everyone, from hobbyists to large studios, to create games and interactive experiences for the Web, desktop, mobile, and console. With Unity's intuitive, easy-to-learn toolset and this book, it's never been easier to become a game developer.You will begin with the basic concepts of Android game development, a brief history of Android games, the building blocks of Android games in Unity 5, and the basic flow of games. You will configure an empty project for the Jetpack Joyride Clone Game, add an environment and characters, and control them. Next you will walk through topics such as particle systems, camera management, prefabs, animations, triggers, colliders, and basic GUI systems. You will then cover the basic setup for 3D action fighting games, importing models, textures and controlling them with a virtual on-screen joystick. Later you will set up Scene for 3D Configuration, create basic gameplays, and manage input controls. Next you will learn to create the interface for the main menu, gameplay, game over, achievements, and high score screens. Finally you will polish your game with stats, sounds, and Social Networking, followed by testing the game on Android devices and then publishing it on Google Play, Amazon, and OUYA Stores.Style and approachA step-by-step and detailed guide to developing high-end complex Android games utilizing the advanced concepts of Unity.

Frequently asked questions

Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Yes, you can access Mastering Android Game Development with Unity by Siddharth Shekar, Wajahat Karim in PDF and/or ePUB format, as well as other popular books in Informatik & Anwendungsentwicklung. We have over one million books available in our catalogue for you to explore.

Information

Year
2017
ISBN
9781785282942

Adding Player Character for an Action Fighting Game

The previous chapter covered many different things and concepts regarding 2D game development in Unity and it followed a practical approach to finish a simple 2D game called Perky Penguin. The chapter continued the practice example of the game from Chapter 1, Introduction to Android Game Development with Unity3D, and finished by covering important topics on 2D games. It started by adding particle effects in Unity and then it explained in detail about the concept of Particle Systems, the basics of Particle Systems, and how these are added in Unity. Then we continued the discussion to apply the concepts in a practical example by adding a rocket fire particle system for the penguin in the game, and discussed such properties as emission, shape, and color.
After Particle Systems, the chapter focused on creating an environment and adding backgrounds in the game. It explained how to import these backgrounds, and how to make them repeatable in the game. The concept of sorting layers and tags was also covered and the chapter moved on to camera management and how a penguin would never go out of the screen if the camera always focused on it.
After these regular topics, a very interesting and useful topic of Prefabs was discussed in the chapter. After some basic discussion of Prefabs, the game was enlightened with Level Prefabs, which allowed the game to repeat the background and generate obstacles at runtime. This discussion also included the generator concept and its code implementation as well.
Finally, the chapter finished with adding obstacles in the game and the basic collision detection with the penguin. This led to the concept of triggers as well, which becomes very useful in creating invisible colliders to detect some object's presence at some place in the game. The following is a screenshot of the game after completion of the previous chapter:
Figure 3.1 A snapshot of Penguin Perky game
If you are interested in creating any 2D game in Unity, then this is covered in more detail in Chapter 1, Introduction to Android Game Development with Unity3D and Chapter 2, Finishing the Perky Penguin 2D Game.
This chapter is a totally new level compared to previous chapters. In this chapter, we will extend our knowledge about Unity to 3D game development, which can often become very confusing and tricky for new game developers. Up until 2D game development, the focus of developers and programmers revolved around the concept of images, sprites, and two dimensions, ignoring the camera's depth. The new developers who have worked on graphics tools such as Adobe Photoshop or Gimp prove to be very good in 2D game development and grasp the concepts very quickly, but 3D becomes very tough because it needs expertise in highly-used advanced commercial tools such as Autodesk Maya, 3D Studio Max, and so on. These tools require many years of practice and experience and that makes 3D game development very hard to learn for new programmers.
It is out of the scope of this book to cover all the topics, but we will learn about basic concepts and their usage through creating a 3D action fighting game from scratch. This chapter will teach from the very start about the configuration of 3D game projects, importing 3D models, and how textures and materials are applied on these models. Moving on, this chapter will introduce the concept of rigging and what interfaces Unity has to offer to make rigging easier, such as humanoid rigging, generic rigging, and so on. This concept of rigging will be implemented in practice by importing and rigging the player character model of the action fighting game in Unity. We will further apply animations to allow for basic character movement.
Now, let's put our words into action and start learning about 3D game development, focusing on the configuration of 3D game projects in Unity in the following section.
This chapter includes the following topics:
  • Configuring a project for 3D games
  • Importing 3D models
  • Applying textures and materials
  • Generic and humanoid rigs
  • Configuring humanoid avatars
  • Legacy and Mecanim animation systems
  • State machines with Animation controllers

Configuring Project for 3D Games in Unity

In previous chapters, we were learned about 2D games and we also learned about how 2D game projects are created and configured in Unity. For 3D projects, the procedure is almost identical, except some changes need to be done. Let's start by launching Unity 5 and creating an empty project with it.
If you are already aware of 3D game projects configuration or have worked on any 3D game before, you can safely skip this section. When you launch Unity 5, it shows a project wizard, as shown in the following screenshot:
Figure 3.2 Unity 5 new project wizard
The project wizard shows a list of all the recent projects along with their names. The most recent project is highlighted for quick opening. On the top-right side of the wizard, there are controls to create a new project from scratch and open any specific project from any directory. Let's start by creating a new project by clicking on the New project button on the top right. You will be presented with the dialog, shown in the following screenshot:
Figure 3.3 New project details wizard
Write the project name and select its path location. Below these text inputs, you will observe a simple selection from two options: 2D and 3D. We will choose 3D as we are creating a 3D game. This is shown in the following screenshot:
Figure 3.4 Project type selector for 2D and 3D
This toggle lets you tell Unity whether your project is 2D or 3D. Although this doesn't affect or change the project in any way while working on it, it affects the default project setting for an easier workflow. For example, in 3D mode when you import any image asset into the project, Unity will take it as a texture and in 2D mode, Unity will take it as a sprite. You can also change the mode later from the project anytime; it is not necessary to select at project creation time. By default, Unity will create the project in 3D mode.
Now, let's name the project as Free Fighter and press Create Project. This will import some pre-defined assets and launch the Unity interface editor. You can observe that an empty new scene will be created as well containing two game objects in the hierarchy panel: Main Camera and Directional Light. We won't discuss these objects at the moment, but these will be covered in upcoming chapters as we manage the cameras and lights for the games.
In this blank unsaved empty scene, the first thing we need is the model of the player character. Let's discuss the model or models in general in the next section.

Importing 3D models

Before we go into the nifty details of 3D modeling and Unity3D, let's discuss first what 3D models are. In computer graphics, 3D modeling is the process of constructing and developing a mathematical and visual representation of any three-dimensional (3D) surface of an object via any 3D modeling software. The end product of that process is called a 3D model, or simply model, in the context of this book. The interesting thing about 3D models is that they are in 3D and any computer or laptop screen is a 2D surface, so it becomes a ...

Table of contents

  1. Title Page
  2. Copyright
  3. Credits
  4. About the Authors
  5. About the Reviewers
  6. www.PacktPub.com
  7. Customer Feedback
  8. Preface
  9. Introduction to Android Game Development with Unity3D
  10. Finishing the Perky Penguin 2D Game
  11. Adding Player Character for an Action Fighting Game
  12. Enemy Characters with AI
  13. Gameplay, UI, and Effects
  14. GameScene and SceneFlow
  15. Gamestats, Social, IAP, and Ad Integration
  16. Sound, Finishing Touches, and Publishing