Accessing the XNA Content Pipeline

Content, Content Management, and the Content Pipeline

Let's start by defining a few terms. First, content is pretty much everything in your game besides the code. It's the 3D models, the fonts, the images, the sound effects, the music. To make a game, you're going to need content, and lots of it. These tutorials are not so focused on how you create your content. (I'd love to add some in the future, but it's way down the priority list right now.) But as we go through different tutorials, I'll point out some starting points to you, so don't stress too much.

Second, content management is the part of your game, game engine, and tool chain that takes your content from raw files to something usable in your game. Content management is not a trivial task. If you look at the credits for a high end game, you'll probably discover that the majority of people dealt with the content and the processing of the content, rather than just coding a game.

There are lots of different strategies for managing content when you're doing game development in general, but what XNA does (yes, I know this is the MonoGame section of my site) is uses the concept of a content pipeline. The content pipeline is something that you dump your raw art assets into, and it passes it through various stages (which you can configure) and ultimately puts it into a form that you can quickly and easily use in your game.

If you've never tried to make a game without some sort of pre-made content management system, you may not really get a good feel for how much easier this makes your life. Let me just say that without something like this, you're pretty much dead in the water. You'd spend your first six months building something that can load all of your files, and by that point, you'll have just an image reader and a 3D model reader, and you'll be tired and frustrated with no game to show for it, and you'll give up and become a cashier instead.

Now where were we?

Right. MonoGame. So MonoGame is supposed to be an open source implementation of XNA that runs everywhere, and is generally more awesome than XNA. But for some reason, they decided that a content pipeline wasn't a necessary part of MonoGame. Or rather, it was something they could do later. They're hard at work on it right now, and we might see that sometime in the next few months. (Supposedly in version 3.3, but it's impossible to say when that will come out.)

But for now, we're without a content pipeline, and that's a problem. A really big problem.

We'll need a workaround to hold us over. The workaround is to piggyback off of XNA's content pipeline. It's less than ideal, but it works until there's a better option.

On the bright side, With the new 3.2 version of MonoGame, XNA's content pipeline integrates much better into your MonoGame project than it has in the past. So at least its getting better.

For the rest of this tutorial, we'll discuss three different ways to get access to XNA's content pipeline. You don't need to do all three. One is enough.

Installing XNA

I've got good instructions for installing XNA over in the XNA Tutorials section. The best way to install it is to follow that tutorial and come back here when you're done.

(Note that you won't need to follow the part about installing Visual Studio. You should already have a good version of Visual Studio by this point.)

Validating the Installation

So once you've got the XNA content pipeline available, and MonoGame installed, it should be pretty easy to evaluate whether the installation is working.

With your MonoGame project open, go over to the Solution Explorer and go to the top node in the tree (the solution node).

Right-click on it and choose Add > New Project…. (We're adding a second project to our solution, which will handle the content.)

Under the Visual C# > MonoGame category, you'll see a project type called MonoGame Content Project. Select this one.

Give it a name (perhaps if you called your game AwesomeGame, you'd call this AwesomeGameContent) and press OK.

This will create the content project.

If this new project loads correctly, XNA's content pipeline is available for your use, and your content project is good to go.

If the MonoGame Content Project template isn't there, then MonoGame isn't installed correctly.

If it gives errors when trying to create and load the project, it means XNA isn't installed correctly.

Troubleshooting.png Having problems with this tutorial? Try the troubleshooting page!