Book Image

Getting Started with Unity 2018 - Third Edition

By : Dr. Edward Lavieri
Book Image

Getting Started with Unity 2018 - Third Edition

By: Dr. Edward Lavieri

Overview of this book

The Unity game engine has revolutionized the gaming industry with its complete set of intuitive tools and rapid workflows, which can be used to create interactive 3D content. With Unity, you can scaffold your way from the basics and make make stunning interactive games. This book will guide you through the entire process of creating a 3D game, from downloading the Unity game engine to publishing your game. It not only gives you a strong foundation, but puts you on the path to game development. Beginning with an overview of the Unity engine and its interface, you will walk through the process of creating a game environment and learn how to use built-in assets, as well as assets created with third-party 3D modeling tools such as Blender. Moving on, you will create custom scripts to control non-player character behaviors and gameplay. You will master exciting concepts such as Heads-Up-Displays, mini-maps, game navigation, sound effects, and lighting effects. Next, you’ll learn how to create your first VR experience, right from setting up the project to image effects. You'll be familiarized with all the tools that Unity has to offer to create your own immersive VR experiences. Each section is a stepping stone toward the completion of the final game. By the end of the book, you'll have learned advanced topics such as cross-platform considerations which enable your games to run on multiple platforms.
Table of Contents (21 chapters)
Title Page
Dedication
Packt Upsell
Contributors
Preface
Index

Game engine overview


A game engine can be defined as a set of tools that provide the functionality you need to develop and deploy video games. There is no single industry-accepted definition for game engines. That is largely due to the varied nature of them and their uses. Typically, game engines have at least the following set of features:

  • 2D and/or 3D graphic design tools
  • Animation
  • Asset management—the ability to create and import game assets
  • Audio support
  • Cross-platform deployment—games can be made for multiple platforms (such as desktop, mobile, and console)
  • Graphical user interfaces 
  • Networking—support for multiplayer games
  • Physics 
  • Scripting support in one or more languages

The basic concept of game engines is that they provide a powerful set of tools to handle much of the grunt work of game development, allowing developers to focus on game aesthetics and gameplay. In the early days of video games, each game was coded from scratch without a game engine's libraries or capabilities. Instead of reinventing the wheel for each game, game engines started to emerge, making it easier for game studios to churn out games.

Game engines are not general-purpose software suites that can create any game imaginable. They are highly specialized and, although very flexible, are intended for a specific range of game genres. For example, the Ego Game Technology Engine by Codemasters is used primarily for creating racing games; Pyrogenesis, by Wildfire Games, is used for creating real-time-strategy (RTS) games; the Silent Storm Engine, by Nival Interactive, is used predominately for turn-base tactics games; and ONScripter, by Naomi Takahashi, is used for creating visual novels and first-person adventure games. 

Game engines for specific game genres

There are a plethora of game engines available; many of them are free, some are open source, and others are proprietary. Selecting the right game engine for your game project is a critical pre-development step. Not every game engine will work for your game, and no single game engine will work for every game. Fortunately, we have a lot of options available to us. 

When deciding on which game engine to use for a given game project, consider the typical characterization of games in the primary genre that your game is a part of. 

Note

We use the phrase primary genre because many modern games blur the genre lines and incorporate characteristics of two or more genres. This genre blurring can result in new and innovative games.

First-person shooters (FPS)

This game genre has a long list of successful titles; here are some of them:

  • Battlefield
  • Bioshock
  • Borderlands
  • Call of Duty
  • Destiny
  • Doom
  • HalfLife
  • Halo
  • Left4Dead
  • Overwatch
  • Rainbow Six

FPS games are created with the intent of immersing the player in the game world. They are playing as a character and, to obtain the desired level of immersion, animations, audio, and graphics quality are critically important. Special attention is given to the character's arms and weapons:

These games are typically characterized by the following:

  • Large 3D segmented game worlds (indoors and outdoors)
  • Character travels primarily on foot
  • Some vehicle usage
  • Standard camera and aiming controls
  • Realistic animations
  • Large and realistic inventory of hand-held objects (weaponry)
  • Non-player characters (NPCs) with realistic artificial intelligence
  • Single and multi-player modes

Third-person games

Third-person games are games where the player character is nearly or completely visible in the game scene. This genre includes third-person shooters (TPS) and third-person action/adventure. That means that a considerable effort needs to be focused on a character's appearance and animations. These games are based on the third-person character perspective as illustrated here:

