Book Image

Hands-On Unity 2020 Game Development

By : Nicolas Alejandro Borromeo
Book Image

Hands-On Unity 2020 Game Development

By: Nicolas Alejandro Borromeo

Overview of this book

Over the years, the Unity game engine has extended its scope from just being about creating video games to building AR/VR experiences, complex simulations, real-time realistic rendering, films, and serious games for training and education. Its features for implementing gameplay, graphics, and customization using C# programming make Unity a comprehensive platform for developing professional-level, rich experiences. With this book, you'll be able to build impressive Unity projects in a step-by-step manner and apply your knowledge of Unity concepts to create a real-world game. Complete with hands-on tutorials and projects, this easy-to-follow guide will show you how to develop your first complete game using a variety of Unity tools. As you make progress, you'll learn how to make the most of the Unity Editor and create scripts using the C# programming language. This Unity game development book will then take you through integrating graphics, sound, and animations and manipulating physics to create impressive mechanics for your games. You'll also learn how to code a simple AI agent to challenge the user and use profiling tools to ensure that the code runs in a performant way. Finally, you'll get to grips with Unity's AR Foundation for creating AR experiences for 3D apps and games. By the end of this book, you'll have developed a complete game and will have built a solid foundation using Unity's tooling ecosystem to develop game projects of any scale.
Table of Contents (24 chapters)
20
Chapter 20: Building the Project

The difficulty balance

There are a lot of considerations to make when determining how difficult your game should be. If it is too difficult, players will lose interest, and if the game is too easy, it might not appeal to your intended audience. Some games include difficulty levels for users to select from. Other games have multiple levels, each with an increasing level of difficulty. There are several questions that we must contend with in order to achieve our desired difficulty balance.

In this section, we will first look at some questions relating to difficulty balance, followed by our implementation plan.

Difficulty balance questions

There are a lot of questions about our game that we need to consider in our game design. A review of the questions in this section will help us gain an appreciation of the issues that even a simple game such as ours must contend with, in order to achieve the desired difficulty balance.

The first set of questions, listed here, relates to the overall implementation of difficulty in our game:

  • Should we have different levels of difficulty, selectable by the player?
  • What specifically will be different with each difficulty level?
  • Should we have multiple game levels, each with an increased amount of difficulty?
  • What specifically will be different with each game level?

Consider the following questions regarding the Enemies in our game:

  • How many Enemies should be spawned on each wave?
  • At what distance should an Enemy become aware of the Hero?
  • How much damage should an Enemy inflict on the Player with each attack?
  • How much damage can an Enemy endure before it dies?

The next set of questions listed here refers to our playable character, the Hero:

  • How much life should the character have?
  • How much damage will the character take from a single enemy attack?
  • Should the character be able to outrun Enemies?

We also have the base and bullets to account for in our game. Here are a couple of questions for each of those game assets that we will implement in our game. In the case of the base, the questions are as follows:

  • How many attacks should it take for an enemy to destroy a base?
  • What is the ideal max number of enemies spawned in a Wave?
  • Where should Doors and the Base be located in the game environment?

And now, let's talk about questions in the case of Bullets, as follows:

  • At what pace should the player run out of bullets?
  • What will be the maximum number of Bullets the Player can have?
  • How much damage will the bullets inflict on the Enemies?

As you can see, there are several questions that we need to answer as part of our design. Some of the questions may seem redundant as they relate to more than one component in the game. Now, let's answer some of those.

Implementation plan

Based on the questions posed in the last section, we must come up with some answers. So, let's do that here. Our first set of decisions focuses on the overall game concept, as follows:

  • Implement one game level.
  • Provide the user with three game difficulty settings: easy, normal, and hard.

Now that we've decided to create three game levels, we must determine how they will be different. This is easily managed by using a matrix. As we fill in the matrix, we will be able to document answers to most of the previously listed questions. Here is what we will refer to as the Difficulty Implementation Matrix:

Figure 1.7 – Difficulty pass per level

Figure 1.7 – Difficulty pass per level

There will also be a set of decisions that will not change based on the user-selected difficulty level. Here is a list of those decisions:

  • The aggressiveness of the Enemies will not change. We will script them so that if they are aware of the Hero, they will attack him.
  • We will establish a pretty small vision area for the Enemies, making it easy for the Hero to sneak past them and, perhaps more importantly, outrun them.
  • Respawning will be randomized between the spawn points previously identified in the game's mock-up.

It's important to take into account that this is the first balance pass, and we will surely change this based on the testing we will carry out when the game is implemented.

Now, we can say the game design is completed or can we? Actually, the game design never ends; it will keep evolving as the game is developed, but let's keep that for later. Now, let's talk about how we can communicate our great ideas with everyone in our team, using documentation.