2
\$\begingroup\$

I made maps used bunch of small objects which are mostly scenary, like part of road, buildings, obstacles. They are all lightmap static, batching static, occludee static.

However after build APK, "levels" takes most spaces:

Uncompressed usage by category:
Textures      23.4 mb    5.3% 
Meshes        24.9 mb    5.6% 
Animations    4.5 mb     1.0% 
Sounds        1.9 mb     0.4% 
Shaders       1.8 mb     0.4% 
Other Assets  4.8 mb     1.1% 
Levels        287.1 mb   65.0% 
Scripts       2.1 mb     0.5% 
Included DLLs 3.9 mb     0.9% 
File headers  389.1 kb   0.1% 
Complete size 442.0 mb   100.0% 

As you can see, it's 287.1mb, it's too big. Actual APK size is almost 100mb. Funny thing is that in my game, I don't use lightmap. I have 9 different maps, all of them don't have light map, only has baked navigation mesh and occlusion data.

I don't think that occlusion data and navigation mesh takes that much, because I can see that occlusion data is less than 1MB even in the biggest map.

Does it matter that using lots of small objects to create level without lightmapping takes much spaces?

Also I combined those scenary objects together with MeshBaker, which is Unity Asset that combine meshes and materials/textures. After build, there's a little size reduction only in "Levels" part, however overall game performance getting worse and total apk size is not changed.

So, why I have those huge "levels" size, and how do I reduce it? Is there something that I missed?

And which situtation is proper to combine multiple meshes into single? In stats result, average batches are 40 in my game. Should I combine those bunch of small objects as big single object?

\$\endgroup\$
  • 1
    \$\begingroup\$ Do you have something like trees in a forest marked static since they don't move? If you do, it's baking all the trees into your level geometry, which makes it huge. We had that very problem in our golf game. \$\endgroup\$ – Almo Aug 2 '18 at 17:15
  • \$\begingroup\$ @Almo I don't have trees, instead have lots of roads, buildings and city obstacles. Yes, they are all "static". But does they needed to set "static" for lightmap baking/occlusion culling/navmesh baking/static batching? \$\endgroup\$ – modernator Aug 2 '18 at 17:26
1
\$\begingroup\$

This problem was coming from huge static batching. I didn't noticed but the assets that I used for making maps were have too much geometry. When you set "Batching Static" in object, Unity combine them as single mesh for fast rendering. However this process will clone all geometry to result, so high geometry eventually drastically increases level size, and that's why I had this issue.

After retopology, total build size reduced. Not just size reduction, I have significant performace boost too.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.