Cocos creator 3.4.0 Preload assets cause of frame drops

Hi all. I have a lot of item images in my game (near 80+) but I not need all images at the start. So I decided to preload some images for future using:

resources.preloadDir(‘items/’);

But I noticed when I use preload, performance of the game drops from 60 to 20 while preloading running.
I am wondering It is a bug or preloading can be a case of this?
As I read in documentation, preload can be used during the game:

Preloading will only download the necessary resources and will not perform deserialization or initialization. Therefore, it consumes less performance and is suitable for use during the game.

I can ask engineering to have a look.

Although the preload is not parsing and initializing, there are resources being downloaded, which causes frame rate changes.

You can set assetManager.downloader.maxRequestsPerFrame to avoiding too much jams in a single frame, refer : Download and Parse · Cocos Creator.
and you can use assetbundle to minimize the number of resources, refer: Asset Bundle · Cocos Creator

ok I will try, thanks!

You can also try some texture compression, audio decoding rate reduction, video bitrate reduction, etc. to reduce the size of the resources that need to be loaded. If you are a web game, you can also use gzip to optimize this issue.

thanks, for now I start to use auto-atlas and loading time of resources reduced from 6 sec. to 0.500 ms.

1 Like

as I understood preloading during gameplay is sutable for more powerful devices and big projects

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.