Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to understand Unity DOD

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

In this issue, the editor will bring you about how to understand Unity DOD. The article is rich in content and analyzes and narrates it from a professional point of view. I hope you can get something after reading this article.

What is DOD?

The big project that Unity is actually working on is the concept DOD (Data Oriented Design), which has been popular in the programming world for a while and is becoming more and more popular recently. It is a concept opposite to what we know as OOD (Object Oriented Design), that is, object-oriented design. The current popularity is even so popular that if you search with youtube, you will find:

The Mike Acton boss in the first search result in the screenshot is currently working for Unity and is one of Unity's leading DOD reformers. Then the third piece is that the famous blowing elder brother explained DOD in the live broadcast of the new game language development that he is designing. Although I don't think it's so extreme to say that OOP is dead and DOD is immortal, its popularity is evident.

DOD of Unity

Back to Unity, as shown in the picture, this is a frame of Slide excerpted from Unity at GDC 2018, showing the full picture of the Unity DOD plan. Its new components are the following from top to bottom: ECS, Job System, HPC#, Burst Compiler.

ECS

The instance component system is a change in programming thinking, from object-based operation to "pipelined operation" (my own metaphor). Although it obviously destroys the desire for "program simulation of reality", it greatly enhances decoupling, testability and expansibility. And nature is a good partner for several components to be described below.

Job System

Job System is the application of Unity to CPU multi-core programming. The operation efficiency is greatly improved by distributing the work to each core of CPU. The match between ECS and him is because the System part of ECS naturally takes batch processing as the core, so with a little change, it can be transformed into batch sub-Job and handed over to multi-core processing. Realize the improvement of performance.

HPC#

HPC# (High Perform C #) is a subset of C # developed by Unity, which accelerates performance at the language level by abandoning advanced features such as objects, pointers, and so on. This is not listed directly in the screenshot, but NativeContainer is part of HPC#. Due to the de-objectification of ECS itself, it can be seen that it is a good partner of nature.

Burst Compiler

This is developed by Unity itself, a brand-new fast compiler, the most important thing is that it only aims at Unity, games and HPC#, which makes the performance greatly improved. As it involves the compiler level, my understanding of this part is the weakest. Please correct any errors.

In the official Unity DOD tutorial, the performance improvement of 18000 units in classic mode and 104000 units in DOD mode is nearly 6 times higher. Of course, our actual game will be based on the content of the game, and the complexity of the components may not have such extreme results, but I think a 2-3 times performance improvement can be expected.

Learning materials

Then there is the most important part of how to learn at the present stage. Through these two weeks of study, my understanding is that the current learning materials are disorganized and easy to expire. The simple reason is that it is only in the preview stage, and a lot of things are changing rapidly, especially in API, where there are many ways to implement a requirement, and officials hope to finally determine one of them under the feedback of the trial users, so the code you are writing and the tutorials you are reading are likely to be invalid soon. Even some of the code tags that appeared at the conference in the second half of 18 are different from those in the first half of the year. Officials clearly do not have the energy to maintain a systematic teaching. So I think it is very necessary for me to summarize and sort out the materials I have learned according to the learning curve I think is appropriate.

Unit testing

Finally, let's talk about unit testing. this thing is very controversial in the gaming world. I personally stand on the side that there must be unit testing, and Unity officially provides comprehensive unit testing. Therefore, the main source of learning about unit testing of the new UnityDOD is the source code of Unity. There are official unit tests in the preview version of Entities provided in Package Manager, which is the primary and good source of test learning. In addition, the Unity Tiny mode project just mentioned also has a relatively complete unit test.

The above is how to understand the Unity DOD shared by the editor. If you happen to have similar doubts, you might as well refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report