Here are some of the more successful and popular third-person games:

  • Dead Space
  • Gears of War
  • Grand Theft Auto
  • Prince of Persia
  • Rainbow Six
  • Resident Evil
  • SOCOM
  • Splinter Cell
  • Uncharted

These games are typically characterized by the following, in addition to the characteristics listed in the previous section for FPS games:

  • Emphasis on the player character
  • Camera that follows the player
  • Player-controlled character motion sequences
  • Full-bodied animations
  • Character and camera rotation

Other game genres

There are a large number of other game genres, such as shooters, platformers, vehicle games, fighting, strategy, war, simulation, and puzzle. The difficulty in identifying a particular game's genre lies in the multiple ways in which game genres are classified. For example, you can have a TPS game that is also a massively multiplayer online game (MMOG) and, because it has a large number of puzzles, it can be added to the puzzle genre.

This is not something to be terribly concerned about. It is important to be able to identify what the key components of your game will be so that you can select the best available game engine for your project.

Available 3D game engines

In this section, we will briefly review selected leading game engines to give you a sense of what is available and what their capabilities are. 

Note

Because the Unity game engine is featured later in this chapter and used throughout this book, it is not covered in this section.

CryENGINE

CryENGINE is developed by Crytek. Interestingly, this game engine was initially created to produce a game demo for Nvidia, a graphics processing unit (GPU) manufacturer and because of that demo's great success, the game (Far Cry) was taken into full production and is now a commercial success. The game engine itself is also very successful.

The engine is freely available along with the full source code. There are no financial obligations for commercial use of CryENGINE such as royalties. This engine is capable of high-quality visuals and excellent performance, and you can develop games for the following platforms:

  • Linux PC
  • Oculus Rift
  • Playstation 4
  • Windows PC
  • Xbox One

For further information on CryENGINE, I recommend Mastering CryENGINE by Packt Publishing: https://www.packtpub.com/game-development/mastering-cryengine.

Lumberyard

Lumberyard is part of the Amazon Web Services (AWS) platform and, at the time of this book's publication, is still in beta. This is a free AAA game engine based on CryENGINE. Lumberyard's unique selling point is that no other game engine offers deep integration with Amazon Web Services and Twitch.

Note

AAA, pronounced "triple-A," games are those with extremely large production and marketing budgets.

With this engine, you can develop for the following platforms:

  • Android
  • HTC Vive
  • iOS
  • Oculus Rift
  • OSVR
  • PC
  • PlayStation 4
  • PlayStation VR
  • Xbox One

For further information on AWS Lumberyard, I recommend Learning AWS Lumberyard Game Development by Packt Publishing: https://www.packtpub.com/game-development/learning-aws-lumberyard-game-development.

Microsoft's XNA Game Studio

Microsoft's XNA Game Studio is a set of tools based on Microsoft's .NET framework. It is freely available. There are some redistribution restrictions that you will want to review if you plan to use this tool.

With XNA, you can develop for the following platforms:

  • Windows PC
  • Windows Phone
  • Xbox 360 

For further information on XNA, I recommend Microsoft XNA 4.0 Game Development Cookbook by Packt Publishing: https://www.packtpub.com/game-development/microsoft-xna-40-game-development-cookbook.

Unreal game engine

The Unreal game engine, by Epic Games, started as a first-person shooter (FPS) game nearly 20 years ago. Since that time, the Unreal game engine has significantly evolved and is now a freely-available AAA game engine. You can develop games with Unreal using C++ or Blueprints, a visual scripting system.

Unreal comes with several templates that make getting started very easy. These are:

  • 2D File Scroller
  • First Person
  • Flying
  • Puzzle
  • Rolling
  • Side Scroller
  • Third Person
  • Top Down
  • Twin Stick Shooter
  • Vehicle
  • Vehicle Advanced

With Unreal, you can develop for the following platforms:

  • Android
  • Daydream
  • HTML 5
  • iOS
  • Linux
  • macOS
  • Nintendo Switch
  • Oculus Rift
  • PlayStation 4
  • PlayStation VR
  • Samsung Gear VR
  • Steam
  • Viveport
  • Windows PC
  • Xbox One

For furtherinformation on Unreal, I recommend Unreal Engine: Game Development from A to Z by Packt Publishing: https://www.packtpub.com/game-development/unreal-engine-game-development-z.