Unity always post-processes imported files, thus storing a file as a multi-layered psd file instead of a jpg will make absolutely zero difference in the size of the player you will deploy. Save your files in the format you are working with (eg. .mb files, .psd files, .tiff files) to make your life easier.
The amount of assets in your project folder does not influence the size of your built player. Unity is very smart about detecting which assets are used in your game and which are not. Unity follows all references to assets before building a game and generates a list of assets that need to be included in the game. Thus you can safely keep unused assets in your project folder.
After Unity has completed building a player, it prints an overview of what type of asset took up the most file size, and it prints which assets were included in the build. To see it just open the editor console log:
button in the Console window ( ).File Headers are not assets but represent the data that is kept to maintain references and settings for the asset, such as resource assets. In other words, it is the extra data apart from the raw data contents in a file. This should normally a small percentage, but if you have a large value check whether you have assets in the Resources folder. If so try moving some or all files out of this folder. You could switch to using AssetBundles to load assets dynamically.
Often textures take up most space in the build. The first to do is to use compressed texture formats (DXT(Desktop platforms) or PVRTC) where you can.
If that doesn't get the size down, try to reduce the size of the textures. The trick here is that you don't need to modfiy the actual source content. Simply select the texture in the Project view and set Max Size in Import Settings. It is a good idea to zoom in on an object that uses the texture, then adjust the Max Size until it starts looking worse in the Scene View.
Compression | Memory consumption |
RGB Compressed DXT1 | 0.5 bpp (bytes/pixel) |
RGBA Compressed DXT5 | 1 bpp |
RGB 16bit | 2 bpp |
RGB 24bit | 3 bpp |
Alpha 8bit | 1 bpp |
RGBA 16bit | 2 bpp |
RGBA 32bit | 4 bpp |
Compression | Memory consumption |
RGB Compressed PVRTC 2 bits | 0.25 bpp (bytes/pixel) |
RGBA Compressed PVRTC 2 bits | 0.25 bpp |
RGB Compressed PVRTC 4 bits | 0.5 bpp |
RGBA Compressed PVRTC 4 bits | 0.5 bpp |
RGB 16bit | 2 bpp |
RGB 24bit | 3 bpp |
Alpha 8bit | 1 bpp |
RGBA 16bit | 2 bpp |
RGBA 32bit | 4 bpp |
Compression | Memory consumption |
RGB Compressed DXT1 | 0.5 bpp (bytes/pixel) |
RGBA Compressed DXT5 | 1 bpp |
RGB Compressed ETC1 | 0.5 bpp |
RGB Compressed PVRTC 2 bits | 0.25 bpp (bytes/pixel) |
RGBA Compressed PVRTC 2 bits | 0.25 bpp |
RGB Compressed PVRTC 4 bits | 0.5 bpp |
RGBA Compressed PVRTC 4 bits | 0.5 bpp |
RGB 16bit | 2 bpp |
RGB 24bit | 3 bpp |
Alpha 8bit | 1 bpp |
RGBA 16bit | 2 bpp |
RGBA 32bit | 4 bpp |
To figure out total texture size: width * height * bpp. Add 33% if you have Mipmaps.
By default Unity compresses all textures when importing. This can be turned off in the
for faster workflow. But when building a game, all not-yet-compressed textures will be compressed.Meshes and imported Animation Clips can be compressed so they take up less space in your game file. Compression can be turned on in Mesh Import Settings.
Mesh and Animation compression uses quantization, which means it takes less space but the compression can introduce some inaccuracies. Experiment with what level of compression is still acceptable for your models.
Note that mesh compression only produces smaller data files, and does not use less memory at run time. Animation Keyframe reduction produces smaller data files and uses less memory at run time, and generally you should always use keyframe reduction.
When building a player (Desktop, Android or iOS) it is important to not depend on System.dll or System.Xml.dll. Unity does not include System.dll or System.Xml.dll in the players installation. That means, if you want to use Xml or some Generic containers which live in System.dll then the required dlls will be included in the players. This usually adds 1mb to the download size, obviously this is not very good for the distribution of your players and you should really avoid it. If you need to parse some Xml files, you can use a smaller xml library like this one Mono.Xml.zip. While most Generic containers are contained in mscorlib, Stack<> and few others are in System.dll. So you really want to avoid those.
Unity includes the following DLLs with the players distribution mscorlib.dll, Boo.Lang.dll, UnityScript.Lang.dll and UnityEngine.dll.
Page last updated: 2013-07-04