1.20 Learning Unity game development from 0 - chapter summary

Unknowingly, the series of articles has come to the twentieth article. In this article, we will make a summary of the content of this large chapter.

Features of modern game engines

In the entire dozen or so articles, we actually used the functions of the editor many times, such as drag and drop assignment, etc., used the scene editor to adjust the position of the object, and added functional components to the object on the Inspector.

These are not implemented by writing codes. That is to say, compared with traditional software, modern commercial game engines actually pay more attention to the content creation of what you see is what you get. If everything needs to be developed and written, the development efficiency is extremely high. low.

Therefore, we need our developers to break away from the thinking of changing the code for various things in traditional software, and provide the ability to edit directly on the editor as much as possible. This is not only convenient for other members of the team, but also convenient for ourselves. Quickly tweak logic for trial and error.

GameObjects and Components

Compared with traditional object-oriented programming, especially compared to traditional GUI frameworks that use inheritance to extend functions, modern game engines use more and more components instead of inheritance. One of the main reasons is that game logic There are many changes, and it is difficult to figure out what functions the base class should have and how the subclass should be abstracted at the beginning. In the end, it often leads to the expansion of the base class, or the words of the subclass are not expressive.

In Unity, everything in the scene is based on GameObject, and GameObject only exists as a concept. Almost all of our actual functions come from the components on GameObject. When we need to implement a game logic, the starting point is often to write a component.

Through components, we can access various built-in functions that Unity provides us, such as built-in 3D space position management, built-in physics engine, and built-in rendering functions, all from various components.

Serialization of data

The Unity engine not only provides a set of component functions, but also provides the ability to serialize, which allows us to write logic codes and added resources, which can be included in the packaged content of the game based on references or self-added forms. When the game is running, it can load the corresponding resource according to the reference or the corresponding loading API.

By directly viewing the scene content in text (other resources can also be viewed in this way), we can understand more clearly how our data is stored and how it is referenced, which is helpful for us to understand the entire in-game resource How it is linked and loaded plays a very important role.

Learn to convert from imagination to reality

In fact, it is about the process of learning to conceive a solution. For example, in one of the articles, we explain how to realize the three-person perspective. In fact, it is how to let the three-person view follow the player in the imagination, and then deduce the mathematical information according to the desired rules. , and finally landed in the game. Maybe there are many standard writing methods for the three-person perspective, but there are no standards for many other things in the game, and you need to rely entirely on your own imagination, and then implement the imagination. So this is why this big chapter does not actually teach a game from beginning to end. The tutorial deliberately leaves a large blank space for everyone to imagine and land on their own.

next chapter

In the next big chapter, we will start to explain the rendering in Unity. Why did we start to talk about rendering so soon? If I'm just here to learn how to build gameplay, do I still need to study this chapter?

Although different people use Unity for different purposes, rendering, as the final means of presenting the picture, has a decisive impact on the WYSIWYG look and feel, and because of this status, most of the components and functions in the game are actually in the end. It is for rendering service. We have learned the functions of various components. In fact, we have learned its source, but we have not learned how the final effect of this source is produced. Only we understand the final piece of the puzzle after rendering. This can play a very critical role in promoting our understanding and digestion of these functional modules.

Due to the large amount of rendered content, it is expected to be written for a long time, so the advanced chapter about the implementation of gameplay, that is, GamePlay, will also be written at the same time, which is equivalent to the fact that the second and third chapters are not in a sequential order. It is parallel. Of course, due to limited energy, more content will be rendered, and the GamePlay part will be advanced according to the situation.

Well, let's see you in the following chapters.

Guess you like

Origin blog.csdn.net/z175269158/article/details/130326955