How to DIY project resource private detection rules

Local resource detection is a full analysis of static resources launched by UWA. It can fully and automatically detect various resources, codes and settings in the static project of the project, and can help the project team formulate reasonable resource and code standards, discover potential performance problems and abnormal errors in time, and establish effective development specifications.

In order to continuously compare with UWA industry parameters during the game optimization process, ensure that there are no fatal problems before the project is launched, and exempt the project team from developing tools for resource scanning (especially for code scanning), a Beijing-based company that is deeply involved in the SLG category Overseas Dachang has used the functions of UWA local resource detection and custom detection rules in depth. Below we will introduce in detail how this team combines the needs of its own projects to realize "tailor-made and on-demand customization" of local resource detection.

1. Why do you need to customize local resource detection rules?

Local resource detection Custom detection rules focus more on the detection of certain types of resources and settings in the project, as well as special situations. For example, you want to find a batch of old textures that have been updated for subsequent replacement; or you want to detect which resources will be lost abnormally when multiple settings are combined in a specified scene.

Through the "custom rules" function of local resource detection, the team wrote the relevant rules by themselves under the requirements of a certain framework, and realized rule detection that is more in line with specific requirements for the project. For example, the naming of rules, the logic of implementation, and the results of filtering can all be written and implemented by the project team on demand.

2. Explain the custom local resource detection rules in detail

The team is very happy to share the idea of ​​custom rules with you. UWA selects a few representative rules from them, hoping to provide reference and reference for you when you have similar needs in the future:

  • Prefab attribute missing : Check the Prefab in the project, and any Component attribute missing will be detected, which is convenient for subsequent investigation. During the project development process, resources are frequently modified and deleted, resulting in the resources referenced in the Prefab becoming empty, making it easy for the project to report errors during operation.

  • The materials are exactly the same : two different materials, but the attributes, textures, Shaders, etc. are all the same, and they will be detected. For shaders with the same properties, we can completely merge them. Because the prerequisite for batching in the built-in pipeline is that the shaders are exactly the same and are the same shader instance, so the probability of DrawCall batching in the built-in pipeline can be increased as much as possible.

  • The special effect LOD configuration needs to be improved : check the special effect LOD configuration. Image quality grading is an important part of performance optimization, and in image quality grading, special effect grading is also a necessary part. In the process of project development, if the artist does not match the LOD of special effects, it will lead to defects in the LOD of special effects. For example, there are many special effect nodes, but the opening nodes of different LOD levels are set to be the same, without layering.

    Therefore, the LOD setting of special effects must also be strictly accurate, otherwise too many or too complicated special effects will be released on low-end machines, which will cause the already obvious performance problems to become more serious.

  • Spine resource with wrong path : Spine resource has a specific storage directory, and it will be detected when the wrong directory is placed. A good resource storage directory specification is one of the prerequisites for smooth project development. In order to better manage project resources, Spine resources are usually placed in predefined directories.

  • Missing Prefab scripts : Detects scripts hanging under Prefabs. The script becoming miss may be caused by factors such as project migration and incorrect package import. Investigate as early as possible in advance and modify the problematic Prefab to avoid unnecessary error reporting or flashback when the project is running later.

  • ScriptableObject reference lost : Detect the reference of ScriptableObject. ScriptObject is usually used for data configuration. If the reference is lost, it may cause an error or crash when the project is running.

  • Atlas with a size exceeding 2048 : Excessive atlas resolution will result in time-consuming loading and increased memory usage. Unnecessary use of large atlases is prone to waste of a large amount of blank space. Therefore, it is necessary to control the atlas size within a reasonable range. The resolution of the atlas should be limited according to requirements.

In addition to some of the above rules, the team implemented more than 20 custom rules that meet the specific detection needs of the project based on the parameters they care about, such as "suspected useless Prefab (resources are all lost)", "Unity type used' .?' syntax", "Prefab material is empty", "Special effects - set wrong own special effect resources", etc.

These customized rules, based on the existing rules of local resource detection, further improve the detection requirements of the project. In the face of some problems that the mainstream industry has not yet paid attention to, the team, as a pioneer, has made up for it in advance in its own projects. on these possible loopholes.

3. More customization

In addition, we can also set various thresholds that meet current needs in the local resource detection report according to the actual situation of the project.

You can also set a specific detection range and a class of resources with specified characteristics in the local resource detection, and even set thresholds that are more in line with actual needs for similar resources with different scenarios and uses.

For more tutorials about the "local resource detection" function, please check:
New | UWA local resource detection is officially launched
and I have the final say on the rules! | Customized rules are launched
Local resource detection function update — "Automatic Repair" local resource detection is launched
| Single rule multi-threshold setting function is online

Please click "Free Trial|Full Experience of UWA Performance Guarantee System" , the 15-day free trial is just around the corner!

Guess you like

Origin blog.csdn.net/UWA4D/article/details/130982585