Holistic Mobile Game Development with Unity Master mobile game design and development in this all-in-one guide to creating iOS and Android games in the cutting-edge game engine, Unity. By using Penny de Byl’s holistic method, you will learn about the principles of art, design, and code and gain multidisciplinary skills needed to succeed in the independent mobile games industry. In addition, hands-on exercises will help you throughout the process from design to publication in the Apple App Store and Google Play Store. • Over 70 practical step-by-step exercises recreating the game mechanics of contemporary mobile games, including Angry Birds, Temple Run , Year Walk , Minecraft, Curiosity Cube, Fruit Ninja , and more. • Design principles, art, and programming in unison—the one-stop shop for indie developers requiring interdisciplinary skills in their small teams. • An introduction to essential two- and three-dimensional mathematics, geometry, and physics concepts. • A portfolio of royalty-free reusable game mechanics and assets. • Accompanying website, www.holistic3d.com, features project source code, instructional videos, art assets, author blog, and teaching resources. • Challenge questions and lesson plans are available online for an enhanced learning experience. Penny de Byl is a professor of games and multimedia in Australia. An awardwinning teacher, Penny has taught computer science, computer graphics and game development at top-ranked universities for nearly 20 years. She is the author of three books on designing and developing artifi cial intelligence and games including the acclaimed Holistic Game Development with Unity and winner of the 2011 Unity Technologies’ Unity Mobile Generation Great Education Giveaway. This page intentionally left blank Holistic Mobile Game Development with Unity An All-In-One Guide to Implementing Mechanics, Art Design, and Programming for iOS and Android Mobile Games Penny de Byl First published 2015 by Focal Press 70 Blanchard Road, Suite 402, Burlington, MA 01803 and by Focal Press 2 Park Square, Milton Park, Abingdon, Oxon OX14 4RN Focal Press is an imprint of the Taylor & Francis Group, an informa business © 2015 Taylor & Francis The right of Penny de Byl to be identifi ed as the author of this work has been asserted by her in accordance with sections 77 and 78 of the Copyright, Designs and Patents Act 1988. All rights reserved. No part of this book may be reprinted or reproduced or utilized in any form or by any electronic, mechanical, or other means, now known or hereafter invented, including photocopying and recording, or in any information storage or retrieval system, without permission in writing from the publishers. Notices Knowledge and best practice in this fi eld are constantly changing. As new research and experience broaden our understanding, changes in research methods, professional practices, or medical treatment may become necessary. Practitioners and researchers must always rely on their own experience and knowledge in evaluating and using any information, methods, compounds, or experiments described herein. In using such information or methods they should be mindful of their own safety and the safety of others, including parties for whom they have a professional responsibility. Product or corporate names may be trademarks or registered trademarks, and are used only for identifi cation and explanation without intent to infringe. Library of Congress Cataloging-in-Publication Data Baillie-de Byl, Penny. Holistic mobile game development with Unity : an all-In-one guide to implementing mechanics, art design, and programming for iOS and Android mobile games / Penny de Byl. pages cm 1. Computer games—Programming. 2. Mobile games. 3. Unity (Electronic resource) I. Title. QA76.76.C672B336 2014 794.8'1526—dc23 2014006126 ISBN: 978-0-415-83923-5 (pbk) ISBN: 978-0-203-77372-7 (ebk) Typeset in Myriad Pro by Apex CoVantage, LLC Contents Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vi Chapter 1: Mobile Game Design and Development . . . . . . . . . . . . . . . . . . .1 Chapter 2: Procedural Literacy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 Chapter 3: Mobile Game Interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125 Chapter 4: Aesthetics and Visual Literacy . . . . . . . . . . . . . . . . . . . . . . . . . 195 Chapter 5: Learning from the Masters: Part One . . . . . . . . . . . . . . . . . . . 273 Chapter 6: Learning from the Masters: Part Two . . . . . . . . . . . . . . . . . . . 349 Chapter 7: Multiplayer Experiences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 429 Chapter 8: Publishing, Players, and Promotion . . . . . . . . . . . . . . . . . . . . 491 Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 559 v Preface About This Book This book presents the theory and practice of mobile game development art and code for both Apple and Android mobile devices using the Unity game engine. While the exercises are written exclusively for game design and development in Unity, the theoretical concepts transcend the entire mobile game realm. Four years ago I started teaching mobile game design and development t o designers and artists with little programming knowledge. The precursor to this was my idea for a university-level mobile game development course winning the Unity educational curriculum challenge. Unity kindly provided my university with Google Nexus One phones and licenses for Unity’s Android plugin. My passion for developing mobile games grew as I saw the power that the Apple had given small indie development teams t o publish their ideas and the ease with which Unity made it possible. Teaching programming to artists is indeed a challenging task. However, when it is presented in an exciting, relevant, and visual way I fi nd students start to push aside their preconceived ideas about writing code. On the fl ip side, a lot of programmers don’t consider themselves to be designers or artists even though they have more than enough sound skills to produce a mobile game on their own. Through the presentation of the design process as an analytical, rule-based activity, the novice artist can easily achieve many visual elements of a game. My motivation for writing this book is to demonstrate the strong bond, in games and indeed other interactive multimedia, between programming, art, and design. My aim is to deliver practical and timely lessons to both the programmer and artist that can empower individuals to explore the realm of mobile game creation right up to the point of publishing their very fi rst app. How This Book is Organized This book has been written for artists and programmers alike who want to learn how to make their own mobile games for the Apple App Store and Google Play by dissecting contemporary mobile games such as Angry Birds , Temple Run , Year Walk , Bejeweled , Minecraft , and more. It approaches mobile game development using a unique combination of lessons on programming and design theory in unison. vi All chapters are structured with theory and practice. There are more than 70 practical exercises that lead the reader through a wide variety of game mechanics, physics, user interfaces and networking examples: • Chapter 1 , “Mobile Game Design and Development,” examines the history of mobile gaming technology, provides an introduction to Unity, and steps the reader through practical exercises to get a simple app built to an iPhone/iPad and Android phone/tablet. Most importantly advice for optimizing game art and code to run smoothly on mobile devices is given. • Chapter 2 , “Procedural Literacy,” reveals the intricate relationship that exists between art and code with a step-by-step Minecraft landscape recreation. It explains the fundamentals of programming and covers the more important mathematics of game environments that all game developers should know. • Chapter 3 , “Mobile Game Interfaces,” presents the principles of mobile game interface design and steps the reader through the creation of apps that demonstrate mobile specifi c interactivity including touch, pinch to zoom, thumbsticks, tilt, and GPS. In addition, tips and tricks are presented for making game interfaces look good on all screen sizes and resolutions. • Chapter 4 , “Aesthetics and Visual Literacy,” provides the fl ip-side to Chapter 2, examining design theory with respect to mobile game creation. It presents the essential visual and audio aspects required to develop a game including static textures, animated sprites, special eff ects, and fi nishing touches. • Chapter 5 , “Learning from the Masters: Part One,” closely dissects a multitude of contemporary and successful mobile games including Bejeweled , Year Walk , Fruit Ninja , Harbor Master , and S uper Monkey Ball . The reader is taken, step by step, through recreations of specifi c elements of each game that makes them unique. • Chapter 6 , “Learning from the Masters: Part Two,” examines the use of physics, procedurally generated content, and artifi cial intelligence through hands-on recreations of A ngry Birds , Catapult King , Temple Run , and Curiosity – What’s Inside the Cube? • Chapter 7 , “Multiplayer Experiences,” examines asynchronous and synchronous games through the development of multiplayer games on a single device and over a network. Fundamental computer networking theory is explained to equip the reader with knowledge for sending messages between mobile devices connected to the Internet. • Chapter 8 , “Publishing, Players, and Promotion,” reveals the challenges game developers face in getting their game noticed in the app stores. It provides numerous tips for monetizing and publishing games including the deployment of in-game advertising, in-app purchasing, and social networking with Facebook and Twitter. In addition, step-by-step instructions are given for building and distributing games from Unity via the Apple App Store and Google Play. vii The Companion Website The web site accompanying this book is www.holistic3d.com. It contains all the fi les referred to in the hands-on exercises herein, fi nished examples, and many other teaching and learning resources including instructional videos and PowerPoint slides. Acknowledgements First I would like to thank the reviewers, Mike Daly and Mark Backler. I must say their feedback has been some of the most encouraging and constructive feedback received in the ten years I have been writing. No doubt their thorough revision of my material and advice has made this book all the better. Next, I acknowledge Unity3d for their fantastic game engine. The types of games developers are making with it is truly inspirational and I hope together with the content of this book and my previous one, Holistic Game Development , a new generation of game designers feel empowered to continue providing high quality, unique mobile gaming experiences. I also greatly appreciate all members of the Unity community who regularly contribute to the forums at http://forums.unity3d.com as they are an invaluable knowledge base. I’d also like to thank my games design students at Bond University who’ve acted as guinea pigs for all the exercises contained herein. Observing the use of the step-by-step activities in a classroom environment has helped to iron out any issues as well as pick up coding typos. My friends James, Kayleen, Sian, Mark, and Jeff likewise deserve a big thanks for their continued encouragement and belief in my abilities, acting as shoulders to cry on and providing a touch of reality when required. Special thanks to James for his exception abilities and help with Adobe Illustrator, Photoshop, and Maya, and Kayleen’s enthusiasm for contributing the accompanying PowerPoint slides. Finally, the biggest thanks go to my family, Daniel, Tabytha, and Merlin the Labrador. They have all been so supportive and understanding during the times I’ve locked myself in the offi ce cursing at code and furiously writing to meet deadlines. Daniel has been a massive support throughout this project. His partnership in editing and testing all the exercises is always invaluable. This book would not have made it to the shelves without him. He is an absolute wiz with Microsoft Word and has an uncanny knack for fi nding logic errors in code. Tabytha (aged ten) has been perfect at keeping me grounded, bringing me out of my workaholic habits with games of Monopoly, Uno, and getting me to fi nd her cheat codes for T he Sims or fi guring out why her Minecraft world has gone missing. There are more important things in life than constantly working and in her own way she is teaching me to relax. As viii always, Merlin has provided daily emotional support as a foot-warmer evidenced by the dog-shaped silhouette in the carpet under my desk. As a programmer and artist, nothing excites me more than being about to use code to produce art. To me games are the perfect medium through which one can really express one’s creative urges. If you are reading this, I shall assume you feel the same. I sincerely hope you enjoy reading this book and learn something new and useful with each page. ix
Description: