MMORPG game optimization report

1. Analysis of overall performance overhead of MMORPG mobile games

Two, MMORPG mobile game CPU module performance overhead analysis

Three, MMORPG mobile game memory module performance overhead analysis

Four, MMORPG mobile game resource management analysis

Five, UWA's suggestions for the MMORPG mobile game development team

1. Analysis of overall performance overhead of MMORPG mobile games

The CPU performance of iOS devices is generally higher than that of Android devices. The main range of the average CPU of Android devices is 14.4~73.6 ms, and the main range of the average CPU of iOS devices is 9.2~43.5 ms. On Android devices, the CPU time is concentrated in the 17-50ms interval, while on iOS devices, the CPU time is concentrated in 33ms.

We selected the four models with the most evaluation times for statistics. These four models are Redmi 2, Redmi Note2, Huawei 6Plus and Samsung S6.

1) Most MMORPG mobile games have high performance overhead in low-end devices, and the time-consuming ratio of more than 33ms ranges from 60% to 70%.

2) The CPU overhead of MMORPG mobile games on low-end mobile devices in the process of exquisiteness has increased significantly. Compared to the same period in 2016, the average CPU overhead of the 2017 Q2 MMORPG mobile game has increased by more than 50%.

Whether it is a high-, medium-, or low-end Android device, rendering, UI, and loading/code all need to be focused on by the R&D team, and their total consumption accounts for 80% of the total overhead.

Let's analyze the cost of these mainstream modules in detail below.

Two, MMORPG mobile game CPU module performance overhead analysis

1. Rendering module

Severity: hell

In order to better reflect the overall use of each performance parameter, we have counted the main use range of each performance parameter. The range is [5%~95%]. In the following data, P5 represents 5% and P95 represents 95 %.

The number of Draw Calls in MMORPG mobile games is generally higher, and the better the device performance, the higher the peak number. This is mainly due to the following reasons:

1) R&D teams generally began to develop adaptive rendering LOD strategies for different models, mainly including model LOD and Shader LOD.

2) In addition to LOD, the R&D team will also make targeted settings for some rendering effects. The most common is the processing of shadows. Real-time shadows are turned on on high-end machines, while simpler shadow patches or Projectors are used on low-end machines. deal with. In addition, water body simulation is increasingly used in projects. Turning on the water surface reflection effect on high-end equipment will also increase a certain amount of Draw Call.

However, the current data shows that the R&D team has begun to control Draw Call intentionally. UWA recommends that the P95 occupied by Draw Call is less than 200, and 72.3% of the projects can be controlled within this range.

1) The number of triangles in the scene rendering of MMORPG mobile games is generally high. And the higher the equipment performance, the higher the peak number. According to statistics, 40.4% of low-end equipment can control the number of rendered triangles below 100K.

2) The complexity of the scene has increased significantly. Although the number in 2017 Q2 has dropped, it still increased by 33% compared to the same period last year. At the same time, the higher number of rendering patches also greatly increases the GPU rendering pressure and energy consumption pressure of low-end devices.

The average CPU time per call of Graphics.Bilt operation is mainly distributed in: 0.1~5.1ms. Similar to the Instantiate overhead, this CPU overhead has a more obvious upward trend on low-end devices, but it dropped sharply in 2017 Q2. This is mainly because after 2017 Q1, MMORPG projects have generally opened multi-threaded rendering functions.

2. UI model

Severity: hell

Projects that use NGUI as the UI solution account for a very high proportion. NGUI is still the main solution used by the MMORPG R&D team for the UI system. MMORPG is currently one of the most complicated game categories in mobile games. For the selection of UI modules, most teams still tend to start from the two aspects of stability and control . This is also the main reason for the continuous high proportion of NGUI. the reason.

Below we will explain the CPU time and heap memory usage of NGUI and UGUI respectively.

The performance overhead of the UI module is still very high, and it is also the second largest performance killer in our statistics. In the low-end devices, more than 90% of R&D projects face serious performance problems on the UI side, which are mainly reflected in the following aspects:

(1) The interface of the MMORPG game is complex , with many functions (skills, backpacks, roles, tasks, malls, etc.), and a large number (HUDs such as health bars, names, floating characters, etc.).

(2) There are a large number of Panels that need to be updated at the same time , such as HUDs such as moving health bars, NPC's constantly updated reminder icons, reminder animations in the panel (tasks, first charge, etc.), chat boxes and bullet screens that appear randomly Scroll text etc.

The above situation is the main UI problem that the R&D team of MMORPG project faces every day. It is possible that the negligence of a Widget can make the performance cost of the UI module of the R&D team soar by an order of magnitude.

Note: From the point of view of important functions, the CPU usage of UGUI is significantly lower than that of NGUI. It should be noted that after Unity 5.2 version, some of the UI calculation operations have been moved to sub-threads, while the performance in the main thread is WaitingForJob, PutGeometryJobFence, etc. In this report, we did not include these two Cost statistics are included.

