Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 CgShady · Feb 26, 2013 at 01:29 AM · iosassetresourcesquit

Can a big resources.assets file cause issues on iOS ?

Hi,

I'm working on an iOS project, targeting the iPad mini.

I've come to find it handy to put most of the UI textures in the Resources folder and load them with Resources.Load(), instead of assigning them manually in the editor.

Now, I'm facing an odd problem. When running the project from Xcode, it starts the app on the device, showing the launch screen and loading indicator for a while, then closes. Xcode says nothing but "Finished running XXX.app on iPad", like it was the expected behaviour - no error code or what so ever.

I've stripped the project down so that I now only have my welcome screen scene and kept my Resources folder with all unnecessary resources in it. Problem still happens. When I remove the unnecessary resources, the application starts much faster and remains open.

This makes me think the resources.assets file is fully loaded upon start, and that there's some kind of limited time to load it fully before the app stops. What is also weird, is that if I keep running the app multiple time, eventually, it'll open. Letting me think it keeps loading that file from a run to the next.

Can someone bring some light over this please ?

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

4 Replies

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by CgShady · Apr 04, 2013 at 11:29 PM

Ok, I'll try to bring some light over this.

I stripped the project I had problem with so that it contains :

  • an intro scene file with nothing but a script that loads next level on a touch

  • a second scene that displays some GUI elements with an OnGUI function in a script

  • that OnGUI uses a GUISkin, which is loaded from the Resources folder with Resources.Load()

  • the GUISkin references a few small textures, so far so good..

  • the Resources folder also contains huge textures, flagged as GUI, NPOT and not compressed (I made them really big on purpose for testing)

Result : A huge resources.asset file (130Mb), two tiny sharedassets0.assets and sharedassets1.assets files (4kb and 5kb). Once loaded, the first screen shows up really quickly. (it doesn't use any of the files from the resources) Then tapping goes to load the next level, wheel ... then app closes

iPad backboardd[27] : Application 'UIKitApplication:com.xxx.yyy[0xcee9]' exited abnormally with signal 9: Killed: 9

My understanding is that the resources.asset file doesn't support partial loading. So when accessing it for a few small files, it will load it all, and get us killed by the system after memory warnings..

I'm now looking at splitting everything in asset bundles to work around this.

Comment
Add comment · Show 1 · 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
avatar image CgShady · Apr 05, 2013 at 07:24 AM 1
Share

Using Asset Bundles works like a charm. I split my resources folder into asset bundles and load assets (textures) async from them. Not been warned about memory so far..

avatar image
0

Answer by dannyskim · Feb 26, 2013 at 05:28 PM

Most likely the behavior that your application is inhibiting is because you're running out of RAM / VRAM. Your textures are probably taking up too much space, so either try down res-ing or make sure all your textures are power of 2 to reduce memory waste.

Comment
Add comment · Show 2 · 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
avatar image CgShady · Feb 26, 2013 at 05:33 PM 0
Share

Well, the thing is that those textures are not loaded. All I have is a single Scene, using a few textures from the Resources folder, but not all.

When I manually remove the never used textures, the app runs fine. When I put them back, it just stops, but I don't even get a warning from Xcode either. No $$anonymous$$emory warning, nothing.

avatar image dannyskim · Feb 26, 2013 at 05:38 PM 0
Share

What's their compression settings, if any.

avatar image
0

Answer by Tarlius · Feb 26, 2013 at 05:45 PM

Resources in Resources are not loaded, but they are (obviously) copied to the device, which will impact how fast your app builds and deploys.

If your program is running out of memory, you'll get flooded with Memory Warnings on the console (they come when you still have space too, its a bit of a black box) and springboard will kill your app.

If you do have any objects in the scene referencing items directly in a resources folder (Ie, a public Texture2D assigned in the editor) they will be loaded at runtime, as will prefabs linked in the editor, and any textures (etc) on the prefabs.

Stupid question, maybe, but did you try turning it off and on again? A lot of XCode's "quirks" can be resolved with a simple close, unplug devices, reopen, replug devices. (I've wasted many hours to have a "serious" problem vanish like this...) Come to think of it, I think I've had that one before >.>;; Another common two are "Could not connect to debugger" and "Could not find executable"

Another trick that sometimes fixes stuff like this is a Clean (Cmd + Shift + K), often mixed in with the above.

Comment
Add comment · Show 2 · 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
avatar image CgShady · Apr 04, 2013 at 08:06 PM 0
Share

I'm nailing it down, and before I post a final answer to this, here are a few things I found about : - resources really seem to be loaded, wether you call them or not - NPOT textures are not compressed at all on iOS, which makes GUI textures eat a lot of RA$$anonymous$$

avatar image Tarlius · Apr 05, 2013 at 07:44 AM 0
Share

NPOT textures don't get compressed in the editor either, if you look. Even if you check pvrtc it will still show them as 32bit. As far as I'm aware, this is a limitation with PVRTC, not unity. What most people seem to do for UI textures is bundle them all into one big power-of-two texture (called an atlas) and compress it that way. The space in the texture you don't use is, of course, wasted though :( If you're doing mobile devices, this also lowers your draw calls while will give you a nice FPS boost too.

avatar image
0

Answer by Graham-Dunnett · Feb 27, 2013 at 10:16 PM

The documentation is pretty detailed about how to troubleshoot problems running on device. If the application is out of memory, then you'd get an applicationDidReceiveMemoryWarning() message. Since you do not mention this in your question, I suspect that you are getting killed because the app is taking too long to display the first frame. In this case you'll get a killed by SpringBoard message in XCode.

Comment
Add comment · Show 3 · 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
avatar image CgShady · Feb 28, 2013 at 02:46 AM 0
Share

I just checked in XCode ; no message about SpringBoard. I also did try adding an in-between scene which loads the next scene with a click of a button. In which case the first screen loads ok, but when trying to load the next it stops the app, with no warning what so ever. I know too little about Resources, is it possible that fetching a resource triggers the loading of the whole asset file ?

avatar image Tarlius · Feb 28, 2013 at 03:03 AM 0
Share

Did you check in the Organiser in XCode, or just the console? I think the Organiser sometimes gives you a little more info.

If you load a prefab, it will load everything that that prefab references (see my answer). This includes everything that those things reference (etc), as well as all children, etc. You may need to break things up a little more and load linked resources using Resources.Load as needed.

For example, if you have a factory prefab that holds direct references to every enemy prefab in your game, when you instantiate the factory it will also load all the prefabs and their textures. And if you have a prefab of factories that reference prefabs...

However, since you said you're getting no memory warnings, this might not be the cause of your issue...

avatar image Fattie · Jun 28, 2013 at 08:32 AM 0
Share

Hey Graham, or anyone .. to step back, I have a simpler question.

Is "resources.assets" - in fact - pretty much: "stuff in your Resources/ folder"?

Would you say that is correct?

Cheers!

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

13 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

Related Questions

Implement Apple TV ODR (On Demand Resources)? 1 Answer

Memory problem. How do I dump a Streaming Asset from memory? 1 Answer

GameObject permanent destruction from "Resources" in EditorWindow 0 Answers

Why a 109kb .png file teakes 8mb in unity? 1 Answer

Loading XML asset after build 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