UniSave v2.0 - Save System [Editor Extension]

Hi everyone! It’s been quite some time since I’ve posted on the forums. I’ve been away due to personal issues, but I’m back now and have just released something I’ve been working on. To those I promised this update months ago, I apologize for the long wait.

With version 2.x, I want to reintroduce UniSave. The system has been overhauled, new features have been added, and everything has been rewritten from scratch. I wanted it to be easier to use, without you having to write extra code just to save a custom component. The system now handles everything internally, making it very easy to save your game objects.

Current Version: 2.1.1

Release Notes | Roadmap | FAQ | Manual

UniSave is a powerful and easy to use save system for Unity. It let’s you save your game’s levels, creates save files, and has extra features that can be used with a simple API.

Plug & Play
To setup your game for saving, no extra coding is required. UniSave comes with a special component called SaveableObject which you add to the game object that you want to save. It will display a list of all the components on your game object. You just select what you want to save from the list, write one line of code to call UniSave, and your save file is created!

MultiScene Persistency
UniSave’s most powerful feature allows you to travel between scenes while they keep their saved states. If your level or world consists of multiple scenes where the player can go back and forth, the transition will feel persistent, because the system remembers the changes in your scenes. MultiScene Persistency works even without saving to a file.

Scene Transitions
With support for loading screens you can use a customized loading screen whenever you’re loading a save file or a scene, or use the built-in fade effect.

Save Files
Unlike Unity’s built-in PlayerPrefs, UniSave let’s you save your data to save files, and has no limitation on size. Save Files are encrypted and non-readable, so they can’t be tampered with. They are also forwards compatible with newer versions of your game.

For more information, please check out the links above!

The UniSave package contains the C# source code, an example project, and an offline version of the manual.

You can purchase UniSave in either the Unity Asset Store or on the UniSave homepage. If you already own UniSave, you can download the update for free.

If you have any feedback, questions, suggestions, etc., then please post them in this topic. I look forward to hearing from you! :slight_smile:

Thank you for making this! Being able to save multiple scenes is just what I needed.

1 Like

Does UniSave 2.0 support Windows Phone 8 / Windows Store?

Thanks!

I haven’t explicitly tested UniSave on those platforms, but I see absolutely no reason why it shouldn’t work. Blackberry is another platform I haven’t tested, but it should work fine on that as well. As a matter of fact, it should currently work on any platform that allows you to save data locally. If someone would somehow encounter an error on these platforms, I’ll be sure to fix that immediately. :slight_smile:

I want to point out you can currently get UniSave at a discounted price of $14 on my website. I’ve updated the first post.

Purchased. Thanks

Hi. Just purchased this, but I have one question.

Is it possible to have multiple sub folders inside Saves folder?

My game requires to have each scene to have its own save data so there would be many of them and I want to organize them into folders so the save games don’t get mixed up or over written by other save games.

I have tried to enter folder name along with the file name when I save scene, but it doesn’t seem to work.
Is there anyway to set the folder name of the save game under Saves?

Also, it would be super useful, if I can save just a selected gameobject and it’s child gameobjects into a save file. (instead of whole scene)

I want to have multiple game objects in the scene at roots and be able to save a gameobject and its childs as one save file and then other one as another one.

I know you have plan to work on saving non gameobject like config and stuff, but if what I mentioned is possible, I can create a gameobject . say config and then save its data as my config file and etc…

Example

configGameObject = (GameObject) GameObject.Find(“ConfigGameObject”);
SaveManager.Save(“Config”, configGameObject);

and Load

SaveManager.Save(“Config”, configGameObject);

What do you think?

And for setting Folder

SaveGameManager.SetPath(“SaveGame01”);

This would save to Application.persistentDataPath + “/Saves/SaveGame01/” + SaveGameName

??

And yet another possible improvement…

Maybe it would be cool to have a small icon next to the game object that has savable Object script attached to it, so we can identify it easily in the hierarchy. This is pretty common actually.

