Learning Unity 2D Game Development by Example written by Venita Pereira published by Packt Publishing is quite a wonderful introduction to not only Unity itself but the new 2D game development suite it recently added. I had been meaning to checkout the 2D Unity mode myself for quite some time, and this book gave me a proper introduction.
After being a major supporter of Construct 2, mainly due to how easy it is to approach for new comers and the fully featured sprite editors, I can now easily recommend Unity as well.
Read on to find out why.
First let me forewarn that the first couple of chapters of the book are not at all for anyone who has been using Unity 3D for awhile. The book immediately covers the basics of the Unity UI and even intro-to-programming basics. Although you might find some value lost here, I find this to be very thorough in ensuring that everyone is one the same page by the time they reach about Chapter 6 so it isn’t necessarily a bad thing.
For the most part, Unity 2D is exactly the same layout and functions of Unity 3D. Its the submenus and components that have largely changed. They now include wonderful features such as 2D colliders and sprite editors. The book immediately does a great job of explaining how sprite slicing in the Sprite Editor works, texture atlasing, using the Animator with sprites, and almost everything inbetween.
Surprisingly the book goes briefly into talking about the Unity programming languages – C#, Unityscript, Boo, but also assumes the reader doesn’t know what a programming language even is too. It talks about assembly and how the compiler works briefly. This stuff is great for beginners, but I found it to be maybe a little out of place. If someone has made it this far, I imagine they would at least know what programming is to some extent and if not then maybe their knowledge of how C becomes machine code is necessary here. Or what input and output is. But it’s great knowledge to have here anyway, so maybe I’m just being picky. There is some good explanation of functions, conditionals, classes, ect.
The book is called “By Example” so naturally the book’s major focus is providing boilerplates for traditional games. Tutorials and even completed solutions & code for a Roguelike, a classic arcade avoid-falling-debris, an endless runner, a physics-driven cannonball shooter, and even a co-op game are provided. The examples are quite extensive and I once again find it great that Packt allows the authors to provide the completed code along with the book download. They’re particularly helpful, although, maybe not for the best of reasons in this case. More on that later.
I think about two years ago I read a similar “Learning Unity 3D Game Development by Example” from Packt and I learned a ton from it. Same here. These’s skeletons are great divingboards for people who want to run off with their own crazy ideas. You can take any one of these examples and try your own features in them, the book encourages that. This is a great for both newcomers and returning Unity 3D vets who might be stubborn or something to try the 2D mode. Its really extensive and I had fun replicating some of these examples. The physics example highlights Box2D, which is the popular physics engine that AngryBirds uses. I want to go back to some of my Construct 2 projects and try to convert them into Unity now!
Click here to play the Roguelike example. I did this in less than an hour with the book!
Going back to the issue I briefly hinted at earlier with the code, the book does a good job of documenting steps and providing screenshots. However, there are some occasional details that get left out. In the first example, the Roguelike game, I found several mishaps. The first being is that sometimes the book would refer to information that wasn’t mentioned previously. For example, it would say “refer back to how we made the idle animation earlier.” I couldn’t find how that idle animation was made previously, it wasn’t covered. Another issue I found was that after quintuple checking my code, my magic orb spell wasn’t working ingame and the enemy would fly off the map. Definitely looked like rigidbody problems. After comparing my Rigidbody2D settings in my solution to the author’s solution, I found the setting of Is Kinematic enabled in the author’s for the orb enabled. And the enemy had a gravity setting of 0. The default in Unity 2D, for me anyway on a fresh install of 4.5.4 was disabled on Is Kinematic and a gravity of 1 for Rigidbody2Ds. Took a bit of time to find them. And they certainly were not mentioned! This could be really jarring for new comers, to the point where they might just quit entirely because they’ve exhausted themselves reading the book’s steps a dozen times over with no solution. For returning Unity 3D users, this is kind of common and perhaps obvious to look out for signs of.
That being said, I found very little issue elsewhere and the results are all great. I will be recommending this book to the new students at my college and perhaps even the Computer Science school’s game programming course instructors.
- Easy-to-follow book for only $10 ebook (great value)
- Well done examples that are excellent boilerplate to spin new ideas off of
- Detailed explanation of how to utilize new features such as Sprite Editor
- Assets and code provided
- Pictures document most steps and menus
- Welcoming to all levels of programming
- Some of the beginner content, such as what assembly is, may be somewhat unnecessary for the scope of the book.
- Missing instructions can be a bit of a disaster for beginners.
Who for: If you’re interested in getting your feet wet with Unity 2D, or maybe you’re entirely new to Unity!
The book actually recommends 8GB of RAM for ideal Unity use. I can testify that 8GB is a bit excessive! Haha