2) Unity 2018.4.3x version of AssetBundle is slow 3) Unity 2D map dynamic modification 4) Unity 3D UGUI Particle effects tailoring solution 5) Addressables Execution problem with loadAssetAsync loading preset body


This is the 259th post of UWA technical knowledge sharing. Today, we continue to select a number of issues related to development and optimization for you. It is recommended that you read for 10 minutes.

UWA Q&A Community: Answer.uwa4d.com UWA QQ Group 2:793972859 (The group is full)

Script

Q: The game uses HttpWebRequest for content updates, only uploads small packages on Google Play, and downloads resources after opening them.

Normal download speed is about 10MB, in the use of 4G (WiFi did not appear, 4G basically will appear) under the download of about 10 seconds will appear a cliff type of speed decline, up to 10 KB or even a few KB. Then it will get stuck at this speed to download at a snail’s speed. If the connection is discontinued and the connection is restarted, the speed will return to 10MB again. The basic download of complete resources needs to be repeated 2~3 times.

Download resources in Tencent Cloud Hong Kong server, use Tencent Cloud CDN acceleration service. Version: Unity 2018.4.34.

A: You can check:

  1. There are no problems under WiFi, but there are problems on 4G. It is necessary to check whether the problem is caused by the operator first, and try both Telecom and Mobile Unicom.
  2. You can check the status of the CDN, the CDN background should be able to see the number of 2XX, 3XX, 4XX or 5XX, to exclude the problems in the file itself or the instability of the CDN network.
  3. Consider downloading a file in multiple Range segments and multiple threads.

You can refer to the UWA school article “mobile game HTTP multi-threading download principle and optimization”, this article is well written, solve a lot of hot update resources pain points.

Thanks to Xiao Xiaojun @uwa Answers Community for providing the answer

Build

Q: Unity 2018.4.3x is slow to play AssetBundle. It has been switched to 2018.4.36F1, 32F1, 20F1 and 34F1 on the same computer environment, but it is fast to play AssetBundle with the previous 2018.4.1F1.

The computer i7-10700, the old version 2018.4.1, F1 is fast, the 2W resource increment is 3 minutes at a time, and the starting time is about 20 minutes. Then the new version is 10 hours +. I don’t know where I have been remiss. The project has been imported back and forth several times.

A1: Introduce several analysis methods:

  1. Look at the editor.log to see what Unity is probably doing;
  2. Use a tool like Procexp, Process Hacker, etc., to configure the symbolic PDB path. You can look at the Unity main thread stack, refresh it several times, and get a good idea of what you’re doing.
  3. Attach a performance profiler to the Unity process with VS, grab it for a few minutes, and you’ll see the hot call stack.

Thanks to the littlesome@UWA Q&A community for the answers

A2: Let me see if this thread is helpful. It also appeared in the Q&A section not long ago.



https://answer.uwa4d.com/ques…

Thanks to the @UWA Answers community for providing the answer

Rendering

Q: How does the ground collapse after a DouDouTang shell bombardment happen?

A: Generate A Mesh for the corresponding scene image, and then update the Mesh when it arrives.

UnityStore has a good plug-in can have a look at: https://assetstore.unity.com/…

Can also take a look at the Poly real algorithm: https://blog.csdn.net/6346289…

Thanks to Xiao Xiaojun @uwa Answers Community for providing the answer

UGUI

Q: What are the best solutions for UGUI particle tailoring? For example, the Sprite Mask needs to set the scaling, which feels a little inconvenient to use. For example, how to cut with Shader?

A1: You can refer to this:



https://www.programmersought….

Thanks to the @uwa Q&A community for providing the answer

A2: Take a look at this:



https://blog.csdn.net/akak201…

Thanks to the super@UWA Q&A community for the answers

Addressable

. Q: what do I use in the project Addressables LoadAssetAsync load default body, then instantiated, before I finished loading instantiation will execute the default body mount script. If I instantiate the preset body again, the script is executed twice. What is the correct way to do this?

A1: This is an issue with synchronization loading in 1.18. Just drop back to 1.17.17.

Thanks to the Tang @uwa Answers community for providing the answer

A2: I found the following post, it is really a version problem, I upgraded to 1.18.11, so I have not encountered this problem.



https://forum.unity.com/threa…

Thanks to the BreakJail@UWA Q&A community for providing the answer

20210719 more wonderful questions waiting for your answer ~

1. Whether the choice of Vulkan and OpenGL will have an impact on the memory size 2. 3. Technical difficulties in RTS mobile game

Cover image from the network


That’s all for today’s sharing. Life, of course, is long and knowledge is long. The questions you may see are just the tip of the iceberg in the long development cycle, and we have already prepared more technical topics for you to explore and share on the UWA Q&A website. Welcome you who love progress to join us. Maybe your method can solve others’ urgent need. And the “stone” of another mountain can attack your “jade”.

Website: www.uwa4d.com Official Technology Blog: blog.uwa4d.com Official Q&A Community: Answer.uwa4d.com Official Technology QQ Group: 793972859 (The original group is full)