-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AssetMetaMode #10623
AssetMetaMode #10623
Conversation
IMO the strategy here is to put the correct config in the Bevy template used for the jam, but keep the existing default behavior. I don't think changing this is the right choice long-term, otherwise I'd be more okay with swapping the default now. |
Will the |
Yup this works on wasm / thats why it exists in the first place (as this workaround isn't needed if you aren't deploying to wasm / trying to prevent logspam / trying to avoid errors on platforms like itch that return non 404 error messages). |
Per the discussion above, I have made this non breaking by switching the meta check AssetPlugin field to a resource. I've also added a new AssetServer constructor to avoid breaking changes to the existing constructor. |
Can you provide an example for how someone would use this? Edit: I see this is an update to bevy's asset system so it should be the same as making any other changes to the plug-in, correct? |
@P13L0v3r I've just added a usage example to the description. Hope that helps! |
# Objective Fixes #10157 ## Solution Add `AssetMetaCheck` resource which can configure when/if asset meta files will be read: ```rust app // Never attempts to look up meta files. The default meta configuration will be used for each asset. .insert_resource(AssetMetaCheck::Never) .add_plugins(DefaultPlugins) ``` This serves as a band-aid fix for the issue with wasm's `HttpWasmAssetReader` creating a bunch of requests for non-existent meta, which can slow down asset loading (by waiting for the 404 response) and creates a bunch of noise in the logs. This also provides a band-aid fix for the more serious issue of itch.io deployments returning 403 responses, which results in full failure of asset loads. If users don't want to include meta files for all deployed assets for web builds, and they aren't using meta files at all, they should set this to `AssetMetaCheck::Never`. If users do want to include meta files for specific assets, they can use `AssetMetaCheck::Paths`, which will only look up meta for those paths. Currently, this defaults to `AssetMetaCheck::Always`, which makes this fully non-breaking for the `0.12.1` release. _**However it _is_ worth discussing making this `AssetMetaCheck::Never` by default**_, given that I doubt most people are using meta files without the Asset Processor enabled. This would be a breaking change, but it would make WASM / Itch deployments work by default, which is a pretty big win imo. The downside is that people using meta files _without_ processing would need to manually enable `AssetMetaCheck::Always`, which is also suboptimal. When in `AssetMetaCheck::Processed`, the meta check resource is ignored, as processing requires asset meta files to function. In general, I don't love adding this knob as things should ideally "just work" in all cases. But this is the reality of the current situation. --- ## Changelog - Added `AssetMetaCheck` resource, which can configure when/if asset meta files will be read
For anyone else who is still getting 404's after this change, make sure you put |
#1255 strikes again :( |
As documented upstream in bevyengine/bevy#10623, bevy 0.12.1 can result in black screens on wasm if meta files are not available. Setting the AssetMetaMode to AssetMetaChck::Never is a band-aid fix for this issue.
As documented upstream in bevyengine/bevy#10623, bevy 0.12.1 can result in black screens on wasm if meta files are not available. Setting the AssetMetaMode to AssetMetaChck::Never is a band-aid fix for this issue.
As documented upstream in bevyengine/bevy#10623, bevy 0.12.1 can result in black screens on wasm if meta files are not available. Setting the AssetMetaMode to AssetMetaChck::Never is a band-aid fix for this issue.
As someone who just lost quite a bit of time to this while trying to upload to itch.io, I second the suggestion to make this the default for 0.13 (if it isn't already). |
Objective
Fixes #10157
Solution
Add
AssetMetaCheck
resource which can configure when/if asset meta files will be read:This serves as a band-aid fix for the issue with wasm's
HttpWasmAssetReader
creating a bunch of requests for non-existent meta, which can slow down asset loading (by waiting for the 404 response) and creates a bunch of noise in the logs. This also provides a band-aid fix for the more serious issue of itch.io deployments returning 403 responses, which results in full failure of asset loads.If users don't want to include meta files for all deployed assets for web builds, and they aren't using meta files at all, they should set this to
AssetMetaCheck::Never
.If users do want to include meta files for specific assets, they can use
AssetMetaCheck::Paths
, which will only look up meta for those paths.Currently, this defaults to
AssetMetaCheck::Always
, which makes this fully non-breaking for the0.12.1
release. However it is worth discussing making thisAssetMetaCheck::Never
by default, given that I doubt most people are using meta files without the Asset Processor enabled. This would be a breaking change, but it would make WASM / Itch deployments work by default, which is a pretty big win imo. The downside is that people using meta files without processing would need to manually enableAssetMetaCheck::Always
, which is also suboptimal.When in
AssetMetaCheck::Processed
, the meta check resource is ignored, as processing requires asset meta files to function.In general, I don't love adding this knob as things should ideally "just work" in all cases. But this is the reality of the current situation.
Changelog
AssetMetaCheck
resource, which can configure when/if asset meta files will be read