Loading Dynamic Content || Loading Content from External Directory

In my current game, modding is a HUGE part of the game. It took me a while to develop a good system of loading modded content into the game, but I finally settled on a method, and I would like to keep it if possible.

How I’m handling modded content
In the game’s content folder (C:/Users/username/4X), there is a Mods folder. Each mod will have it’s own folder inside of the Mod directory. The game goes through a file (Rather, it will. I haven’t implemented it yet), and figures out which Mod directories that it’s going to load. After it’s figured that out, it loads all of the content into the game (I can explain in more detail if its pertinent to the topic, I just don’t wan’t to use up space on unnecessary things).

So what’s your problem?
Well, the mods will all have raw resources (.fbx, .wav, .mp3), and since I can’t load anything but XNB files, I have absolutely no idea how to load the mod’s content. Well, I take it back, I’ve been thinking of a few solutions but I really don’t know which is more practical, or if there is a better way of doing this.

First, I thought about borrowing some code from the Pipeline application, and building all of the mod’s content the first time it was loaded, but I don’t fully understand the Pipeline’s code, and I didn’t want to mess up something by partially implementing it.

Next, I thought about requiring mod creators to use the Pipeline to build their content before they release their mods, but that seemed kind of unprofessional, since I want to have a Mod Creation Engine that has all of the tools bundled together. Which brings me back to using some of the Pipeline’s code and embedding it in the engine, but then I have the same issue as my last idea.

And finally, I thought about just loading raw content. But there’s an obvious flaw with that idea.

So I guess what I’m asking is:

  1. Is there a way I can load raw content?
  2. If not, how can I start learning about the code that makes the Pipeline application tick, since I’ll probably have to use some of it’s code?

Most of the data types have a FromStream static method for loading raw content.
Texture2D.FromStream for example.

Note that Model does not have a FromStream method. The Model class from XNA is a very simple model implementation, and is really just a collection of vertex and index buffers. You would need to use the content build pipeline to import and produce a XNB file or write your own FBX importer and put the data into your own model structure.

Also, the Texture2D.LoadFromStream will return 32-bit BGRA textures only. If you want compressed textures you will need to go through the content pipeline again.