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
2
Question by Nacho84 · Apr 08, 2013 at 05:20 AM · loadresourcesasync

Hiccups when loading images from resources folder

Hi! At some point in my game, I need to display some simple 2D animations which are made from several sprites (some of them quite big) that I translate/rotate/scale around the scene following a script. All the sprites are located in the resources folder.

At the moment, I'm preloading the first few sprites I need and then I load the rest in a co-routine that executes along with the animation playback so that the rest of the sprites can be ready when needed. Although this method works, the main problem I'm facing is that the application suffers a hiccup when the co-routine calls Resources.Load, which can be quite noticeable.

I've been searching around unity answers and, to the best of my understanding, there's no way to invoke Resources.Load as an asynchronous function. In fact, there seems to be a request for such a feature.

I've also tried the approach suggested in this thead but, just like the original poster, I'm also experiencing hiccups when loading big images.

I've changed my coroutine approach and replaced it with threads using this handy library but, again, the hiccups are still there.

Can you suggest any way to get rid of the hiccups? Thanks in advance for your help!

Cheers,

--Nacho

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
1
Best Answer

Answer by Fattie · Apr 08, 2013 at 05:24 AM

Note .. for 2016 Unity have recently added LoadResourceAsync which can be relevant.


Tragically there is no solution to this in the current version of Unity.

We have investigated this every way and the fact is Unity is not good at streaming in big images. (It's fine at getting big sounds from disk!)

Here's one of many questions about it ...

http://answers.unity3d.com/questions/393460/resourcesload-async-for-large-images.html

(Note for example the "WWW" class approach ..... you can and should try that but .. it also hiccups.)

You can't load large images on the fly in Unity -- it is how life is for now.

Comment
Add comment · Show 5 · 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 Nacho84 · Apr 13, 2013 at 08:18 AM 0
Share

Thank you for your reply. It's really unfortunate that there's no way to stream image data asynchronously! Oh well, I guess we'll have to work around that. Thanks again for your input!

avatar image whydoidoit · Apr 13, 2013 at 08:45 AM 0
Share

The big problem is probably the upload to the GPU right? That and all the screwing around with writability etc.

avatar image Fattie · Apr 13, 2013 at 09:36 AM 0
Share

dude I'm totally unsure if it relates to loading to the GPU...I fear not

I've found, with Unity it's simply not possible to "load smoothly" (stream, if you will) a large file.

TBC Unity does this flawlessly, brilliantly, with large AUDIO files, but it does not work with other types of files.

For example, you can just try loading-smoothly a massive text file, it won't work.

Regarding writability, that is not the issue, me and the bloke from 2DToolkit screwed around massively with that and that was not the woe.

In my useless opinion,

http://docs.unity3d.com/Documentation/ScriptReference/AsyncOperation-allowSceneActivation.html

that was the "biggest thing missing" from Unity ("WTF, a game engine where you can't keep an animation going while it loads the next level in the BG ?!"

incredibly they fixed that which was just totally awesome and amazing of Unity and I love them.

I$$anonymous$$UO, the biggest thing CURRENTLY missing from this issue is just that - it's nuts that you can't stream in a file without hiccups (other than audio, which works perfectly)

the classic example is you want to bring up a full-screen card between levels of your game

INDEED -- a somewhat related problem in Unity. It's very badly handled / can't be done to simply unload an asset.

it's nuts that you can't: have a couple of textures for your spaceships, and then unload those when you've left that part of gameplay and load the textures fo rthe neutronbikes.

a great example is cganing backgrounds on a 2.5D, it's nuts you cant firmly-get-rid-of the textures from the previous level BGs and load up the new ones effectively.

Diniesh is just now adding a whole slew of stuff in T$$anonymous$$ that allows you to load his atlases on the fly only when you need them (BUT IT WILL HICCUP, as discussed here), but there's really no real way in unity to get rid of the then unused items!!!

avatar image whydoidoit · Apr 13, 2013 at 09:55 AM 0
Share

Do you anims run smoothly with AsyncLevelLoad? $$anonymous$$ine glitch still :S

avatar image Fattie · Apr 13, 2013 at 10:02 AM 0
Share

in fact i have not had a chance to try allowSceneActivation yet !

but yes, unfortunately for me everything still glitches (and I assume it's the case when adding allowSceneActivation)

i think Unity is plain not good at underlying strea$$anonymous$$g in of files (except audio, which is perfect)

Unfortunately I am not an expert in this issue: I can't make a statement like "with game engines X, Y, Z performance is thus, and with native iOS apps performance is thus...". I do know that I was always able to make native iOS apps smooth as silk one way or another, and I observe as a consumer that many games see$$anonymous$$gly stream large things in, as a matter of course, while an animation is playing or the like.

(then again it is true that many major famous titles, on Wii and such, indeed hiccup all over the place, during loading scenes.)

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

iOS - Resources.LoadAsync is VERY slow on older iPads 0 Answers

Resources.LoadAsync() loads only one resources in the background? 0 Answers

How do I make sure a resource is loaded or is instantiated? 2 Answers

load resources material 0 Answers

Accessing 4.6 GUI build-in sprites in C# 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