AssetManager getProgress doesn't return 1 if an asset fails

Discussions for core devs and contributors. Read only for normal forum members to keep the noise low

AssetManager getProgress doesn't return 1 if an asset fails

Postby siondream » Sat Apr 20, 2013 3:16 pm

Hi guys,

This issue [1] explains how assetManager.getProgress() never returns 1.0f if any of the loaded assets fails to load. If you catch the loading exception with an AssetErrorListener, the app won't crash but assetManager.getProgress will never reach 1.0f as the loaded count never reaches toLoad. Nevertheless, assetManager.update() will return true when the remaining assets finish loading.

I guess this messes with people trying to implement progress bars. You could argue that if an assets fails to load, you should error and die miserably but that's not always necessarily the case. The solution would be pretty straightforward. However, I wanted to check first whether the current behavior is actually the intended one.

It all the depends on what progress means in this case:

  • Assets actually loaded / total asset count
  • Assets processed / total asset count

Cheers.

[1] https://code.google.com/p/libgdx/issues ... akechanges
siondream
 
Posts: 364
Joined: Tue Apr 03, 2012 11:59 pm

Re: AssetManager getProgress doesn't return 1 if an asset fa

Postby mzechner » Sat May 04, 2013 5:35 pm

I'm not sure how this would affect existing apps. I guess Nate should chim in as well.
mzechner
Site Admin
 
Posts: 4879
Joined: Sat Jul 10, 2010 3:50 pm

Re: AssetManager getProgress doesn't return 1 if an asset fa

Postby BurningHand » Sat May 04, 2013 5:48 pm

Yes, let's hear from Nate.
IRC: nexsoftware / mobidevelop; GitHub: MobiDevelop;
BurningHand
 
Posts: 2812
Joined: Mon Oct 25, 2010 4:35 am

Re: AssetManager getProgress doesn't return 1 if an asset fa

Postby NateS » Sun May 05, 2013 9:32 am

Nate posted his comments on this in the issue tracker 2 weeks ago. :mrgreen:
NateS
 
Posts: 1980
Joined: Fri Nov 12, 2010 11:08 am

Re: AssetManager getProgress doesn't return 1 if an asset fa

Postby BurningHand » Sun May 05, 2013 1:21 pm

We were testing email notifications and apparently had nothing more interesting to say. :geek:
IRC: nexsoftware / mobidevelop; GitHub: MobiDevelop;
BurningHand
 
Posts: 2812
Joined: Mon Oct 25, 2010 4:35 am


Return to Libgdx Development

Who is online

Users browsing this forum: No registered users and 1 guest

cron