Hello Guest

Author Topic: Huge Difference between Android and PC compiled project sizes  (Read 5251 times)

edb

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 43
    • View Profile
Huge Difference between Android and PC compiled project sizes
« on: February 09, 2015, 04:24:12 pm »
I'm making a cross-platform game (PC and Android) and heavily using Tk2d Sprite Collections with 1x 2x and 4x atlases.

The Android apk compiles to about 46 megs, which is about the size I would expect.
The Standalone project compiles to 800 megs, which is what don't understand.  Why the big difference in sizes?

When I look in the Standalone's compiled directory and in the projectName_Data folder, it seems the main culprit is
the "resources.assets" file, which is 517 megs.  The "sharedassets.assets" files are all really big, too.

Any ideas on what's going on?  Thanks.
 

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Huge Difference between Android and PC compiled project sizes
« Reply #1 on: February 09, 2015, 04:25:59 pm »
Unity doesn't compress RGBA images on PC builds. The android builds are compressed on disk. I'm not sure of why they decided to do it this way - you can get better results by using png atlases, at the cost of loading times.

edb

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 43
    • View Profile
Re: Huge Difference between Android and PC compiled project sizes
« Reply #2 on: February 09, 2015, 08:46:59 pm »
Changed the SpriteCollections to png atlases and that took the "sharedassets.assets" sizes way down - thanks!

But - the reources.assets file is still 179 MB.  I have 13 MB of textures in my resources folder and those file are being reported as huge in the editor.log file after I build.

Any ideas on how to make those textures in the resources folder export smaller for standalone?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Huge Difference between Android and PC compiled project sizes
« Reply #3 on: February 09, 2015, 09:48:38 pm »
the textures will be the atlases I guess?
YOu will need to figure out how to make it smaller. 179 mb is hardly a problem though is it? At the end of the day your download is going to be zipped or otherwise compressed, it should compress quite nicely....

edb

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 43
    • View Profile
Re: Huge Difference between Android and PC compiled project sizes
« Reply #4 on: February 09, 2015, 10:21:17 pm »
Specifically I'm trying to figure out how to avoid this ->  a 964 KB png in my resources folder is being exported at 8.8 mb, according to the editor.log.

That's a crazy waste of space.  It'll zip up ok for transferring, but that 8.8 mb file will be what sits on a person's hard drive once the game is installed, if I'm following this correctly.

Those SpriteCollection atlases export nice and small...what's the trick?


   

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Huge Difference between Android and PC compiled project sizes
« Reply #5 on: February 09, 2015, 11:06:01 pm »
well pngs in resource folders are treated as textures. That has absolutely no bearing to the size of the asset as a png image is essentially zip compressed. If its uncompressed its likely a 2k by 1k image or something similar, 2k x 1k x 4 = 8mb, thats how big its going to be. tk2d uses some nasty tricks to make unity keep them as pngs and load them at runtime. You'll have to do similar things if you want to get rid of that.

edb

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 43
    • View Profile
Re: Huge Difference between Android and PC compiled project sizes
« Reply #6 on: February 09, 2015, 11:44:15 pm »
Ok - thanks for the help.  I'll ask around the main Unity forum what others do or if it's even worth caring about.