According to statistics, the main range of heap memory allocated per 10,000 frames in NGUI is 6.1~103.3 MB, and the main range of heap memory allocated per 10,000 frames in UGUI is within 10.9 MB. From the perspective of heap memory allocation, UGUI is much lower than NGUI.

3. Logic Code

Severity: nightmare

1) The GC trigger frequency is very high, which is one of the main reasons for the lag. At present, only 10% of the projects can control the GC trigger frequency above 1000 frames/time.

2) As MMORPG games become more and more serious, the average GC time is gradually increasing. Time-consuming GC will gradually become the mainstream performance killer when the game is running, and the R&D team needs to pay attention to it all the time!

1) The average CPU time per call of Instantiate instantiation operation is mainly distributed in: 1.4~33.1 ms, and mainly concentrated within 10ms.

2) Instantiate instantiation time has been on the rise until 2017 Q2, but it dropped sharply in 2017 Q2, which shows that more and more R&D teams are beginning to pay attention to resource management during project operation.

Shader.Parse operation is a more prominent performance killer. At present, the average CPU time per call is mainly distributed in 5.8~134.4ms. But as more and more teams understand the time-consuming characteristics of this item, the CPU time of this item has shown a more obvious downward trend.

4. Animation Module

Severity: nightmare

1) The cost of Animator.Update/Animation.Update is generally relatively high on low-end devices, but the overall time consumption was significantly reduced in the first half of 2017.

2) The time-consuming of MeshSkinning.Update is generally low.

5. Particle Module

Severity: normal

1) The CPU overhead of particle systems is generally low, and the downward trend has been obvious in the past year.

2) The number of particle systems used is still large, which will cause high memory usage. UWA recommends that the peak number of particle systems used be controlled below 400, which is currently only reached in 24.8% of the projects.

6. Physical Module

Severity: normal

The performance of the physical module is generally good, but showing a more obvious upward trend, so it still needs the attention of the R&D team on the low-end machine.

Three, MMORPG mobile game memory module overhead analysis

Memory leakage is a serious problem often faced in the development process, and nearly half of the projects still have different degrees of memory leakage. However, we can see that the proportion of memory leaks is gradually decreasing. Compared with the same period last year, the proportion of memory leaks in 2017 Q2 has dropped by 6%.

Total memory

Severity: hell

1) The overall memory peak value is mainly distributed in the range of 146.8~576.9 MB, and the average value is above 350MB;

2) With the trend toward high-quality MMORPG games, the memory usage of MMORPG games has gradually increased. Although there was a slight drop in Q4 2016, the overall memory has increased significantly.

Total heap memory

Severity: hell

1) The peak overall heap memory is mainly distributed from 18.3 to 117.2 MB, and only 34.2% of the projects can control the peak overall heap memory within 40MB;

2) The use of heap memory is on the rise , and it is recommended that the R&D team pay more attention. In this regard, UWA recommends focusing on the following points:

(1) Strictly pay attention to the use of configuration files, and avoid loading too large configuration files at one time to support a large amount of memory;

(2) The increase in heap memory of many projects is due to hot updates. Therefore, for the use of too large data, it is recommended to use framing and GC recovery in time;

(3) Avoid unnecessary code heap memory allocation. Although it is a cliché, it can be seen from the trend that most R&D teams still need to pay more attention.

A large part of the memory usage of the project comes from the use of resources. Below we will analyze the use of mainstream resources in the project.

1. Texture resource memory

Severity: hell

1) The peak texture memory is mainly distributed in the range of 27.8~174.6 MB, and is mainly distributed in the range of 50~100MB.

2) The peak memory usage dropped sharply in Q4 2016, but started to rise gradually after this year. It is recommended that the R&D team pay close attention to the texture resource usage of their projects.

2. Grid resource memory

Severity: nightmare

1) The peak grid resource memory is mainly distributed between 8.5~70.4 MB, and is mainly concentrated within 40MB;

2) MMORPG games generally have larger scenes and more characters. Therefore, the amount of grid resources is significantly higher than that of other types of games. However, from the perspective of usage trends, the usage trend in the last year has been relatively stable, with the average value fluctuating around 30MB.

1) The peak of animation resource memory is mainly distributed in: 3.5~58 MB, and mainly concentrated within 15MB.

2) The memory usage trend is relatively stable, and the average peak memory is controlled within the range of 20~25MB for a long time.

3. Shader resource memory

Severity: nightmare

1) The peak of Shader resource memory is mainly distributed from 0.1 to 5.6 MB, and is mainly concentrated within 1MB.

2) From the perspective of memory trends, memory usage decreased significantly in 2016, and slightly increased in 2017.

4. RenderTexture resource memory

Severity: hell

1) The peak of RenderTexture resource memory is mainly distributed from 0.1 to 100.9 MB, and it is relatively even in each interval;

2) The memory usage is on the rise. It is recommended that the R&D team pay special attention to its usage in its own projects!

5. Particle system resource memory

Severity: nightmare

1) The peak memory of particle system resources is mainly distributed from 1.3 to 34.8 MB, and is mainly concentrated within 20 MB.

