Search Unity

Save/load game state

Discussion in 'Scripting' started by Kethis, Jun 24, 2010.

  1. Kethis

    Kethis

    Joined:
    Sep 10, 2009
    Posts:
    28
    Hello, I have a need to save/load the state of the entire Scene. (well, excluding one or two Game Objects)

    I found tangentially related information on AngryAnt's posts about "Logging an entire GameObject" and "CopyInspector" scripts, but not what I needed.

    I *think* CopyInspector could be adapted, but I am not comfortable enough with C#.

    My Unity Answers post has no useful responses. Can anyone here help me out?
     
  2. jin76

    jin76

    Joined:
    Mar 4, 2010
    Posts:
    364
    +1 this question
     
  3. defjr

    defjr

    Joined:
    Apr 27, 2009
    Posts:
    436
  4. BlackMantis

    BlackMantis

    Joined:
    Feb 7, 2010
    Posts:
    1,475
    You do know about the PlayerPref class right? Thats the way to go. :D
     
  5. Kethis

    Kethis

    Joined:
    Sep 10, 2009
    Posts:
    28
    Correct me if I'm wrong, but the PlayerPref class is used for storing variables. Not whole Game Objects.

    EZ Game Saver looks similar to what I need, however it saves the game state to the hard drive. I need to be able to hold a copy of the game state in RAM for short periods of time, and rapidly roll back to it during this period.

    This is because I am using a Monte Carlo approach to my game's AI. Speed of implementation is a necessity.

    Apologies for being initially ambiguous. My other threads contained technical details about my implementation, but received no response. Therefor, this thread merely asked a simple question.