In this chapter, we will learn why Unity is a good game engine to start out with. There are lots of ways to begin a game development career, so choosing the proper tool to do so is a huge first step. Then, we will see how to install Unity and create a project with Unity Hub, a tool that manages different Unity installations and projects, helping us to deal with a whole host of them.
Specifically, we will examine the following concepts in this chapter:
Let's start by talking about why you should choose Unity to start your game development career.
When you want to create a game, you have several ways to do so, each with their pros and cons. So, why choose Unity? In this section, we will discuss the reasons for this, providing an overview of the previous and the current industry state, and specifically seeing the following concepts:
At the beginning, users struggled with devices with limited resources but simple game designs. As the industry evolved, the hardware became more powerful and the games more complex than before. A big AAA game title requires almost 200 developers, working on different areas of the game. Each one of those roles requires years of experience, making games an expensive and risky task: you never know whether a game is going to be a success or a big waste of money. For these reasons, it was very difficult for a single person to make an entire game.
Important Note:
AAA games are created by lots of people working in big companies, and this usually costs millions of dollars. There are also AA games, which denote the difference in team size and budget.
In the past, a programmer needed to learn how to use lots of tools in order to solve different game development problems. Some tools stopped receiving support from their creators, leaving them with unresolved bugs and features. Because of that, big companies started to hire highly skilled developers to create all those tools, resulting in what is called a game engine. Let's review what this is.
A game engine is a set of different pieces of software that solve game development problems, such as audio, graphics, and physics issues, but that are designed to work together, all operating on the same philosophy. This is important because every team and company has its own way of working. Creating a game engine from scratch is a great task, and only a few big companies are able to do this. The game engines that companies create are usually private, so only the company is allowed to use them. Some companies sell their engine, but the cost is too high. But another way of getting game engines became available a few years ago.
You have probably heard about indie games created by between 1 and 10 developers, but how can such a small team create games? The answer is general-purpose game engines. These are game engines just like the ones that companies create, but they are designed to be a good foundation for every game and provide a toolset ready to be used by anyone in any game. These kinds of engines created a whole generation of enthusiast developers who are now able to develop their own games more easily than before. There were lots of game-engine companies in the past but only a few of these survive today, Unity being one of the most influential ones. But why is that? Let's discuss this further.
Important Note:
Other examples of general-purpose engines are Unreal Engine, Godot, Torque, and CryEngine.
Well, there are lots of potential reasons why Unity is so popular. Let's enumerate a few of them, as follows:
Unity is not all good—it has its cons, and there are other engines out there (such as Unreal Engine 4 or Godot) that compete with Unity over several of those limitations, having some better features than Unity but also having their own caveats. In my opinion, picking Unity or another engine depends on what you are intending to do, and what the technologies are that you are used to using, but at the end of the day, you can do everything you need just with Unity and deal with any weaknesses with the help of their big community. Now that we know about Unity, let's see how to install the engine.
Okay; after all of that, you've decided to go with Unity—great decision! Now, where do we start? Let's start with a simple but necessary first step: installing Unity. It seems like a straightforward first step, but we can discuss a little bit about the proper ways to install it. In this section, we will be looking at the following concepts:
To run Unity 2020, your computer will need to met the next requirements:
Now that we know the requirements, let's discuss the Unity versioning system.
In previous versions of Unity, we used to simply download the installer of a specific Unity version and hit Next until it was installed. But when you use Unity professionally, you need to have several versions of Unity installed because you will be working on different projects made with different versions. You may be wondering why you can't just use the latest Unity version for every project, but there are some problems with that.
In new versions of Unity, there are usually lots of changes about how the engine works, so you may need to rework lots of pieces of the game to upgrade it. Also, you may be using plugins that just haven't adapted to updates yet, so those will stop working. In my personal projects, I am used to doing project upgrades; but just for learning purposes, in a project that has a specific release date, it can take lots of time to upgrade the whole project, and that can push the release date back a lot. Maybe you need a specific feature that comes with an update that will help you a lot. In such a case, the cost of upgrading may be worthwhile, but take into account that most of the time, this doesn't happen.
Managing different projects made with different Unity versions, installing and updating new Unity releases, and so on used to be a huge hassle, but Unity Hub was created just to help us with this, and it has become the default way to install Unity. Let's see more about it.
Unity Hub is a small piece of software you install before installing Unity. It centralizes the management of all your Unity projects and installations. You can get it from the Unity official site. The steps to download it change frequently, but at the time of writing this book, you need to do the following:
Consider that we are using Unity Hub 2.3.2, the latest version at the moment of writing this book. If you use a newer one some steps might change, but the main concepts usually remain. Now that we have Unity Hub installed, we must use it to install a specific Unity version. You can do this with the following steps:
Important Note:
This is the program we will use in Chapter 13, Introduction to Scripting with C#, to create our code. We do not need the other Unity features right now, but you can go back later and install them if you need them.
Remember that the preceding steps may be different in new Unity versions, so just try to follow the flow that Unity designed—most of the time, it is intuitive. Now is the time to create a project using Unity.
Now that we have Unity installed, we can start creating our game. To do so, we first need to create a project, which is basically a folder containing all the files that your game will be composed of. These files are called assets and there are different types of them, such as images, audio, 3D models, script files, and so on. In this section, we will see how to manage a project, addressing the following concepts:
As with Unity installations, we will use Unity Hub to manage projects. We need to follow these steps to create one:
Important Note:
Try to put the project in Dropbox, Google Drive, or any cloud-synchronized folder to make sure you always have the project at hand. This project will grow, so make sure you have enough space in that folder. If you don't have enough space in your hosting service, just skip this. If you know how to use Git, that would be a better option.
Now that we have created the project, let's explore its structure.
We have just opened Unity but we won't start using it until the next chapter. Now, it's time to see how the project folder structure is composed. To do so, we need to open the folder in which we created the project. If you don't remember where this is, you can do the following:
Then, you will see the following folder structure:
If anytime you want to move this project to another PC or send it to a colleague, you can just compress all those files and send it to them as a ZIP file, but not all the folders are necessary all of the time. The important folders are Assets, Packages, and ProjectSettings. The Assets folder will hold all the files we will create and use for our game, so this is a must. We will also configure different Unity systems to tailor the engine to our game. All the settings related to this are in the ProjectSettings folder. Finally, we will install different Unity modules or packages to expand its functionality, so the Packages folder will hold which ones we are using, for Unity to be aware of that. It's not necessary to copy the rest of the folders if you need to move the project elsewhere, but let's at least discuss what the Library folder is.
Unity needs to convert the files we will use into its own format in order to operate, and an example would be audio and graphics. Unity supports MPEG Audio Layer 3 (MP3), Waveform Audio File Format (WAV), Portable Network Graphics (PNG), and Joint Photographic Experts Group (JPG) files (and much more), but prior to using them, they need to be converted into Unity's internal formats. Those converted files will be in the Library folder. If you copy the project without that folder, Unity will simply take the original files in the Assets folder and recreate the Library folder entirely. This process can take time, and the bigger the project, the more time involved.
Take into account that you want to have all the folders Unity created while you are working on the project, so don't delete any of them while doing so, but if you need to move an entire project, you now know exactly what you need to take with you.
In this chapter, we discussed why Unity is a great tool for creating games, comparing it with other engines in the market. This analysis has the intention of helping you choose Unity as your first game development tool. After that, we also reviewed how to install and manage different Unity versions using Unity Hub, and, finally, we saw how to create and manage multiple projects with the same tool. We will use Unity Hub a lot, so it is important to know how to use it initially. Now, we are prepared to dive into the Unity Editor.
In the next chapter, we will start learning the basic Unity tools to author our first-level prototype.