Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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
1
Question by Prdik · Feb 25, 2018 at 08:12 AM · androidperformanceresourcesperformance optimizationresources.load

Lot of resource files

Hello,

I'm working on game where I have many pictures. There are 5 location and 100 enemy images. Issue is that they are used only sparsly. Location img for switching location is used only once in every 20 games or so and out of 100 enemies only 1 is always used at a time so the rest is not used. I always worked with Resources folder to load assets from there but from what I red on unity pages (https://unity3d.com/learn/tutorials/topics/best-practices/resources-folder) it should not be used generally.

They also recommend using AssetBundles (which I never used before), but from what I red on the web, if I put 100 images into AssetBundle, the memory usage will get high as it contains a lot of resources and thus the loading time will take more time. Since I'm making game on android, its crutial to keep loading times at minimum.

Does anybody has any experience handling lot of resouce images/audio files that are nt used so often and if using AssetBundles is the way or if there is other more effective way in sence takt the loading will be faster?

Thank you.

Comment
Add comment
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

1 Reply

· Add your reply
  • Sort: 
avatar image
2

Answer by Xarbrough · Feb 25, 2018 at 01:58 PM

Have you measured your performance problems already? The Profiler would be a start to measure the execution time of your loading code if it's executed after Awake. Anything before that is more difficult to time, but a simple stopwatch can help.

After profiling, you might realize that loading 100 images is hardly an issue unless you made some big mistake or the images are unreasonably large. The link about best practices for the resources folder mentions, that lookup performance degrades noticeably at around 10.000 objects. This is more of the scale where performance becomes relevant.

In any case, using the resources folder to load one out of 100 images sounds like a good idea. Remember, if you have a list of references to all 100 images in your scene, they all will be loaded at deserialization and therefore remain in memory unless the scene is unloaded. With the resources system, you can load a single image, so this would work for your use-case.

AssetBundles are indeed the way to go for bigger productions. You would try to divide your content into chunks which should be loaded together. Something like "Level13-Assets", so you can load and unload bundles on demand. As mentioned in the documentation, they have a few other benefits like the ability to download via the web and replace content on the fly. However, putting 100 images into one bundle doesn't benefit your loading time at all. Creating 100 AssetBundles is also not practicable. Basically, if you don't have at least several hundred assets, it's not going to be faster than just loading all references at scene load.

Hence, I would stick to scene references first, then optimize to only load specific files, if performance drops and switch to AssetBundles if the asset count is at least a few hundred.

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

181 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Android & IOS Performance Difference 1 Answer

Does rendering the game at lower resolution consumes less power on Android? 1 Answer

Why is there a performance discrepancy between LG G4 and iPhone 6s 0 Answers

ridiculous load time using Resources.Load() on android build 0 Answers

Low fps in simple 3D android game 3 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