XNA Creators Club Online
Page 1 of 1 (6 items)
Sort Posts: Previous Next

Loading Content without XNB Serialization?

Last post 10/5/2009 12:08 PM by Anti. 5 replies.
  • 10/4/2009 12:43 PM

    Loading Content without XNB Serialization?

    Is it possible to load content without using XNB serialization?

    For example:

    A. Save File using IntermediateSerializer
    B. Load File IntermediateSerializer using Content Importer within the Content Pipeline
    C. --XNB Serialization is skipped somehow---
    D. Original file is loaded!

    I'm guessing this would work. I wouldn't understand why is XNB serialization anyhow other than to mask the easily read and edited XML files?
  • 10/4/2009 12:50 PM In reply to

    Re: Loading Content without XNB Serialization?

    If you want to use the Content Pipeline you have to use it the way it's supposed to be used. You don't have to use the Content Pipeline of course.
    Jim Perry - Microsoft XNA MVP
    If people spent a minute searching the forums and reading the FAQs before posting I'd be out of a job.
      Got some XNA Game Studio/XNA Framework development info to share with the community? Put it on the XNA Wiki.
        Please mark posts as Answers or Good Feedback when appropriate.
  • 10/4/2009 12:56 PM In reply to

    Re: Loading Content without XNB Serialization?

    For save games you can't use the content pipeline because the pipeline can only be used at build time. So if you want to load a saved game - so the player can continue from where they saved, don't use the content pipeline or xnb format, just use IntermediateSerializer directly with plain xml. I don't know how easy it would be for players to load the saved game onto their pc to tweak it though..


    Game hobbyist hell-bent on coding a diabolical Matrix
  • 10/5/2009 12:31 AM In reply to

    Re: Loading Content without XNB Serialization?

    Hmm that poses an interesting problem. Doesn't the IntermediateSerializer only work with the Content Pipeline when developing for Xbox? If that's the case I guess you would need it to be serialized in to XNB, which means my answer is a no, I guess...

    So saved games aren't in XNB format, haven't looked that far but interesting to know!
  • 10/5/2009 1:34 AM In reply to

    Re: Loading Content without XNB Serialization?

    Answer
    Reply Quote
    You can add any kind of file to your COntent project. Set its Build action to None, and turn on Copy To Output If Newer. Now, you can open that file using FileStream or whatever I/O mechanism you want, and read it just like you would a regular file. If you want to create textures, call new Texture2D() and call SetData<>() on them. If you want to create vertex buffers, call new VertexBuffer(), etc.

    Jon Watte, Direct3D MVP
    Tweets, occasionally
    kW X-port 3ds Max .X exporter
    kW Animation source code
  • 10/5/2009 12:08 PM In reply to

    Re: Loading Content without XNB Serialization?

    I believe that's the answer I was looking for!
    Thanks!
Page 1 of 1 (6 items) Previous Next