NiklasEi / bevy_asset_loader

Bevy plugin helping with asset loading and organization
Apache License 2.0
482 stars 53 forks source link

See which asset is being loaded during progress tracking #108

Open janhohenheim opened 1 year ago

janhohenheim commented 1 year ago

This concerns the progress_tracking feature. I've got an issue where sometimes a single asset never finishes loading. It's hard for me to debug this without knowing which assets already finished loading. I thought about simply querying an Option<Res<MyAsset>> for every asset and putting the .is_some() output into a struct during loading, but that feels like excessive boilerplate. Is there a better way to either know which assets are finished loading or which asset is being loaded right now?

NiklasEi commented 1 year ago

I don't think that there is a better way at the moment. The logging could definitely be improved here.

If an asset fails to load I would always expect the asset server or loader to report that.

janhohenheim commented 1 year ago

I did it the manual way now (https://github.com/janhohenheim/foxtrot/blob/main/src/file_system_interaction/asset_loading.rs#L98) and have identified that a GLTF sometimes just loads forever, so there is no error being reported since it didn't actually fail. It's hard to debug since it apparently happens nondeterministically and I don't think I can get any information out of the loading state for debugging :/ I have no idea if the bug happens in your plugin or the asset server.

NiklasEi commented 1 year ago

I would be surprised if that problem has anything to do with bevy_asset_loader. The actual loading of the GLTF file and it's dependencies is handled by the asset loaders/server. Have you tested the same GLTF model in a simple Bevy app without any dependencies?

janhohenheim commented 1 year ago

I see, that makes sense. I didn't isolate the issue yet because it happens quite rarely and so it's quite hard to say for sure whether or not my minimal app captures it. I guess I'd have to create an App in a loop and check with a timer whether the GLTF was loaded after a while? Not sure. But yeah, there's a potential bug report for Bevy lurking in here.