Unity Technical Support team performance optimization experience sharing

Source: Internet
Author: User

https://mp.weixin.qq.com/s?__biz=MzU5MjQ1NTEwOA==&mid=2247490321&idx=1&sn= f9f34407ee5c5d0d1edb478981299108&chksm= Fe1e2fbac969a6acee4eddb865d161fe09400c9147794c777ea4087e59f1e5fc3ccca5d1d0dd&scene=21#wechat_redirect

At Unity's independent game day on October 26, money a demon, technical director of unity Greater China, shared the Unity technical support team's experience in performance optimization. This article focuses on how Unity provides performance optimization services, performance optimization services, and considerations in the optimization process. Let's take a look at the specific content.

Project Review

Project Review is part of Unity's global enterprise support services. Project Review provides a comprehensive and in-depth analysis of a project to help the development team find issues in terms of resource usage, runtime performance, and provide a complete set of solutions or detailed revisions.

The entire project review is a two-day on-site job by the Unity official enterprise support team at the site. The content generally includes:

    • Game Start-Up time analysis

    • scenario, resource load time analysis

    • GPU&CPU performance analysis in game process

    • Memory usage Analysis

    • Asset Bundle and serialization analysis

    • Il2cpp, code clipping, and binary size optimization

    • Asset Review Automation

    • Ugui Performance Analysis

Here's a look at the main content in Project review, including the resource import settings check, and the performance analysis tools that are used.

Resource Import Settings Check

At the start of Project review, Unity Technical support engineers will typically communicate the entire project to the development team, understand the current known performance issues, and then begin to enter the resource Import settings check link. The most common checks include the following.

Model Import Settings

    • Check that Read/write enabled is turned on

      Turning on Read/write enabled is typically used to modify the mesh's vertex data at run time, and turning on this option causes the mesh to double its memory footprint. Therefore, if you do not need to modify these mesh data at run time in your project, we recommend that you turn this option off.

    • Check if animation type is not set to none

      Unity's default animation type is generic, which is appropriate for FBX files that contain animated data. However, if the FBX file does not contain animation data, but only normal static mesh, setting to generic causes the engine to automatically add a animator component to the gameobject of the mesh, resulting in unnecessary consumption. Therefore, for model files that do not contain animated data, we recommend that you set this option to none.

Texture Import Settings

    • Check if the Generate Mipmaps option is turned on

      For 3D objects, turning off mipmap can cause a distant texture to flicker, and rendering performance is low, so it is recommended to turn on the mipmap of textures on 3D objects. The disadvantage of turning on mipmap is that it can cause the texture to occupy a larger memory. For 2D objects, mipmap does not cause flicker and performance issues, so it is recommended to turn off the mipmap option on 2D and UI textures.

Audio Import Settings

    • Audio compression format

      For iOS platforms, it is recommended to compress audio files in mp3 format, the Android platform recommends the use of the Vorbis format, since both formats have hardware decoding support on each of the two platforms.

    • Force to Mono

      Mobile games often do not require high sound quality, if you do not need a stereo effect, you can open this option to import audio files into mono audio.

Animation Import Settings

    • Animation frame rate

      On the animation page to check the frame rate of the animation, the general 30FPS enough to meet the majority of the game's effect, if found to be made into 60FPS, proposed art re-production to 30FPS.

Project Review common performance analysis tools

The main work of project review is to use a variety of tools to analyze the performance issues that exist in the project, including the Unity profiler,unity Memory Profiler, XCode instrument, the longest tool. The XCode instrument also contains many tools, the most common of which are time profiler,allocation and capture GPU Frame.

Unity Profiler

The most commonly checked content in Unity Profiler is CPU Usage, where GC Alloc and time Ms are the most important. GC Alloc shows the code for allocating memory on the mono heap per frame, and allocating memory too frequently on the heap causes mono to periodically trigger gc.collect operations, which in turn causes the game to stutter. Therefore, we recommend that you troubleshoot memory allocations above single frame 2K and memory allocations of more than 20B per frame. It is best if you can minimize the allocation of heap memory. Time Ms shows the most expensive functions for each frame of the CPU, which allows you to find code that is time-consuming, and then further optimizes the code.

Unity Memory Profiler

Unity provides a new memory profiler tool for more than 5.3 versions, which is currently available as an external plug-in. This tool graphically shows the most memory-intensive resource types in the project, so it is easy to optimize the resource memory. You can also grab multiple snapshots at different points in the game, and compare memory usage to discover some resource memory leaks.

XCode Instrument–time Profiler

The upper-left corner is the time Profiler tool for instrument, and the bottom-right corner is the Unity Profiler, which can be found to be very imaginative. The difference is that time Profiler can analyze the temporal consumption of different functions over a period of time, while the Unity Profiler can only analyze the time consumption of the code within one frame. In addition, Time Profiler can show the low-cost code stack at the bottom of the engine, which makes it easy to understand the cause of performance problems from the bottom. The Unity Profiler can only display the time-consuming functions of tagging in engine code, so more useful data can often be seen in the instrument timing Profiler.

XCode instrument–allocation

Allocation is a tool for analyzing memory allocations. By default, it turns on the Created & persistent option, which means that it records memory that is allocated but not released over time. With this feature, we can easily check the memory leaks that exist in the game. The general use method is to open allocation detection in the main menu interface of the game, enter the battle scene test for a period of time and then go back to the main menu interface, and then check what memory allocations are not released. This portion of memory may contain leaked memory.

Capture GPU Frame

Launching the game from within Xcode runs on the real machine, capturing all the data of the current rendered frame via the capture button within Xcode. The interface to the left shows all the Drawcall list, the middle is the current drawcall rendered screen, below is the current Drawcall related data, the upper right is the current drawcall used texture data. This tool can show the time-consuming of each drawcall, so it can be used to check which objects render too much time-consuming. Then the analysis is the shader reason, or the mesh body is too complex and so on.

Other

There is no such comprehensive performance analysis tool in Xcode under the Android platform. The most commonly used tools are the Adreno Profiler and the Mali Graphics Debugger, both of which are used for GPU performance analysis.

Unity Enterprise Support Services

Finally, we will give you a brief introduction of unity for Chinese developers to provide enterprise support services content.

First we open Zendesk accounts for every corporate customer, and Zendesk is the solution platform for unity-oriented enterprise customers. The platform keeps track of each issue submitted by the developer and maintains the current state of each issue, making it easy for unity officials to ensure that each issue is resolved in a timely manner.

In addition, we provide a dedicated enterprise support manager for each enterprise customer, tracking the technical problems encountered by the enterprise and responding to the problems as quickly as possible.

For domestic customers there is a widespread development progress is very urgent situation, we provide two days a week on-site support, can be on-site performance optimization, training, problem solving, field code debugging and other services.

Conclusion

Let's share it here today. Later we will continue to share more game performance optimization related tips and content in the Unity official Chinese Community (unitychina.cn), please stay tuned.

Unity Technical Support team performance optimization experience sharing

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.