Xbox LIVE Indie Games
Sort Discussions: Previous Discussion Next Discussion
Page 1 of 1 (3 posts)

Save/Load tutorials

Last post 6/6/2009 9:07 AM by Owen Barker. 2 replies.
  • 3/22/2009 4:59 AM

    Save/Load tutorials

    Hi folks,

    I'm looking for a tutorial on saving and loading on the 360 (I'm using XNA 2.0).  I noticed a few different tutorials available that include this functionality, but I was wondering which was the best to look into just for save and load functionality.

    In my game, I'm simply looking for a load function that will load saved game data file upon player request at a start of a game, and a save function for saving game data upon player request at any point in the game.
  • 3/22/2009 8:29 AM In reply to

    Re: Save/Load tutorials

    I would start with the Game Studio documentation and example code on the topic. There are several pages in particular that I highly recommend to get you started. In order, I'd suggest:

    1) Storage Overview

    2) How To: Serializa Data (including serializing data with XML)

    3) download and examine the StorageDemo sample

    All of these you can find in the Storage section in your XNA Game Studio Documentation, or online on MSDN:

    for XNA GS 2.0: http://msdn.microsoft.com/en-us/library/bb199073(XNAGameStudio.20).aspx

    for XNA GS 3.0: http://msdn.microsoft.com/en-us/library/bb199073.aspx
  • 6/6/2009 9:07 AM In reply to

    Re: Save/Load tutorials

    WillHayw:
    I would start with the Game Studio documentation and example code on the topic. There are several pages in particular that I highly recommend to get you started. In order, I'd suggest:

    1) Storage Overview

    2) How To: Serializa Data (including serializing data with XML)

    3) download and examine the StorageDemo sample

    All of these you can find in the Storage section in your XNA Game Studio Documentation, or online on MSDN:

    for XNA GS 2.0: http://msdn.microsoft.com/en-us/library/bb199073(XNAGameStudio.20).aspx

    for XNA GS 3.0: http://msdn.microsoft.com/en-us/library/bb199073.aspx



    they do not work,sorry. The demo they gave is a pore excuse of an sample. On the windows version they use gamepad not keyboard even if its a windows version of the sample.

    The person that coded that sample did an horrbile approach.


    Ive used their sample to load/save on the xbox and it doesnt work. they need to fix how saving and loading works on the xbox because its a joke. All i get is access errors from their samples. When  i tried to use their sample, i got field erriors because their code isnt organized. i exept more from microsoft developers than the save/load documentation sample. I wasted 4 hours trying to figure out the load/save from the microsoft xna 3.0 document sample and got no where from it.

    Ill show you what i mean.

    This like: (This might look very simple but when ur trying to do this in ur own project, it gives head-aches)

    this.device = null

    this is how its placed (they call "device" to null but device is way below the call)
                        // Reset the device 
                        this.device = null;                    
                        stateobj = (Object)"GetDevice for Player One"
                        Guide.BeginShowStorageDeviceSelector( 
                                        PlayerIndex.One, this.GetDevice, stateobj); 
                    } 
                } 
                // If a save is pending, save as soon as the 
                // storage device is chosen 
                if ((GameSaveRequested) && (result.IsCompleted)) 
                { 
                    device = Guide.EndShowStorageDeviceSelector(result); 
                    if (device.IsConnected) 
                    { 
                        DoSaveGame(device); 
                        DoLoadGame(device); 
                        DoCreate(device); 
                        DoOpen(device); 
                        DoCopy(device); 
                        DoEnumerate(device); 
                        DoRename(device); 
                        DoDelete(device); 
                        DoOpenFile(); 
                    } 
                    // Reset the request flag 
                    GameSaveRequested = false
                } 
                base.Update(gameTime); 
            } 
     
            StorageDevice device; 
            void GetDevice(IAsyncResult result) 
            { 
                device = Guide.EndShowStorageDeviceSelector(result); 
                if (device.IsConnected) 
                { 
                    DoSaveGame(device); 
                    DoLoadGame(device); 
                    DoCreate(device); 
                    DoOpen(device); 
                    DoCopy(device); 
                    DoEnumerate(device); 
                    DoRename(device); 
                    DoDelete(device); 
                    DoOpenFile(); 
                } 
            } 

    2. They dont use "StorageContainer.TitleLocation" but in the help documentation they say to use "StorageContainer.TitleLocation". In this sample they use "cabinate.path"











Page 1 of 1 (3 posts) Previous Discussion Next Discussion