Search Unity

What data Runtime Persistence saves?

Discussion in 'Game Foundation' started by luisch125, Nov 28, 2019.

  1. luisch125

    luisch125

    Joined:
    Jul 10, 2015
    Posts:
    35
    Hi, is this a quick way to save a scene at its current state?, or just saves stats, inventory and other core systems?

    I'd like to keep my project with the minimum packages/assets installed and maybe this package is a nice addition to achieve this.

    Thanks!
     
  2. michaelsci

    michaelsci

    Joined:
    Aug 6, 2018
    Posts:
    1
    Hey!

    Game Foundation's data persistence will only save data relevant to our systems such as inventory and stat data. Other scene data such as a game object's position will be up to you to save right now.

    Hope this helps,
    Mike
     
    mingz-unity likes this.
  3. luisch125

    luisch125

    Joined:
    Jul 10, 2015
    Posts:
    35
    Thanks for the reply. I'm building a save/load system for a project I'm working on, and I thought this could save me time. Are you planning on including more data to the system?
     
  4. mingz-unity

    mingz-unity

    Unity Technologies

    Joined:
    Oct 12, 2017
    Posts:
    63
    @luisch125 yes we're looking into providing a more general-purpose data persistence layer that can be leveraged by custom gameplay besides the built-in systems we provide.

    Stay tuned for the latest update. In the meanwhile, feel free to let us know what you'd like to see in such a system (details like your project needs, developer workflow, etc. are all helpful).
     
    kvfreedom and erika_d like this.
  5. luisch125

    luisch125

    Joined:
    Jul 10, 2015
    Posts:
    35
    Right now I'm saving variables like mission time, currency, xp, health and such. Of course I'm saving player position and rotation and enemies and other objects (pickups, destructables) position and rotation, health and if they are destroyed/picked up or still in the game at the moment of saving.

    I have already created the list of saved games containing this info, and even the code to overwrite/delete saved games, but the game is on early development stage and the system will need to save a lot of things that are still not implemented. One of the work in progress things I need to save is the "fog of war" status.

    Of course, the ideal solution would be to save a "screenshot" of everything at the time of saving, but it could be a list of save slots containing each one a set of configurable lists of variables, gameobjects position and rotation and status (enabled/disabled/destroyed and/or other options).

    Thanks!
     
    mingz-unity likes this.
  6. mingz-unity

    mingz-unity

    Unity Technologies

    Joined:
    Oct 12, 2017
    Posts:
    63
    Thanks for providing more details @luisch125. Some of these may already be possible with Game Foundation. Here're some ideas you can experiment with:

    • For currency: we have a currency system out of box. You can refer to this doc.
    • For stats such as xp, health: we have a Stats system that you can define any arbitrary stats that can also be persisted automatically. Here's a link to the doc.
    For storing position, rotation, etc., how frequently do you want to update these information in your game? And do you only save / load it to local storage or you need a backend to do cloud sync as well? Depending on the frequency of update and backend needs, we can see if there's an upcoming solution that can address you need soon.

    Thanks!
     
  7. luisch125

    luisch125

    Joined:
    Jul 10, 2015
    Posts:
    35
    We have planned to save on demand (via hotkey and via pause menu, save option) and just on certain mission checkpoints (typical autosave file that will always overwrite itself). The saves are local, it's a single player strategy game.

    I updated the Game Foundation package and I've seen there are a few samples included, but I haven't had time to check them for now. In fact, I installed the package but I still have to even look at what's included. I don't know if it includes some kind of saved files management/display. I hope to give it a try over the incoming weeks.
     
    erika_d likes this.