Hi smart people of the Polycount variety, I'm usually exclusively a lurker, and I'm usually perfectly content lurking like the lurker I am. I am however at an impasse; I need some Unity advice/help.
I was hoping someone here might be able to give me some insight into a problem I'm having with my application size once the Unity project is built. I primarily work with UDK, so I may be making some noob mistake, so don't assume I've got the obvious covered.
For some background, I'm working on a Unity project that is a little on the beefy side. There is no intention for this thing to come in under a couple hundred megs. That is perfectly acceptable. The application is being built for Ipads (primarily 3s and 4s), so there is only so far I'm willing to optimize the assets before the quality level is deemed too low.
Here is my problem:
The raw, uncompressed size of the assets equals out to about 330 Megs. When the project is built for iOS via Xcode, the project ends up weighing in at roughly 600 Megs.
I have made the adjustments to the iOS Stripping Level as per
http://docs.unity3d.com/Documentation/Manual/iphone-playerSizeOptimization.html
The target platform is set exclusively to armv7, as Scaleform is being used
The mesh files are imported as FBX files, and textures as TGAs. Almost all of the textures are in some square power of two; There are a couple that aren't, but I do plan on squaring them off.
Many of the meshes are modular chunks, which have been duplicated within the hierarchy. It is my assumption that using the duplicate command is the same as instancing the mesh and the limited research I've done seems to indicate that this is the case.
As far as textures go, I know I can turn all of my textures to RGB Compressed PVRTC 4 bits or RGBA Compressed PVRTC 4 bits to save a significant amount, but as far as I can tell 24 bit .TGAs are equivalent to RGB 24bit in iOS. I do plan on switching over to PVRTC 4 bit where it won't be noticed, as I see no reason to ignore optimization wherever possible. My source
http://docs.unity3d.com/Documentation/Manual/ReducingFilesize.html
I'm trying desperately to figure out exactly where the file size explosion is happening, but right now I've got nothing to go on. It's not the end of the world if the app does end up being a behemoth, but I'd really like to keep it respectable. Given the size of the source files, it just doesn't seem to make much sense.
Any insights at all would be much appreciated.
Thanks,
Replies
http://docs.unity3d.com/Documentation/Manual/ReducingFilesize.html
You can try changing mesh compression to medium or high on all your models. Also anything under a Resources folder is included whether its part of the project to not.
but you really should use texture compression wherever possible. have you check what happens to your sound files? uncompressed sounds are also pretty large ..
an idea - do you have any unused assets in the resources folder? because unity does no dependency check for that directory, i kust dumps everything into the build.
My guess is that textures are going to be what's hurting you - especially if you're leaving them uncompressed. Compress everything you can as much as possible - then uncompress a few (if any) bits and pieces you feel really can't afford to be compressed (normally just your GUI textures).
And, as kio mentioned, ensure you don't keep things in /Resources because that will all get put into the build, regardless of whether it's used in the game or not. (For everything else, Unity will work out what's referenced in each scene and only include the things it needs).
Here is a current report of the resource log in Unity:
Textures 27.9 mb 76.7%
Meshes 5.7 mb 15.7%
Animations0.0 kb 0.0%
Sounds 0.0 kb 0.0%
Shaders 5.7 kb 0.0%
.
.
.
Complete size 36.4 mb 100%
I'm a little unclear as to what/where the resource folder is? Is it anything within the project hierarchy?
I'm currently working on a PC, and creating a .unitypackage of the scene to hand over to my programmer on a Mac. From what I can tell, when I create the package, any unused assets get stripped out, so it should be pretty clean when it gets to him.
One thing I'm wondering about is the UI/Scaleform aspect of the project. The .swf we have is about 3 megs in size. Is there anything wonky going in terms of compression/decompression that I should be aware of?
Thanks again,
EDIT - After some further tests, we have found out where the main problem is. Without scaleform/swf the project built in about 60 megs.
Looks like the problem was with the unity to iOS scaleform conversion.
Thanks all
Yeah, creating a .unitypackage will strip out all non-referenced assets.
The resources folder is just creating a folder called Resources in your Assets folder (not sure if any folder called Resources anywhere in /Assets counts...). If you don't have one, then it's no bother :P