Overview of the Content Pipeline
The XNA Game Studio Content Pipeline lets you build art assets into your game automatically from whatever file formats they are being maintained in.
Most games use art in the form of models, meshes, sprites, textures, effects, terrains, animations and so on. Such art assets can be created in many different ways and stored in many different file formats. They tend to change frequently in the course of game development.
The Content Pipeline is designed to help you include such art assets in your game easily and automatically. An artist working on a a car model can add the resulting file to the XNA Game Studio game project, assign the model a name, and choose an importer and content processor for it. Then, a developer who wants to make the car drive can load it by name using a call to ContentManager.Load. This simple flow lets the artist focus on creating assets and the developer focus on using them, without either having to spend time worrying about content transformation.
Purpose of the Content Pipeline
The XNA Framework Content Pipeline is designed to:
- Let game artists use the digital content creation (DCC) tools of their choice.
- Provide a mechanism to decouple digital content's dependency on a particular game engine.
- Provide a simple, expandable content build system that meets the needs of both artists and developers.
Basics of the Content Pipeline
Recognizing that DCC tools save content in many different file formats, the XNA Game Studio Content Pipeline lets you build art assets into your game automatically from whatever file formats they are being maintained in. Here's a high-level view of how it works.
- XNA Game Studio supplies standard importers and processors for a number of popular DCC file formats (see Standard Importers and Processors).
- Third parties also create custom importers and processors for XNA Game Studio to support additional formats.
- If you have enough information about a DCC file format, you can write your own custom importer and processor for it using classes provided by the Content Pipeline class library (see How To: Write a Custom Importer and Processor).
- When you include an art asset file in your XNA Game Studio game project, you use its Properties sheet to specify the importer and processor that is appropriate to it. Thereafter, when you press F5 to build your game, the proper importer and processor for each asset is automatically invoked, and the asset is built into your game in a form that can be loaded at run time on Windows or the Xbox 360 by using ContentManager.Load.
Importers vs. Content Processors
- An importer takes art assets saved in a particular DCC file format and converts them into objects in the XNA Game Studio Content DOM (document object model) that standard content processors can consume, or into some other custom form that a particular custom processor can consume.
- A processor takes one specific type of imported art asset, such as a set of meshes, and compiles it into a managed code object that can be loaded and used by XNA Game Studio games on Windows and the Xbox 360.