34,79 €
Unity is one of the biggest game engines in the world, providing the user with a range of important tools that they need to bring their ideas into reality. Beginner game developers are optimistic, passionate, and ambitious, but that ambition can be dangerous! Too often, budding indie developers and hobbyists bite off more than they can chew. Games like Angry Birds, Cut the Rope, and Fruit Ninja are fun, simple games that have delighted players and delivered big profits to their creators. This is the perfect climate for new game developers to succeed by creating simple games with Unity, starting today.
This book teaches you the ins and outs of the unique Unity game engine interface. Clear and concise code examples written in both Unity Javascript and C# take you through the step-by-step process of building five small, functional games. With this understanding you can start making your own mark on the game industry!
With absolutely no programming or game development experience, you will learn how to build five simple games in Unity by following step-by-step instructions, peppered with amusing analogies and anecdotes from an experienced indie developer. Following a primer on simplifying your game ideas to that single “something” that keeps players coming back for more, dive into the Unity game engine by creating a simple bat-and-ball game. From there, you'll build a complete memory game using only the Unity GUI system. After building a 2.5D mouse avoider game, you'll learn how to re-skin the project to completely change the game's theme. Incorporating everything you've learned, you'll return to complete the bat-and-ball game by adding scoring, replay flow, sound effects, and animations. Finally, in the new bonus chapter, you'll program some simple AI (Artificial Intelligence) for a tic tac toe game.
"Unity 4.x Game Development by Example" is a fun and light-hearted exploration of one of the most powerful game engines on the market today. Find out what all the fuss is about by getting up to speed using this book!
Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:
Seitenzahl: 620
Veröffentlichungsjahr: 2013
Copyright © 2013 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: September 2010
Second edition: September 2011
Third edition: December 2013
Production Reference: 1191213
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-84969-526-8
www.packtpub.com
Cover Image by Dan John Cox (<http://danjohncox.tumblr.com/>)
Author
Ryan Henson Creighton
Reviewers
Trond Abusdal
Huzaifa Arab
John Hutchinson
Wei Wang
Acquisition Editors
Wilson D'souza
Mary Jasmine Nadar
Owen Roberts
Lead Technical Editors
Owen Roberts
Poonam Jain
Technical Editors
Tanvi Bhatt
Akashdeep Kundu
Edwin Moses
Nikhil Potdukhe
Tarunveer Shetty
Faisal Siddiqui
Sonali Vernekar
Project Coordinator
Venitha Cutinho
Proofreaders
Elinor Perry-Smith
Mario Cecere
Bridget Braund
Indexers
Mariammal Chettiyar
Mehreen Deshmukh
Rekha Nair
Tejal Soni
Graphics
Sheetal Aute
Production Coordinator
Nitesh Thakur
Cover Work
Nitesh Thakur
Ryan Henson Creighton is a veteran game developer, and the founder of Untold Entertainment Inc. (http://www.untoldentertainment.com) where he creatively consults on games and applications. Untold Entertainment creates fantastically fun interactive experiences for players of all ages. Prior to founding Untold, Ryan worked as the Senior Game Developer at Canadian media conglomerate Corus Entertainment, where he created over fifty advergames and original properties for the YTV, Treehouse TV, and W networks. Ryan is the co-creator of Sissy's Magical Ponycorn Adventure, the game he authored with his then five-year-old daughter Cassandra. Ryan is the Vice President of the IGDA Toronto Chapter. He is also the author of the book that you are currently reading.
When Ryan is not developing games, he's goofing off with his two little girls and his fun-loving wife in downtown Toronto.
Big thanks to Cheryl, Cassandra, and Isabel for their love, their support, and their cinnamon rolls. Thanks to Jean-Guy Niquet for introducing me to Unity; to Jim "McMajorSupporter" McGinley for help with the book outline and ongoing mentorship; to the technical reviewers and Packt Publishing staff for letting me leave a few jokes in the book; and to David Barnes, for having such a great sense of humor in the first place. Special thanks to Michael Garforth and friends from the #unity3d IRC channel on Freenode. I also want to thank Mom, God, and all the usual suspects.
Trond Abusdal, though having been interested in computers since his parents bought him and his brother a C64 in the early 90s, he first got into programming years later when writing a modification for Quake2 with a childhood friend.
This interest lead to a bachelor's degree in Computer Science in 2006, after which he started working for TerraVision, a company using game technologies as a tool for education and visualization. In 2008, he first got introduced to Unity, which is still his main game development tool, although knowledge of other technologies and tools often come in handy.
Since 2010, he is a programmer and more recently a partner at Rock Pocket Games, which makes games for a variety of different platforms, both client projects and internal projects.
Huzaifa Arab is a Game Designer by choice and a Game Programmer by need. He has been playing games since young age, which progressed to Modding/Map-making/Scripting, when he realized that some games could be a whole lot more fun if he could put his own twist in them. And so, his hobby became a professional career choice after formally graduating from DSK Supinfogame, India (where his team won the prestigious Square Enix Game Dev Competition). After a year of freelance Game Development, he currently works at Tiny Mogul Games, India, as a Principal Game Designer.
He loves to connect with people interested in Human Computer Interface, Game Engines/VR Tech, Game Design in Education, and Instrumental music. You can drop him a line at <[email protected]>.
I would like to thank Packt Publishing for giving me an opportunity to review a book on Unity 3D, a technology I am so passionate about. I would like to thank my best friend Angad for recommending me to Packt Publishing and I would like to thank my family and co-workers/friends for their support as I took time out to review such a wonderful book.
John Hutchinson is the founder of Rubber Ducky Games, an independent game development studio based in California.
In addition to being an exceptional programmer in multiple languages and frameworks, he is an experienced graphic designer, talented game system architect and gets excited about experience-focused design (and rubber duckies).
He is especially interested in games which push the boundaries of twitch-reflex response, explore human emotion, or leverage the interactive medium for more powerful learning experiences.
He is currently working with Making Friends Inc. as Lead Engineer and as part of the core design team, to deliver a game intent on teaching kids on the Autism-Asperger's spectrum valuable social skills.
When his face isn't glued to a computer screen he likes to play with his kids, explore board game design, and read technical books like this one.
Thanks to my brothers, for providing feedback (and teaching me some things about games). To my sister, for making me feel like a hero (not a robot). To my parents, for teaching me to be caring and to work my butt off. And to my kids, for just being you. I love you all more than words can express.
Wei Wang made his first iOS casual game with Unity 3D in his college time, which got big success with more than 5 million downloads world-wide. Since then, he has discovered it's a great thing to make great games. After earning his master's degree from Tsinghua University (one of the best universities in China), he joined a game company in Japan and now he is trying to create interesting games with Unity 3D.
Right now, he is a skilled engineer and always eager to learn more. He now lives in Kawasaki with his wife. You can know more about him from his project's page http://project.onevcat.com or find him on his blog http://onevcat.com (Chinese). You can also follow him on twitter @onevcat.
You might want to visit www.PacktPub.com for support files and downloads related to your book.
Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at <[email protected]> for more details.
At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.
http://PacktLib.PacktPub.com
Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can access, read and search across Packt's entire library of books.
If you have an account with Packt at www.PacktPub.com, you can use this to access PacktLib today and view nine entirely free books. Simply use your login credentials for immediate access.
As I sit here in my luxurious velvet smoking jacket, taking a long draw on a pipe, and admiring the various stuffed hunting trophies around the room in an attitude of quiet contemplation, it dawns on me that I don't smoke or advocate sport-hunting, and that I have no idea what I'm doing in this room. The jacket, however, is quite nice. I think I'll keep it.
It's wonderful to see that this book, one of the very first instructional guides about Unity 3D on the market, has withstood both the test of time, and Unity Technologies' relentless release schedule. Owing to the rapid pace of technology, many things have changed in a few short years. C# has largely overtaken UnityScript as a preferred language; to that end, all of the code in the book has been supplemented with a C# translation, including notes on how to perform that translation yourself for past and future projects.
In the time since the first edition, computers have increasingly become our evil, dominating overlords. With that in mind, the third edition includes two bonus chapters that teach you how to build a two-player game, and then how to program the computer to act as the merciless second player who never loses. That chapter also contains information on how to make the computer player lose, which I present as secret codified data to be used by the resistance movement during the inevitable machine uprising. Stay ever vigilant!
"Game Developer" has rapidly replaced "firetruck" as the number one thing that kids want to be when they grow up. Gone are the days when aspiring developers needed a university education, a stack of punch cards, and a room-sized computer to program a simple game. With digital distribution and the availability of inexpensive (or free) game development tools like Unity 3D, the democratization of game development is well underway.
But just as becoming a firetruck is fraught with peril, so too is game development. Too often, aspiring developers underestimate the sheer enormity of the multidisciplinary task ahead of them. They bite off far more than they can chew, and eventually drift away from their game development dreams to become lawyers or dental hygienists. It's tragic. This book bridges the gap between "I wanna make games!" and "I just made a bunch of games!" by focusing on small, simple projects that you can complete before you reach the bottom of a bag of corn chips.
Chapter 1, That's One Fancy Hammer!, introduces you to Unity 3D—an amazing game engine and game authoring tool that enables you to create games and deploy them to a number of different devices. You'll play a number of browser-based Unity 3D games to get a sense of what the engine can handle, from a massively-multiplayer online game all the way down to a simple kart racer. You'll download and install your own copy of Unity 3D, and mess around with one of the demos that ships with the product.
Chapter 2, Let's Start with the Sky, explores the difference between a game's skin and its mechanic. Using examples from video game history, including Worms, Mario Tennis, and Scorched Earth, we'll uncover the small, singular piece of joy upon which more complicated and impressive games are based. By concentrating on the building blocks of video games, we'll learn how to distil an unwieldy behemoth of a game concept down to a manageable starter project.
Chapter 3, Game #1 – Ticker Taker, puts you in the pilot seat of your first Unity 3D game project. We'll explore the Unity environment and learn how to create and place primitives, add Components like Physic Materials and rigidbodies, and make a ball bounce on a paddle using Unity's built-in physics engine without ever breaking a sweat.
Chapter 4, Code Comfort, continues the keep-up game project by gently introducing scripting. Just by writing a few simple, thoroughly-explained lines of code, you can make the paddle follow the mouse around the screen to add some interactivity to the game. This chapter includes a crash course in game scripting that will renew your excitement for programming where high school computer classes may have failed you.
Chapter 5, Game #2 – Robot Repair, introduces an often-overlooked aspect of game development—"front-of-house" User Interface design—the buttons, logos, screens, dials, bars, and sliders that sit in front of your game—is a complete discipline unto itself. Unity 3D includes a very meaty Graphical User Interface system that allows you to create controls and fiddly bits to usher your players through your game. We'll explore this system, and start building a complete two-dimensional game with it! By the end of this chapter, you'll be halfway to completing Robot Repair, a colorful matching game with a twist.
Chapter 6, Game #2 – Robot Repair Part 2, picks up where the last chapter left off. We'll add interactivity to our GUI-based game, and add important tools to our game development tool belt, including drawing random numbers and limiting player control. When you're finished with this chapter, you'll have a completely playable game using only the Unity GUI system, and you'll have enough initial knowledge to explore the system yourself to create new control schemes for your games.
Chapter 7, Don't Be a Clock Blocker, is a standalone chapter that shows you how to build three different game clocks—a number-based clock, a depleting bar clock, and a cool pie wedge clock, all of which use the same underlying code. You can then add one of these clocks to any of the game projects in this book, or reuse the code in a game of your own.
Chapter 8, Hearty Har Har, revisits the keep-up game from earlier chapters and replaces the simple primitives with 3D models. You'll learn how to create materials and apply them to models that you import from external art packages. You'll also learn how to detect collisions between game objects, and how to print score results to the screen. By the end of this chapter, you'll be well on your way to building Ticker Taker—a game where you bounce a still-beating human heart on a hospital dinner tray in a mad dash for the transplant ward!
Chapter 9, Game #3 – The Break-Up, is a wild ride through Unity's built-in particle system that enables you to create effects like smoke, fire, water, explosions, and magic. We'll learn how to add sparks and explosions to a 3D bomb model, and how to use scripting to play and stop animations on a 3D character. You'll need to know this stuff to complete The Break-Up—a catch game that has your character grabbing falling beer steins and dodging explosives tossed out the window by his jilted girlfriend.
Chapter 10, Game #3 – The Break-Up Part 2, completes The Break-Up game from the previous chapter. You'll learn how to reuse scripts on multiple different game objects, and how to build Prefabs, which enable you to modify a whole army of objects with a single click. You'll also learn to add sound effects to your games for a much more engaging experience.
Chapter 11, Game #4 – Shoot the Moon, fulfills the promise of Chapter 2, Let's Start with the Sky, by taking you through a re-skin exercise on The Break-Up. By swapping out a few models, changing the background, and adding a shooting mechanic, you'll turn a game about catching beer steins on terra firma into an action-packed space shooter! In this chapter, you'll learn how to set up a two-camera composite shot, how to use code to animate game objects, and how to re-jig your code to save time and effort.
Chapter 12, Game #5 – Kisses 'n' Hugs, teaches you to build a two-player 3D Tic Tac Toe game entirely within the Unity 3D game authoring tool. You'll learn about writing return values for your custom functions, and using 3D objects to build an essentially 2D game. This simple strategy game forms the basis for the following chapter.
Chapter 13, AI Programming and World Domination, steps you through the process of developing an artificial intelligence program, enabling your computer to win at Tic Tac Toe. From there, you'll modify the terrifyingly perfect AI algorithm so that it randomly makes "mistakes", and gives humankind a slim chance at Tic Tac Toe survival.
Chapter 14, Action!, takes you triumphantly back to Ticker Taker for the coup de grace—a bouncing camera rig built with Unity's built-in animation system that flies through a model of a hospital interior. By using the two-camera composite from The Break-Up, you'll create the illusion that the player is actually running through the hospital bouncing a heart on a tin tray. The chapter ends with a refresher on bundling your project and deploying it to the Web so that your millions of adoring fans (including your grandma) can finally experience your masterpiece.
Appendix is an essentially vestigial component of the colon, which can be surgically removed if it gives you any trouble.
You'll need to be in possession of a sturdy hat, a desk chair equipped with a seatbelt, and an array of delicious snack foods that won't get these pages all cheesy (if you're reading the e-book version, you're all set). Early chapters walk you through downloading and installing Unity 3D (http://unity3d.com/unity/download/). A list of resources and links to additional software can be found in the Appendix.
If you've ever wanted to develop games, but have never felt "smart" enough to deal with complex programming, this book is for you. It's also a great kick start for developers coming from other tools like Flash, Unreal Engine, and Game Maker Pro.
Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.
To send us general feedback, simply send an e-mail to <[email protected]>, and mention the book title through the subject of your message.
If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.
Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.
We also provide you a PDF file that has color images of the screenshots/diagrams used in this book. The color images will help you better understand the changes in the output. You can download this file from https://www.packtpub.com/sites/default/files/downloads/5268OT_ColoredImages.pdf
You can download the example code files for all Packt books you have purchased from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you. Each project in the book is intended to be built from the "ground up", beginning with an new project file. The downloadable .unitypackage files for this book contain the assets (sounds, images, and models) you need to build the projects. You may also download completed, working versions of each project for your reference, though these are not intended to be your "first stop" – they're more like the answer sheet at the back of a text book.
Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/support, selecting your book, clicking on the errata submission form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website, or added to any list of existing errata, under the Errata section of that title.
Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.
Please contact us at <[email protected]> with a link to the suspected pirated material.
We appreciate your help in protecting our authors, and our ability to bring you valuable content.
You can contact us at <[email protected]> if you are having a problem with any aspect of the book, and we will do our best to address it.
Technology is a tool. It helps us accomplish amazing things, hopefully more quickly, more easily, and more amazingly than if we hadn't used the tool. Before we had newfangled steam-powered hammering machines, we had hammers. And before we had hammers, we had the painful process of smacking a nail into a board with our bare hands. Technology is all about making our lives better and easier. And less painful.
Unity 3D is a piece of technology that strives to make life better and easier for game developers. Unity is a game engine, and a game authoring tool, which enables creative folks like you to build video games.
By using Unity, you can build video games more quickly and easily than ever before. In the past, building games required an enormous stack of punch cards, a computer that filled a whole room, and a burnt sacrificial offering to an ancient god named Fortran. Today, instead of spanking nails into boards with your palm, you have Unity. Consider it your hammer—a new piece of technology for your creative tool belt.
You may have heard people call Unity and other tools "game engines". That's almost correct. The confusion here comes from the fact that we have three distinct things, and we call them all "Unity".
When you download Unity, as you'll do in a moment, you're downloading the Unity 3D game authoring tool. To use a car analogy, the authoring tool works like your auto body shop. You use it to design and build the car's chassis, its handling, and its sweet, sweet leather interior and boss rims.
Under the hood, the authoring tool uses the Unity game engine, which is like the driving force behind your game. Unless you work out a pricy licensing deal with Unity Technologies, you are not allowed to mess around with the engine itself, but the engine is the piece that makes your car run.
When you're finished designing your game with the Unity authoring tool, your content gets bundled with the Unity game engine, and the two of them are packaged together with an extra piece that enables the game to run in a certain situation. The analogy gets weaker here, but consider tires: you can add snow tires to your car so that it can drive in the tundra, or dune buggy tires so that it can drive in the desert. In this way, you package your game content with a certain target platform in mind: PC, Mac, iOS, Android, or one of the various home video game consoles.
Throughout this book, we'll be distilling our game development dreams down to small, bite-sized nuggets instead of launching into any sweepingly epic open-world game. The idea here is to focus on something you can actually finish instead of getting bogged down in an impossibly ambitious opus. This book will teach you how to build five games, each of which focuses on a small, simple gameplay mechanic. You'll learn how to build discrete pieces of functionality that you can apply to each project, filling the games out to make them complete experiences. When you're finished, you can publish these games on the web, Mac, PC, and Linux systems. If you spring for an additional software license for one of Unity's many add-ons, you may be able to publish your games for other platforms, including home video game consoles.
The team behind Unity 3D is constantly working on packages and export options ("snow tires") for other platforms. At the time of this writing, Unity could additionally create games that can be played on iOS, Android devices, Xbox One, PS4, and Wii U. Each of these tools is an add-on functionality to the core Unity package, and comes with an additional cost, while console development usually requires a developer relationship with the platform owner. These licenses are constantly in flux, however, and the mobile development add-ons that used to cost an additional fee are now free. By the time you read this book, who knows? To be safe, we'll stick to the core Unity 3D program for the remainder of this book.
With the initial skills that you learn in this book, you'll be able to expand on your knowledge to start building more and more complex projects. The key is to start with something you can finish, and then for each new project that you build, to add small pieces of functionality that challenge you and expand your knowledge. Any successful plan for world domination begins by drawing a territorial border in your backyard; consider this book as your backyard.
There are a great many game authoring tools, engines, and frameworks that you may have explored or read about before investigating Unity 3D. What makes Unity an attractive option? Here are a few selling points:
Of course, no game development tool is perfect, and in certain areas, other tools have the advantage over Unity. Here are a few places where Unity doesn't stack up against its rivals:
One of Unity's most astonishing capabilities is that it can deliver a full 3D game experience right inside your web browser. It does this with theUnity Web Player—a free browser plugin that embeds and runs Unity content on the web.
Before you dive into the world of Unity games, download the Unity Web Player. Much the same way the Flash player runs Flash-created content, the Unity Web Player is a plugin that runs Unity-created content in your web browser.
Now that you've installed the Web Player, you can view the content created with the Unity 3D authoring tool in your browser.
In order to fully appreciate how fancy this new hammer is, let's take a look at some projects that other people have created with Unity. While these games may be completely out of our reach at the moment, let's find out how game developers have pushed this amazing tool to its very limits.
The first stop on our whirlwind Unity tour is FusionFall—a Massively Multiplayer Online Role-Playing Game (MMORPG). You can find it at fusionfall.com.
FusionFall was commissioned by the Cartoon Network teevee franchise, and takes place in a re-imagined, anime-style world where popular Cartoon Network characters are all grown up. Darker, more sophisticated versions of The Powerpuff Girls, Dexter's Laboratory, Foster's Home for Imaginary Friends, and the kids from Codename: Kids Next Door run around battling a slimy green alien menace.
While it's not the newest game on our tour, FusionFall remains one of the largest, most expensive and technically complex Unity games around. FusionFall is historically important to Unity Technologies, as it helped draw a lot of attention to the then-unknown Unity game engine when the game was released. As a tech demo, it's one of the very best showcases of what your new technological hammer can really do! FusionFall has real-time multiplayer networking, chat, quests, combat, inventory, NPCs (non-player characters), basic AI (artificial intelligence), name generation, avatar creation and costumes. And that's just a highlight of the game's feature set. This game packs a lot of depth.
At this point, you might be thinking to yourself, "Heck YES! FusionFall is exactly the kind of game I want to create with Unity, and this book is going to show me how!"
Unfortunately, a step-by-step guide to creating a game the size and scope of FusionFall would likely require its own flatbed truck to transport, and you'd need a few friends to help you turn each enormous page. It would take you the rest of your life to read, and on your deathbed, you'd finally realize the grave error that you had made in ordering it online in the first place, despite having qualified for free shipping.
Here's why: the FusionFall credits
http://fusionfall.cartoonnetwork.com/game/credits.php
This page lists all of the people involved in bringing the game to life. Cartoon Network enlisted the help of an experienced Korean MMO developer called Grigon Entertainment. There are over 80 names on that credits list! Clearly, only two courses of action are available to you:
Before you do something rash and abandon game development for farming, let's take another look at this. FusionFall is very impressive, and it might look a lot like the game that you've always dreamed of making. This book is not about crushing your dreams. It's about dialing down your expectations, putting those dreams in an airtight jar, and taking baby steps. Confucius said:
"A journey of a thousand miles begins with a single step."
I don't know much about the man's hobbies, but if he was into video games, he might have said something similar about them—creating a game with a thousand awesome features begins by creating a single, less feature-rich game.
So, let's put the FusionFall dream in an airtight jar and come back to it when we're ready. We'll take a look at some smaller Unity 3D game examples and talk about what it took to build them.
No tour of Unity 3D games would be complete without a trip to Blurst.com—the game portal owned and operated by independent game developer Flashbang Studios. In addition to hosting games by other independent game developers, Flashbang has packed Blurst with its own slate of kooky content, including Off-Road Velociraptor Safari:
In Off-Road Velociraptor Safari, you play with a dinosaur in a pith helmet and a monocle driving a jeep equipped with a deadly spiked ball on a chain (just like in the archaeology textbooks). Your goal is to spin around in your jeep doing tricks and murdering your fellow dinosaurs (obviously).
For many independent game developers and reviewers, Off-Road Velociraptor Safari was their first introduction to Unity. Some reviewers said that they were stunned that a fully 3D game could play in the browser. Other reviewers were a little bummed that the game was sluggish on slower computers. We'll talk about optimization a little later, but it's not too early to keep performance in mind as you start out.
If you play Off-Road Velociraptor Safari and some of the other games on the Blurst site, you'll get a better sense of what you can do with Unity without a team of experienced Korean MMO developers. The game has 3D models, physics (code that controls how things move around somewhat realistically), collisions (code that detects when things hit each other), music, and sound effects. Just like FusionFall, the game can be played in the browser with the Unity Web Player plugin. Flashbang Studios also sells downloadable versions of its games, demonstrating that Unity can produce standalone executable game files too.
Right then! We can't create FusionFall just yet, but we can surely create a tiny game like Off-Road Velociraptor Safari, right? Well... no. Again, this book isn't about crushing your game development dreams. But the fact remains that Off-Road Velociraptor Safari took five supremely talented and experienced guys eight weeks to build on full-time hours, and they've been tweaking and improving it ever since. Even a game like this, which may seem quite small in comparison to full-blown MMO like FusionFall, is a daunting challenge for a solo developer. Put it in a jar up on the shelf, and let's take a look at something you'll have more success with.
Wooglie.com is a Unity game portal hosted by M2H Game Studio in the Netherlands. One glance at the front page will tell you that it's a far different portal thanBlurst.com. Many of the Wooglie games are rough around the edges, and lack the sophistication and slick professional sheen of the games on Blurst. But here is where we'll make our start with Unity. This is exactly where you need to begin as a new game developer, or as someone approaching a new piece of technology like Unity.
Play through a selection of games on Wooglie. I'll highlight a few of them for your interest:
Big Fun Racing is a simple but effective game where you zip around collecting coins in a toy truck. It features a number of different levels and unlockable vehicles. The game designer sunk a few months into the game in his off-hours, with a little help from outsource artists to create the vehicle models.
Diceworksis a very simple, well-polished game designed in Unity 3D for iPhones. We won't be covering any iPhone development, but it's good to know that your Unity content can be deployed to a number of other devices and platforms.
Diceworks was created by one artist and one programmer working together as a team. It's rare to find a single person who possesses both programming and artistic talent simultaneously; scientists say that these disciplines are split between two different lobes in our brains, and we tend to favor one or the other. The artist-programmer pairing that produced Diceworks is a common setup in game development. What's your own brain telling you? Are you more comfy with visuals or logic? Art or programming? Once you discover the answer, it's not a bad plan to find someone to make up the other half of your brain so that your game handles both areas competently.
At any event, with Diceworks we're definitely getting closer to the scope and scale that you can manage on your own as you start out with Unity.
It's also interesting to note that Diceworks is a 2D game created in a 3D engine. The third "D" is largely missing, and all of the game elements appear to exist on a flat plane. Nixing that extra dimension when you're just starting out isn't a half-bad idea. Adding depth to your game brings a whole new dimension of difficulty to your designs, and it will be easier to get up and running with Unity by focusing on the X and Y axes, and leaving the Z-axis in one of those dream jars. With a few sturdy working game examples under your belt, it won't be long before you can take that Z-jar down off the shelf and pop it open. The games that we'll be building in this book will stick to a two-dimensional plane, using three-dimensional models. Even so, certain games have taken this concept and ran with it: New Super Mario Bros. Wii locked its 3D characters to a 2D plane and wound up an extremely complex and satisfying platformer.
With their game Lovers in a Dangerous Spacetime, the talented three-person team at the Asteroid Base adds half a "D" to that formula. This is a two-and-a-half-D game, which combines the advantages of a 2D game with all the eye-popping pizzazz of all 3Ds.
Unity portals—game sites that feature Unity-made games—are popping up all over the place. Here are a few more sites to hit in your survey of what Unity can do:
http://unity3d.com/gallery/made-with-unity/game-list
Unity's own showcase of games features titles that aren't all playable, but they're sure to blow your mind.
http://www.kongregate.com/unity-games
Once the king of Flash game portals, Kongregate also features Unity-made games. Any developer can submit a game to Kongregate, and once the game is live, the Kongregate community can play, rate, and comment on it. If you're a first-time developer, that may sound a little scary. And if you're a veteran developer, you know exactly how scary it is! But an excellent goal for you to set, after reading this book, is to develop something of your own in Unity, and submit it to the scrutiny of complete strangers on a portal like Kongregate. Let's be honest... Mom is going to like everything you do. This may be your best shot at getting honest feedback, and it will help you grow as a developer.
Unity
