Tuesday, November 11, 2014

A great book for creating a 2D rpg in Unity!



                Another Unity game engine book from Packtpub was released in October, “Mastering Unity 2D Game Development” by Simon Jackson.  This is an intermediate to advanced guide to using the 2D features of Unity.  The book centers around creating a 2D RPG complete with world map, a conversation system, a store, and the beginnings of a battle system.  When the book was initially released there were a variety of typos and show-stopping problems with the book and code.  Packtpub has recently reissued the book and code and now everything works well. 
                Chapter 1 is an overview of the updates that occurred in Unity 4.3.  I went through the book using Unity 4.6 beta and had no issues. “Mastering Unity 2D Game Development” is definitely meant for those with some experience using Unity and in particular the C# programming language.  Many links are provided for reference throughout the book; but knowing how to use coroutines and delegates will definitely help you complete the examples in the book.
                Chapters 2 and 3 explain how to set up the foundation of the RPG project and begin with having you create a 2D game character and animate it.  Importing sprites and using the Sprite editor are discussed and then Unity’s Mecanim animation system is explained while the main character gets animated. 
                In chapter 4 the background for your initial scene is created and then populated with some trees, rocks and even store and house sprites.  This chapter also talks about transitioning from the background edges to another scene that you will set-up.  Chapter 5 is a heavily scripting-oriented chapter and has you create some NPCs and then set-up a conversation system.  This chapter also discusses co-routines and how to use them in Unity.
                Chapter 6 discusses places online to have maps drawn for you and alternately gives advice on how to create your own game world map.  The world map for the game is placed in your project and a nice fade-in technique is used to transition between the world map and the local scene for your player.
                In chapter 7 a battle system is created and the book explains how to have goblins randomly spawn in your scene.  In chapter 8 a shop is created so that you can purchase a sword to fight the goblins from chapter 7.  Both chapters discuss the creation of an inventory system and how to add the sword stats as a bonus to the battle system.
                Chapter 9 talks about using a state system for the battle and also programming a user interface system to keep the player informed about the battle.  Everything seemed to work fine using the ‘old’ user interface system in Unity 4.6 beta.  For those that don’t know the UI was quite significantly updated in Unity 4.6; but all the code in the books seems to work fine.
                Chapter 10 is all about creating particle systems for the battles in your RPG and chapter 11 discusses expanding the Unity editor to create some nice menus for your game.  I found chapter 11 a really interesting read as I was not aware that you could expand Unity that much for your own purposes. 
                Chapter 12 concludes the book with information on building your game for different platforms.  There is also a lot of links listed presenting information on a variety of tutorials and tools for working with Unity. 
                This is a great book for Unity and one that I will keep around for reference on how to do a lot of programming in Unity.  I am really pleased that I had a chance to read the book and try the code.  The link to the book on Packtpub is https://www.packtpub.com/game-development/mastering-unity-2d-game-development.  You can also find the download with all the assets for the RPG project there and a PDF that has all the pictures from the book.  Simon Jackson has a website at http://darkgenesis.zenithmoon.com/  and a forum for the book at http://darkgenesis.zenithmoon.com/DarkGenesisForums/forum/book-forums/ .

No comments:

Post a Comment