[Help Wanted] Introduce Content.Load<Song>() fallback to load from file when no .xnb exists
#8,483 opened on Sep 11, 2024
Description
Intent
Content.Load should have the ability to "fall back" At Runtime and load song files when no corresponding .xnb exists.
This will enable a single path for developers to load songs whether they choose to use the content pipeline or not and greatly simplify the documented process for loading content.
This is not for the MGCB tool as that is used to build
.xnbs already, this is about runtime!
The "Fallback" would need to handle:
- Locating the specific file in question based on the file name (including handling for naming casing) - e.g. (Background.ogg vs background.ogg or BackGround.ogg from "background" as a name.
- Handling sub-paths / folders (e.g. "Audio/Menu/background.ogg")
- Determining the correct filetype being loaded (based what MonoGame supports at runtime), ogg, wav, etc
- Handling the correct functionality to use to load the file and return the
Songdefinition
Support is preferred by the community to help to make this happen and unify the path for all developers.
Motivation
In order to simplify the loading of manual content, rather than having separate code to identify, load, and manage files, the existing Content.Load methods should be enhanced with a fallback measure to engage with content of the specified time.
This ensures a simple path for all MonoGame developers regardless of which path they choose and also reduces the impact should the developer need to switch path and cut out unnecessary code changes.fallback
See ALso
Shaders and Models are excluded for the moment as they have additional dependencies