I have bought this asset, but now, found myself a bit staggered by not being able to save it into my own sub folder and not being able to save selective trees of objects only into save file. :frowning:

Hi, castor76. You’re right, it’s currently not possible to create a subfolder within the save folder. I have to admit, it’s something I just didn’t think of. That’s why it’s a good thing these feedback topics exist.

The saving of individual game objects as config data, as you described, is exactly what I had in mind for the config feature. But your addition of a separate folder sounds good, so I will add that as well.

I appreciate your suggestions. :slight_smile: I will incorporate them into UniSave.

Yeap, nothing like working together!

I have another question about some usage case of UniSave.

say… I have a gameobject that already exist in the scene. And then during game play, that objects gets destroyed. The player then saves game.

When player comes back to play the game again , the game loads the scene (which ofcourse has the destroyed gameobject because it is there by default) will, loading the game save will also destroy that gameobject upon load?

If so, how does it know? Does SaveManager keeps list of saveableGameObject and then knows what is destroyed or not?

And…

It makes sense to have gameobjects that gets instantiated during runtime in the Resources folder. But what about subfolders inside Resources folder? For example :

Resources/Weapon/Knife
Resources/Weapon/Pistol
Resources/Item/Bread

It is very rare to keep every assets that is under Resources folder into just under Resources root. Normally we have to organize in a way it is easy to keep it track and sorted. How do you support this? Do you go through all subfolders inside Resources folder and then find the right gameobject to instance upon save game load?

Yes, one of the nice features of UniSave is that it remembers if a game object was destroyed, and will then destroy it in the scene when loading your save file.

I’ll explain in technical detail how this works. You might find it interesting.

When a game object is already in the scene and has a SaveableObject component attached to it, it gets added to a list on a hidden game object in the scene. This hidden game object gets automatically created in the editor and has a script on it (SaveableObjectManager) and keeps a list of these game objects. Whenever one of these game objects is destroyed at runtime, its unique ID (which is assigned to it by UniSave when adding the SaveableObject component) stays in the list. When saving the scene, it simply checks the list to see if it contains items with null game objects (which means it’s destroyed), and then saves the unique ID of these game objects as a reference for destroying them when loading the save file.

Now you know about some of the magic that happens behind the scenes. :stuck_out_tongue:

About the Resources folder…

UniSave saves the name of the asset, and then Resources.Load() does the job of going through all the subfolders automatically. There’s only one limitation to this, and that’s having multiple assets with the same name. For example:

Resources/MyObject.prefab
Resources/SubFolder/MyObject.prefab

In this situation it will load the first one, because it’s the first asset with that name that Resources.Load() finds. If the asset in the root folder wouldn’t exist, it would load the one in the subfolder just fine. Having assets with duplicate names is currently a problem. The reason why this problem exists is because it’s not possible to get the file path to an asset at runtime. So as long as multiple assets don’t have the same name, you can use subfolders.

Thanks, it’s all nice to know.

Forcing to have unique name is something that I can work with. It’s good practice to have the assets to have different names anyway.

Just curious… the SaveableObjectManager … what happens to it during the scene load? When does it created? Who create it? I am asking this… because this is how I am intend to use it.

I have a main scene with my game settings and all other gameobjects that function as my managers to handle game play and they can have saveableObjects with them.

Now I have many other level scenes which I do async load it. These scenes ofcourse contains the saveableObjects.

The manager game objects from the first scene is not going to be destroyed because I tagged them to DoNotDestroyOnLoad.

So the question is does SaveableObjectManager gets created on all the scenes? If so do you take care of multiple instances of SaveableObjectManagers? (do you prevent them from having more than one at anytime ?)

