Kea

I haven't got into using XNA as of yet, however I very much like the idea to play my games on the Xbox360 (blah blah blah). I see that the XNA team has put large amounts of effort into some asset management in XNA, that includes the XACT audio cues for like "make it possible to change the sound triggered by some event without doing it in the programming". I'm fairly deep into the process of making my customized packaging format with the goal to essentially archive anything (textures, sounds etc) into a single or more packages. There are several reasons, one of them because I started before the XNA project was convened, and to ease distributions on levels and mods by packing several files, textures, sounds, scripts in a single package file.
Downright the question is whether the XNA system will allow me to use my own asset packaging system when running on the Xbox360 Or is the use of the System.IO file ops restricted

Edit: Maybe it would be possible to nest my package stream into an XNA package file, then extract it


Re: XNA Game Studio Express Packaging assets

ProfEclipse

You will need to write custom processors/importers to use them on the Xbox. Xbox only allows asset loading through the ContentManager. However, you may have issues if whatever assemblies you use to do your custom processing aren't available on/compatible with the Xbox platform.





Re: XNA Game Studio Express Packaging assets

Stephen Styrchak - MSFT

The short answer is yes, you will be able to use your own packaging system. The long answer is that it will take a bit of work and knowledge of MSBuild.

To answer your other question, the Storage API is restricted on Xbox 360, but not in a way that will affect what you want to do. Basically, the restriction is that you are prevented from being able to see files that aren't part of your game (so you can't go off and modify your Gears of War data files, for example). You can, however, see all the files that are deployed as part of your title.

The tricky part will be building your project for the 360. The Content Pipeline build task defaults to putting its output in the project output directory, and everything in the output directory is considered "part of the game" and will be deployed to the Xbox 360 before you debug/play it. You don't want all these files AND the package file to be deployed, so you'll have to do some work in the build system to avoid duplication.

If you want to use the Content Pipeline, it's going to build your content and generate a bunch of files from them. Those are the files you want in your package, so you'll probably want to create another MSBuild task that takes that output and builds your package. To do that, change the output directory for the Content Pipeline task so that it goes into a new intermediate location (by editing either the project file directly). Then have your new task use that directory as input, and generate the package into the project's final output. The project will then automatically deploy your package file along with your game when you connect to your Xbox 360.

In your code, you'll need to write a class that opens your package file and reads the contents into Stream objects. The content manager has an overload to load assets from streams, which is what you'll have to use instead of the overload that takes a file path. That way, you can load directly from your package.

I hope this points you in the right direction. Unfortunately, explaining all of it would take more time than I have right now.

--Stephen





Re: XNA Game Studio Express Packaging assets

Shawn Hargreaves - MSFT

You actually can load assets directly if you want: you can use System.IO and BinaryReader, or the XML classes, to load whatever data you like. The only requirement is that the data has to be saved into your project output directory at some point during the build process, so that it will be picked up for deployment onto the Xbox.

That said, on Xbox you don't have any of the nice higher level load methods that are available on Windows. No Texture.FromFile, and no effect compiler, so if you don't use the ContentManager, you just get raw bits and have to handle all the parsing and endian flipping and reconstructing into classes yourself.





Re: XNA Game Studio Express Packaging assets

Michael Hansen

here is a link to a packer,

http://www.gotdotnet.com/Community/UserSamples/Details.aspx SampleGuid=c8bc181b-5ddf-4969-aeca-a508374f1282

it can run on xbox360 it is in pure c# and use system.io

modifery to use storege device

and it wil work

game dev tips

 "" i use it it is good for xml files and textfiles ""

my terrain is about 95 mb true xml serialsion  and when i compress it is about  15mb

 






Re: XNA Game Studio Express Packaging assets

Kea

Who took the freedom of choosing the answer post on my thread Fortunately, whomever, Styrchak's reply is answer enough.
Stands quite to reason. I had imagined using my own editor to produce levels and packages for the/any game. I'd completely delocalize the content creation process from the programming and engine core. If any client code subclassing from the engine would require any data, it would refer to a prebuilt package. Hence for the X360 ports I'd only include the ready packages into a VC#2k5EE project together with the code, compile and deploy.
So far the packaging system is quite meant to just handle ordinary streams and extract headers and export tables and nested serialized object streams from these.
The question that remains is whether I can "just load and play any sound" I want. I mean to extract wave data from a stream into a buffer and let it play, but will XNA enforce me to make cue files in XACT first Essentially, must all data meant to be played back as sound have to be XACT audio cues Gees, that'd make the level design process just horrible.
Again, Unreal engine is my favorite example.




Re: XNA Game Studio Express Packaging assets

EWSommer

The question that remains is whether I can "just load and play any sound" I want. I mean to extract wave data from a stream into a buffer and let it play, but will XNA enforce me to make cue files in XACT first Essentially, must all data meant to be played back as sound have to be XACT audio cues Gees, that'd make the level design process just horrible.


This is an issue with XNA apparently a lot of people have. You have to use XACT. :( I'd prefer the option to create wave and sound banks at runtime too. Ok, so it might not run on the Xbox 360, but I don't have one, so I don't care...




Re: XNA Game Studio Express Packaging assets

MarijnStevens

Perhaps I talk about nonesence, but I don't talk about complexity ( like I am the person able to do it ),

But in theory, I can develop an mp3 ContentManager, and use that in my game. ( and for the people already want to reply: xbox360 of course. )

Perhaps another stupid qeustion, can I use LAME.dll

Is it like you don't have direct control to the output




Re: XNA Game Studio Express Packaging assets

Jim Perry

MarijnStevens wrote:
Perhaps another stupid qeustion, can I use LAME.dll

If the DLL is a .NET assembly and uses only the namespaces supported under the 360's implementation of the Compact Framework, sure you can use it. My guess is that this isn't the case though.






Re: XNA Game Studio Express Packaging assets

Kea

Your guess is right. Currently you must have all the source code for the project/solution loaded into XGSE when deploying. Hence you can't rely on ANY other assemblies than those of the .NET CF and XNA. All source must be included. This might change in a future version, until then some of us are quite a bit handicapped. I dunno exactly why, but I guess it's a security risk currently not solved, while I though code verifiability happened on CIL on run-time anyway...




Re: XNA Game Studio Express Packaging assets

Leaf.

Are you sure about that From what's been previously said any assembly that your project references and is in the output folder will be deployed (perhaps even if its not referenced). I can't try it right now but I dont see how this F# on Xbox360 post would work if it wasn't possible to deploy assemblies. Obviously the assembly has to be compatible with the Xbox360 framework/runtime.

Cheers,
Leaf.






Re: XNA Game Studio Express Packaging assets

Jim Perry

Leaf. wrote:
Are you sure about that

Seconded. I haven't had a chance to try, but I'm sure if I built a .NET DLL that used what's available in the 360 version of the Compact Framework, referenced it in a 360 game project, it would work on my 360. If not, something is wrong.






Re: XNA Game Studio Express Packaging assets

Kea

Yo back. Thanks for the info, didn't know that. Then apparently it's cut down to that everything you wish to deploy must be in your project/solution. Couldn't find the video on Channel 9 now, but they did have a video on XNA on Xbox 360, pretty cool.
I must have thought about that you cannot use interop. Or has even that changed




Re: XNA Game Studio Express Packaging assets

Shawn Hargreaves - MSFT

You can't use any interop to native code on Xbox, only the API's provided by XNA.

You can deploy any files you like, though: the only restriction is they have to be in your project output directory.