NightCabbage:a) How do you get content into your game for the xbox? Do you literally fill the Content up with thousands of image, sound, model, etc. files?
I don't know about thousands, but yes, your content generally goes into the Content project.
NightCabbage:b) With files being loaded from a folder, you could simply say "load all files in this folder". Can you do something similar with the Content Pipeline? I note you can create folders in there, so I imagine this should be possible.
Sure. You can do something like this:
| string[] files = Directory.GetFiles(Path.Combine(StorageContainer.TitleLocation, "Content/Textures")); |
| foreach (var f in files) |
| { |
| Texture2D texture = Content.Load<Texture2D>(f); |
| // do something with the texture |
| } |
NightCabbage:c) What about files of types that aren't supported by the Content Pipeline, such as your own custom formats for storing information about units or weapons, etc.?
If you right click and choose the properties for a file, you can set the Build Action property to None and the Copy property to Copy if Newer and have the file copied over as is. Or you an learn about custom content importers and processors and put the file through the content pipeline if you want.
NightCabbage:
d) When you build your game, it creates an xnb file per content file - what if you wanted to compress all of your textures in a single file, etc.?
You'll have to make a custom post-build action. If you want an example, I once maintained a project called EasyZip that scooped up all content files and put them into a ZIP file. It's not updated, but you can see all the code if you want to figure out how to do something similar:
http://easyzip.codeplex.com.
NightCabbage:
e) How are you supposed to get new content into the game, such as downloadable content, maps, mods, etc.?
DLC is not supported for Xbox LIVE Indie Games. You can update your game, put it through peer review, and your customers will be notified of the new update when they start your game.
NightCabbage:
f) If I want to release a game on windows and xbox, without much modification of the code, how can I do this?
Pretty easily, though you'll need to ask more specific questions. In general, 90% or so of your code should be just fine going from Windows to Xbox 360. The XNA Framework does a good job of being cross platform.
NightCabbage:
I just don't understand how this could be a good method of managing content... perhaps someone can explain it to me a little better?
The main benefit is preprocessing. A PNG file requires that it be read, decompressed (since PNGs are compressed), and then converted into a more GPU friendly format. The content pipeline takes that PNG at build time, does that conversion, and writes it to a compressed (if you're in release mode) XNB file which is that more GPU friendly format. This means when you go to load that in at runtime, your game just reads in the bytes and hands it to the GPU. It's more work at build time in order to reduce load times.
You can choose to ignore all of the content pipeline if you really want, even on Xbox 360. It's 100% optional. However there are no canned methods like Texture2D.FromFile on Xbox 360 so you'd have to write your own code for reading those files in at runtime. I know someone did that for JPEG files at one point. There are some things you can't do this for (namely audio), but for all graphical assets (models, textures, and such) you could write your own code to load from whatever file formats you wanted at runtime.
It seems weird when you start, but once you think about it it starts to make sense. Since you can't really change the content at runtime, why do you need to deploy PNG or whatever? Why not have the content pipeline do some of the work at build time to optimize your game's load times? On PC there's more argument if you plan to support modding or just want to let people poke around, but on Xbox 360, there's not really any reason not to use the content pipeline to optimize your game's content and loading.