If SaveableObjectManager don’t get destroyed during scene load, does it also handle the saveableObjects from other loaded scene? (or are they have to be handled by the different SaveableObjectManager?

I am sorry if you got confused with my question as it can be a bit difficult to explain.

:smile:

That’s a really good question, and I understand it perfectly. :slight_smile:

Every scene has its own SaveableObjectManager that belongs to it. It gets created automatically as soon you add a SaveableObject component to a game object in your scene in the editor. When you load another scene, the SaveableObjectManager of the current scene gets destroyed, so there is always one per scene.

Also, I want to point out that I’m currently using your game scenario for testing purposes with the new update to make sure it will work for you when it’s released. :slight_smile:

I see… so the new SaveableObjectManager that is loaded from the other (level) scene is also going to take care of the saveableObjects from the main scene ( managers ) ?

I … assume that new SaveableObjectManager will … scan the scene and refresh list and add the new ones ( well from the main scene that used to load the current level scene) along what it had with in its own scene?

Any update?

If you have any feedback, questions, suggestions, etc., then please post them in this topic. I look forward to hearing from you! :)[/QUOTE]

hello;

i want a “save and load game” asset so i can save and load my games.

i used unities free JASON asset for a wile but wanted to experiment with a more expensive asset.

i purchased Easy Save and they did not even have a save load game example; i have written them twice waiting for a reply.

if i pay $35.00 dollars for Uni Save will i be able to use it to save and load my games, or will it not work at all like easy save?

does it come with a save load game example scene?

thanks,

Aaronhm77

I’ve been away for a few days, so sorry for my late reply.

A SaveableObjectManager only takes care of game objects (that were created in the editor) in the scene that it belongs to. SaveableObjectManagers don’t persist between scenes.

Yes! I’m going to upload v2.1 tomorrow. I just have to make some small changes and fix a couple of bugs, and also update the manual, and then it’s ready to go. I do want to point out that it takes some time for Unity to approve submissions, so in case you purchased UniSave in the Asset Store and don’t feel like waiting, I could PM you a temporary download link for the new version when it’s up.

Hi, Aaronhm77. Yes, UniSave comes with an example project that you can check out. There’s also a manual (both offline and online) that’s easy to follow, and tells you how features work.

1 Like

Hi Majin.

I am currently doing the test , but I have grave concern about the size of saves.

Currently, it gives about 17kb default size even if my save doesn’t have much at all. Which I am ok with it.

But…

When I try to save a gameobject which has list of a simple int count (about 18 of them) I have increase of about 4kb.
Now… you may think this is nothing. But think about it… if I want to save a level with decent number of crates , boxes with items in there, I would want to have some properties like below :

public int count;
public float value;
public float general;
public bool isEquiped;
public bool isLocked;
public string additionalName;
public string assetPath;

this will make save game size HUGE.

In my experiement and comparision with Unity Serializer plugin , my game stat save file size has increased from 17kb to 500+kb !!!

And that was with even less data than before by using [UniSaveIgnoreDataMember] optimization.

I know that Unity Serializer plugin has some sort of compression tech built in to reduce the size of the save game. But even taking that as a consideration, the size of the game save is just … too big.

I don’t mind “some” increase, but this is just way too much.

I don’t know how UniSave works internally to be able to say for sure, but without making the save considerbly smaller, it can’t be used for project with decent scale. Maybe it will work for a simplle mobile game… Or something must be wrong with it because even without compression maths doesn’t add up… Not sure how much overhead UniSave adds , but can’t have 18 ints to have 4kb increase in size… (not that exactly cause there would be other stuff like saving list state etc… but still…)

Any ideas? ( I am using the new SaveObject stuff)

So… what must I do in this case?

I have scene with managers that contain player info, stats ,config, etc… which I want to save using SaveObject function into separate save file.

During game play, I load a level scene which contains containers that contains items for level. I want to save level’s data into level01.sav etc… and my other stats as other files.

Now, if SaveableObjectManager is not persistent , then the SaveableObjectManager which was responsible for the stats, config is now “lost” ? and if new SaveableObjectManager doesn’t take care of the stats, config how do I save them?

You can’t seriously expect to have every game object needed in the scene and game play to “exist” already in the scene created in the editor only. It is very common to use “don’t destroy in load” funtion in Unity to keep the stuff that you always need and just load the other scenes in and out either normally or additively.