Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 11 Next capture
2021 2022 2023
1 capture
11 Jun 22 - 11 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by lermy3d · Jul 16, 2015 at 04:57 PM · uiprefabbundlefilesize

UI prefabs in bundles are taking huge large size

Hello community!

I am using Unity 5.1.1p4 and I have being dealing with this question about the size of my bundles.

The thing goes like this, I have a folder with my UI prefabs, just the prefabs, no other asset, no other resources, nothing else, but my prefabs. I have 22 of them and they occupy 1 Mb exactly in my unity project folder. Then I mark them to a bundle and I build the Asset Bundles.

When I check the size of the prefab_ui bundle is 26 Mb! How can 1 Mb of text can grow to 26 Mb instead of been compressed!

If I don't use UI elements then the size is been compressed, as expected, for instance my managers prefab folder occupy 19.4 Kb and the bundle for this is 4.2 Kb, completely reasonable!

Can anyone on Unity could please explain if something is being added to the bundle that the UI prefabs need? or this is just some kind of bug.

I know that in Unity 5.2.0x the size for bundles using sprite atlases will decrease a lot but even using the beta that will not be the case in this matter.

Best regards, Lermy

--- EDIT: ---

I found the Actual Reason!! Here it goes:

The reason for why this is happening was that one prefab was taking references from assets that were inside a project folder, therefore by not being inside another bundle the build system was including them inside the bundle itself. If those assets are references from another bundle then they qualify as a bundle dependency and they will not be included in the bundle, which is why the final bundle size was so huge.

Now two things about this, first: Why we are not getting a correct log in the .manifest file to be aware about this? That would be nice to have so we can keep track of all the assets that actually ship with the bundle.

and second: That could also help us solve the problematic inconsistent asset issue and help us detect where one prefab is making a reference to multiple bundle variants.

It would also be nice to hear from Unity guys about the PreloadTable from the image I also posted below.

Hope this helps everybody! Thanks a lot! Lermy

Comment
Add comment · Show 3
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Julien-Lynge · Jul 16, 2015 at 04:59 PM 0
Share

Hey @lermy3d,

Don't know if this is it, but I seem to remember a bug recently where Unity was saving out one copy of the sprite sheet for each individual sprite ins$$anonymous$$d of mapping multiple sprites to the sprite sheet. You may want to check around on google to see if I'm remembering correctly and if that's still an issue in your specific case. If so, they may be fixing that bug in 5.2.x.

avatar image lermy3d · Jul 16, 2015 at 05:05 PM 0
Share

Well I only have prefabs in this bundle, not sprites, but you are correct, in bundles where I do have sprites that are stored in an atlas the size is decreased when compared to bundles made by Unity 5.2.x betas to 45%.

So this probably be that they are saving a copy of the resource inside the bundle somehow without logging that in the manifest.

I have no way of knowing that, therefore my question.

avatar image lermy3d · Jul 30, 2015 at 10:19 PM 0
Share

I posted the solution to this problem in the original question, I cannot answer twice, I think that the voting system is for that exactly, to help people select the best answer, but well... :)

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by lermy3d · Jul 16, 2015 at 11:48 PM

Edit: The actual answer is in the original post.

Here is the probable reason!! I am attaching a picture which shows the amount of items in the Preload Table of the bundle, and the amount is 12343.

alt text

If those assets are being shipped alongside the bundle, then that is the reason why the bundle size has the monstrous cipher of 26 Mb when the bundle originally was suppose to have 22 prefab items only, those are actually into another array called Container which is correct.

Can anyone on Unity explain a little bit about the Preload Table, it is a list of references that are updated with the bundle load? or is the list of attached resource dependencies and they ship with the bundle? and why those references are not being loaded from their respective bundles? since the manifest declares the dependencies correctly from the other 3 bundles where my assets really are.

Hope this is well explanatory to help other people having the same issue. Please have a nice day! :)


prefab-ui-preload-table.png (28.9 kB)
Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

3 People are following this question.

avatar image avatar image avatar image

Related Questions

UI Text.color not assigning? 2 Answers

Prefab: Printing single letters of a word in UI Panel (one public variable different values) 2 Answers

Display Item Sprite on Inventory UI 1 Answer

Reset an GO to its original state (start app state) 2 Answers

Display text above prefabs in Unity 4.6 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges