TikTok for Developers

Docs

Unity Packaging Optimization

This guide outlines step-by-step optimization best practices for Unity-developed TikTok mini games to help you reduce package size, improve load performance, and meet platform submission requirements. It covers asset compression strategies, build configuration adjustments, and platform-specific optimizations to ensure your game complies with TikTok's package size limits and delivers a smooth experience for global players. The recommendations in this documentation are designed to complement the core Unity Mini Game integration guides, and can be applied at any stage of your development cycle.

Texture format adaptation (ASTC)

After enabling ASTC compression, WebGL can save a lot of memory and video memory when running on mobile end.

In Unity, go to File > Build Settings > Other Settings to set Texture compression format to ASTC.

Configure graphics API

On the Edit > Project Settings > Player > Other Settings page, uncheck Auto Graphics API and keep only WebGL 1 or WebGL 2. You can reduce the number of shader variants, thereby reducing the first package and startup time.

Packaging Wasm Code Simplification

  1. Adjust managed code culling level: In Edit > Project Settings > Player > Other Settings , set the Managed Strip Level to High and use the link.xml file to retain the necessary C #code.
  2. Trim unused engine code Enable the Strip Engine Code option to automatically remove unused engine modules:
  1. Disable unused packages and built-in modules (such as Timeline and Physics) in Window > Package Manager to reduce package size:
  1. In Player > Publishing Settings:
    • Debug Symbols is set to external.
    • Set the exception option to Explicitly Thrown Exceptions Only (full for debugging only).
  2. Reduce shaders and their variants:
    • Remove unused shaders from the Always Included Shaders list on the Project Settings > Graphics page:

Enable compression

  1. Use compressed resource format:
    1. After using the appropriate compression format and compression level for textures and audio, the small game package size and Random Access Memory can be greatly reduced

Packaged product analysis

If the packaged br compressed *.data file is particularly large, first check the build report of the build to see the resource proportion

  1. If you find that Textures account for too much of the packaged product, check the Texture Optimization section.
  2. If the proportion of audio & video resources is too large, it is recommended to load through CDN resources or use Addressables or AutoStreaming for optimization.
Was this document helpful?
TikTok for Developers