2) The memory occupancy of the particle system was high during Q3 of 2016, and then dropped sharply in Q4 of 2016, but there is still a lot of room for decline. At present, the memory usage of the particle system is relatively "high", that is, the number of Active during the game is much smaller than the total number in the memory. In most projects, the number of Active particle systems accounts for less than 10%, that is, the memory of the particle system The peak occupancy should be around 5MB.

Four, MMORPG mobile game resource management analysis

1) In terms of resource loading, AssetBundle.Load and Resource.Load are the main loading methods in the project;

2) Through the call trend, it can be seen that the use of Resources.Load by the R&D team is still increasing. In this regard, UWA strongly recommends that the R&D team use AssetBundle as the main loading method of game resources as much as possible.

1) LoadFromFile and New WWW are the main loading methods of AssetBundle in the project;

2) The use of LoadFromFile has increased by 6% in 2017 Q2 . This is the AssetBundle loading method that we highly recommend on UWA DAY 2017 (after Unity 5.3). The R&D team can check specific performance comparisons through related articles on UWA Blog.

The number of Instantiate/Destory and Active/Deactive calls is high, and the R&D team needs to pay attention to it according to its own project situation:

1) Since the CPU overhead of Active/Deactive each call is not large, and will not cause problems such as crashes, crashes, etc., it is easy for the R&D team to ignore the performance problems caused by these two operations, so there is a game running 10,000 The frame Active/Deactive has tens of thousands of calls. Therefore, there is a lot of performance waste here;

2) The number of calls to Instantiate/Destory is also high. Although it is not as frequent as Active/Deactive, the frequency of calling Instantiate every 5 frames still cannot be ignored. It is recommended that the R&D team insist on strengthening project resource management to avoid unnecessary frequent Instantiate/ Destory operation occurs.

V. UWA's suggestions for the MMORPG mobile game development team

First, be wary of the two major performance killers, the rendering module and the UI module! With the increasing number of boutique MMORPG projects, these two items will remain the top priorities of the R&D team in performance optimization for a long time to come!

  • In terms of rendering, the optimization skills of Draw Call have been mastered by more and more teams, and with the development of equipment, the impact of Draw Call will become smaller and smaller. In contrast, the number of rendering triangles will gradually become the new performance bottleneck of the rendering module. , The larger and larger amount of rendering Triangle will put huge pressure on GPU, power consumption and heat generation;
  • In terms of UI, the UI grid reconstruction cost will still be a headache for the R&D team for a long period of time in the future. At present, mobile game MMORPG is still in the early stage of transformation of "end game mobile game". Most R&D teams consider more It is still the migration of functions and the combination with the mobile terminal, and the precipitation in UI technology is relatively weak.

Second, in terms of logic code, although Instantiate's instantiation overhead has shown a relatively obvious downward trend in 2017 Q2, it still requires the R&D team to continuously monitor resource management. At the same time, the rising trend of GC overhead is obvious, and the R&D team needs to strengthen the optimization awareness of Mono heap memory;

Third, the proportion of memory leaks continues to decline, but the memory usage continues to rise. Although the amount of memory in mobile devices is increasing year by year, for game teams who want to cover a wide range of games, the control of memory is still urgent;

Fourth, in terms of memory optimization, most of the R&D teams focus on main resources such as textures, grids, and animation clips. However, through the above analysis, it is found that Mono heap memory and RenderTexture memory usage have increased significantly in 2017. In this regard, it is recommended that the R&D team pay close attention to the memory usage of these two items in the next R&D;

Fifth, there is still a lot of room for optimization of animation resources and the memory of the particle system. For the former, it is recommended that the R&D team pay attention to the following technologies:

  • The precision reduction technology of animation clips, the technology has detailed explanation and code sharing on UWA Blog and UWA Q&A;
  • Pay attention to the Retargeting technology, which can greatly reduce the memory usage of multi-role animation clips. It is predicted that as the MMORPG project becomes more serious, this technology will be favored by more and more teams.

For the latter, it is recommended that the R&D team pay attention to the resource allocation table of the particle system, combined with the UWA online performance report, and make a reasonable plan for the infrequently used Particle System.

6. In terms of resource loading, New WWW and Resources.Load are still very commonly used resource loading methods for R&D teams. However, UWA recommends to try to load related resources through LoadFromFile (Async) and AssetBundle.Load as much as possible to obtain better performance. The R&D team can find the corresponding performance comparison and analysis in the relevant Blog of UWA Day 2017;

7. The above data is our overall research and trend analysis of MMORPG mobile game performance data. It aims to show you the common performance bottlenecks in the project and the potential performance problems that are easily overlooked by the R&D team from a macro perspective. However, it should also be noted that optimization is a process of "stripping the cocoon", which requires the R&D team to spend a lot of time and patience to complete. UWA suggestion: do more tests, speak with data, have an empty cup mentality, and zero experience.

Guess you like

Origin blog.csdn.net/mango9126/article/details/114138041