I place all my pipeline generated content into a single .pak file and load using the following custom Content loader:
public class PAKContentManager : ContentManager
{
string _basePath;
private GraphicsDevice device;
private IGraphicsDeviceService graphicsDeviceService;
private IServiceProvider serviceProvider;
FilePacker.GetFileStream() returns a stream that reads a portion of the .PAK file as if it was a stream of its own.
This works pretty well. Except for Songs (probably videos, have not checked). These file types fail because the .xnb is not the actual song, just a placeholder that refers to the song, and the MonoGame library does not seem to call the OpenStream method for the actual song file in the .PAK. I get around it by extracting the song files to a temp folder. But I really would prefer to not have to do that.
I am using Windows/DirectX, and Android with the latest 3.8 nuget package. They both have the same issue.
Primarily because the app is multi game and new games can be added and downloaded via this pak file. The delivery is on a closed network with hundreds of clients. The pak file is compressed to reduce transfer time over wifi when literally hundreds of clients need to get updated. and each pak file contains everything needed for one entire game. Also it is easier to check the digital signature of a single file to determine if an update is needed and easier to download a single file when a new game becomes available.
Otherwise there would be literally thousands of files to deal with and manage.
But debate about design aside, this decision was made some time ago. The local temp file has been working for a while. But I was just wondering if someone with more knowledge of the inner workings might have a better idea.