Search Unity

Save Game Pro - Gold Update

Discussion in 'Assets and Asset Store' started by hasanbayat, Nov 3, 2017.

  1. hasanbayat

    hasanbayat

    Joined:
    Oct 18, 2016
    Posts:
    630
    New Version Submitted for Review, 2.5.1:
    • Introducing Xbox One Cloud Integration using Connected Storage
    • Fixed a bug when you are trying to save multiple components on same GameObject and it saves only one of them
    • Added a new API method "GetAbsolutePath" that retrieves the absolute path to the identifier
    • Introducing new Integration System and Management
    • Introducing new Redesigned Settings window
    • Added new Memory Storage type
    • Added new Example for Xbox One Cloud Integration
    Thanks.
     
  2. danielesuppo

    danielesuppo

    Joined:
    Oct 20, 2015
    Posts:
    331
    Hasanbayat, how can I get the data after that I save them into memory?

    I'm triying in this way
    Code (CSharp):
    1. void Start()
    2.         {
    3.             SaveGameSettings settings = new SaveGameSettings();
    4.             settings.Storage = new BayatGames.SaveGamePro.IO.SaveGameMemoryStorage();
    5.             SaveGame.DefaultSettings = settings;
    6.         }
    7.  
    8.  
    9. public void Save ()
    10.         {
    11.             SaveGame.Save ( "myGameObject", target );
    12.         }
    13.  
    14. public void Load ()
    15.         {
    16.             object myString = new object();
    17.             SaveGame.LoadInto("myGameObject", myString);
    18.         }
    19.  
    but I get an error when I load:
    "InvalidOperationException: Save Game Memory Storage does not support Exists operation"
     
  3. hasanbayat

    hasanbayat

    Joined:
    Oct 18, 2016
    Posts:
    630
    It is MemoryStream, so simply call GetReadStream then cast the Stream to the MemoryStream then call ToArray method to access the data, here is the usage example:
    Code (CSharp):
    1. var stream = settings.Storage.GetReadStream() as System.IO.MemoryStream;
    2. byte[] data = stream.ToArray();
    Thanks.
     
  4. danielesuppo

    danielesuppo

    Joined:
    Oct 20, 2015
    Posts:
    331
  5. danielesuppo

    danielesuppo

    Joined:
    Oct 20, 2015
    Posts:
    331
    Excuse me Hasanbayat,
    I can successfully upload from memory the serialized GameObject to the server, but when I download it how can I convert it back to a GameObject?
    I download it in this way

    public IEnumerator DownloadGameobject(string downloadUrl)
    {
    var www = new WWW(downloadUrl);
    yield return www;

    //From here I don't know what to do with this www
    //target = SaveGame.Load<GameObject>(www); ????
    //Obviuosly does not work...
    }
     
  6. hasanbayat

    hasanbayat

    Joined:
    Oct 18, 2016
    Posts:
    630
    You just need to go the reverse and do the things in reversal order, first create the MemoryStream by bytes then deserialize the data with the Save Game Pro internal BinaryFormatter and you will have your GameObject, something like this:
    Code (CSharp):
    1. var formatter = new BayatGames.SaveGamePro.Serialization.Formatters.Binary.BinaryFormatter();
    2. GameObject myObject = formatter.Deserialize<GameObject>(www.bytes);
    Thanks.
     
  7. danielesuppo

    danielesuppo

    Joined:
    Oct 20, 2015
    Posts:
    331
    It work perfectly!
    Many thanks!
     
  8. hasanbayat

    hasanbayat

    Joined:
    Oct 18, 2016
    Posts:
    630
    New Version Submitted for Review, 2.5.3:
    • Fixed Various Bugs around Saving and Loading Components and Duplicates
    • Remove Saving and Loading of Font material property to prevent it from throwing exceptions
    Thanks.
     
  9. MostHated

    MostHated

    Joined:
    Nov 29, 2015
    Posts:
    1,235
    Hey there @hasanbayat , I have had this a while but have not made much use of it yet, but thought of something I might want to do with it and I was wondering if you could let me know if this sounds doable.

    An asset I use for my game uses scriptable objects to store data for items, abilities, etc. It has the option to use mysql for account / character data such as stats, inventory, etc, or it can save directly to a local sqlite db isntead. All of that is already setup and is fine, I am not looking to change that as its receiving updates from the developer and all that. Because of that though, the plan is that the item data / database, npc database of each npc, etc will just stay as scriptable objects so that people who want to use sqlite can, and those who want to use mysql also can, so all of those scriptable objects and their data are not saved in the mysql database or anything unfortunately.

    What I am wondering is, would it be possible for me to create some tables for each of these main categories that correspond with each of the scriptable object types, such as an Item table, npc table, etc and build myself a front end to input the items, npc's, their data, and all that and then use SGP to read the data from my DB and then use that data to possibly create the scriptable objects that the game needs and populate their data so that I can manage everything from the page instead of having to deal with the scriptable objects?
     
    Last edited: Jul 19, 2018
  10. hasanbayat

    hasanbayat

    Joined:
    Oct 18, 2016
    Posts:
    630
    Hi.
    Yes, of course you can do that, but you need a bit of PHP knowledge plus HTML and CSS for front end, so do you have any knowledge in this subject?
    Also,The Save Game Pro client, sends the data to a PHP file, then you can handle the data the way you want and do anything you want, so it all depends on your implementation using PHP or Node.js.

    Thanks.
     
  11. MostHated

    MostHated

    Joined:
    Nov 29, 2015
    Posts:
    1,235
    Thank you for the reply, I do appreciate it. Yes, I am definitely familiar enough with them to take care of the front end and I should be able to figure out how to get SGP to grab the tables I need. I guess what I am sort of trying to do is the opposite of your typical "save game". Instead of taking data from Unity and saving it to a file or a db, I want to take data from outside Unity and save it within Unity.

    I believe if an item in my game already exists in a scriptable object and I adjust its values in the database and then have SGP grab the new values, I should be able to then apply those new values to the existing scriptable object/item within the game, but say I wanted to add a new item in the MySQL database which does not currently have a corresponding scriptable object created within the server / unity build. I then want SGP to grab that item and its data, bring it into Unity and save it as a new item for the game as a scriptable object, as the asset I use loads the scriptable objects when the server starts. Do you have any idea how I can get SGP to save that new item data permanently for the server to use?
     
  12. hasanbayat

    hasanbayat

    Joined:
    Oct 18, 2016
    Posts:
    630
    You can use normal MySQL interface to save the items in Database, and then make your own client implementation by implementing SaveGameCloud class, and then add your own methods and also you need to make your own server-side implementation instead of using php-savegamepro-mysql implementation, as your use case is different, and then you can use your client-side implementation to download the item, and call SaveGame.Save to save it to local storage.
    Anyways, I didn't fully understand what you are trying to do, let me tell what I understood until now:
    • First, you want to add your items to server database using available ScriptableObjects
    • Then you want to download these items from server database to your running application (whether a phone or a desktop) and save all the items on the user local storage, right?
    Thanks.
     
  13. somosky

    somosky

    Joined:
    Feb 15, 2014
    Posts:
    138
    Hi. I'm looking for something to allow me to save game data to the cloud (I'm thinking Microsoft Azure) and also load from there. It will mostly be inventory data. I've been searching all day on some assistance on how to do this and I've come across your asset . Will your asset allow me to save something like this and if so would you be able to help me out in doing this?
     
  14. hasanbayat

    hasanbayat

    Joined:
    Oct 18, 2016
    Posts:
    630
    Hi.
    Yes, of course I will help you in doing that.
    Also, Save Game Pro supports saving and loading to Web & Cloud using ready to use Client Implementations.
    You can send me an email using your request, and then I will attach Save Game Pro trial version for you to try it, and when you liked it and it helped you, then go further and purchase Save Game Pro.
    Thanks.
     
  15. Krey

    Krey

    Joined:
    Aug 4, 2013
    Posts:
    8
    I keep getting the following error when trying to save literally any asset (using SaveGamePro Gold) that even references an asset that uses TextMesh Pro (2018.2.2f1):

    UnassignedReferenceException: The variable m_baseMaterial of TextMeshProUGUI has not been assigned.
    You probably need to assign the m_baseMaterial variable of the TextMeshProUGUI script in the inspector.

    I tried to make a custom font in case it had to do with the defaults, but that didn't do anything. I don't see any assignable area in the TextMeshProUGUI script when it's attached to a GameObject.

    Does anyone know how to resolve this? Are we limited to not saving any UI text?
     
  16. hasanbayat

    hasanbayat

    Joined:
    Oct 18, 2016
    Posts:
    630
    Hi.
    Sorry, but our bayatgames.com domain is down for maintenance and will be up soon.
    Save Game Pro doesn't provide support for TxetMesh Pro components internally and you need to add support for them using creating custom types., take a look at example custom types at BayatGames\SaveGamePro\Scripts\Serialization\Types folder to learn more about custom types, until we up and run the documentation website.
    Anyways, I wouldn't recommend you to save Unity Objects and References directly, I would recommend you to make a data structure and save it and initialize the Unity object using the saved data structure, in your case you can only save the text of the GUI object and load it back or any other required property, as currently Unity doesn't provide any good pointers on how to deal with references and how to persist them, we can't handle saving and loading Unity objects properly.
    Thanks.
     
  17. Krey

    Krey

    Joined:
    Aug 4, 2013
    Posts:
    8
    This is the approach I took and, while it took a few extra days, it was obviously the better code... BUT! I'm encountering this error when trying to build the actual project:
    Assets/BayatGames/SaveGamePro/Scripts/Serialization/Types/SaveGameType_LightProbeGroup.cs(66,23): error CS0200: Property or indexer `UnityEngine.LightProbeGroup.probePositions' cannot be assigned to (it is read-only)

    This error only shows up when trying to build; everything works just fine when running in Play mode. Any advice?

    Edit: Commenting out that line from the SaveGameType_LightProbeGroup lets me bypass the issue for now.
     
    Last edited: Aug 15, 2018
  18. hasanbayat

    hasanbayat

    Joined:
    Oct 18, 2016
    Posts:
    630
    Hi.
    I think you are building for UWP, right?
    It is a known issue for it, as far as I remember, and I will fix it in the next updates.
    Thanks.
     
  19. knuppel

    knuppel

    Joined:
    Oct 30, 2016
    Posts:
    97
    Cloudsave:
    Why do you encrypt data value in mysql database?
    Why don't you encrypt users password in database? Password is human readable?!
     
  20. hasanbayat

    hasanbayat

    Joined:
    Oct 18, 2016
    Posts:
    630
    Hi.
    Both data and password are human-readable, as we are going to add a new encryption method to the server-side Implementations, as the normal server-side encryption methods can be easily leaked and decrypted.
    Anyways, you can easily make your own server-side implementation, there are no limitations on this.

    Thanks.
     
  21. hasanbayat

    hasanbayat

    Joined:
    Oct 18, 2016
    Posts:
    630
    New version is now available on Unity Asset Store, 2.5.5:
    • Unity 2018.2 Compatibility (Fixed Build Errors and other Compatibility issues)
    Thanks.
     
  22. andoo001

    andoo001

    Joined:
    Jul 19, 2016
    Posts:
    21
    im interested in buying this asset and it says it is compatible with unity 2017.x but i cant purchase without an update to 2018. why is that?
     
  23. hasanbayat

    hasanbayat

    Joined:
    Oct 18, 2016
    Posts:
    630
    Hi.
    The asset is compatible with those Unity versions, but I haven't submitted the package using that Unity package, you just need to install the newest Unity version for just downloading it.
    Or, you can purchase it via the Web interface and then download and import from Unity.
    Hope this helps.
    Thanks.
     
    andoo001 likes this.
  24. hasanbayat

    hasanbayat

    Joined:
    Oct 18, 2016
    Posts:
    630
    New Save Game Pro version submitted for Review, 2.5.7:
    • Fixed FirebaseAuth issues for Firebase Integration
    • Fixed FirebaseAuth issues for Firebase-Playmaker Integration
    Thanks.
     
  25. hasanbayat

    hasanbayat

    Joined:
    Oct 18, 2016
    Posts:
    630
    New Save Game Pro version submitted for Review, 2.6.7:
    Added 16 new Playmaker Actions:
    • Firebase Set Value String
    • Firebase Set Value Int
    • Firebase Set Value Bool
    • Firebase Set Value Float
    • Firebase Set Value Array String
    • Firebase Set Value Array Int
    • Firebase Set Value Array Bool
    • Firebase Set Value Array Float
    • Firebase Get Value String
    • Firebase Get Value Int
    • Firebase Get Value Bool
    • Firebase Get Value Float
    • Firebase Get Value Array String
    • Firebase Get Value Array Int
    • Firebase Get Value Array Bool
    • Firebase Get Value Array Float
    Thanks.
     
  26. unity_apaladines

    unity_apaladines

    Joined:
    Jul 18, 2018
    Posts:
    2
    Hi, I would like to know if there is an integration with Bolt instead Playmaker? Thanks in advance.
     
  27. hasanbayat

    hasanbayat

    Joined:
    Oct 18, 2016
    Posts:
    630
    Hi.
    Bolt automatically generates Units from the Codebase and there is no need to set up an integration, so you can easily use Save Game Pro with the Bolt easily without any issues.
    Anyway, we are planning to make a integration in away future, but that's not required.
    Hope you get what I mean.
    Thanks.
    Best Regards.
     
  28. hottabych

    hottabych

    Joined:
    Apr 18, 2015
    Posts:
    107
    Hey! I consider buying your asset. Does it contains some kind of viewer for resulting binary file? How can I view its content?
    Also, can it encrypt a file?
     
  29. NightcoreLV

    NightcoreLV

    Joined:
    Feb 26, 2014
    Posts:
    34
    hi
    save array in playmaker action seems broken, please fix it
     
  30. hasanbayat

    hasanbayat

    Joined:
    Oct 18, 2016
    Posts:
    630
    Hi.
    What's the issue? Can you provide more details?
    Thanks.
     
  31. hasanbayat

    hasanbayat

    Joined:
    Oct 18, 2016
    Posts:
    630
    Hi.
    It doesn't provide any kind of viewer to view the content of saved files, but you can use JSON format to easily view the content of files.
    Also, it does Binary format as in, so it can be used for Safe data format. (encryption)
    Thanks.
     
  32. NightcoreLV

    NightcoreLV

    Joined:
    Feb 26, 2014
    Posts:
    34
    got erorr from playmaker then i choice array option

    screenshot:

    1.png

    2.png
     
  33. hasanbayat

    hasanbayat

    Joined:
    Oct 18, 2016
    Posts:
    630
    Hi again.
    Yeah, it was an issue related to using ArrayEditor in Custom PlayMaker Actions, I have now fixed it in the new version, 2.6.9
    It will be available on the asset store soon when it gets approved, or you can give me your email and I directly send you the package without waiting for the asset store approval.
    Thanks for your report, keep it up!
    Good luck.
     
  34. hasanbayat

    hasanbayat

    Joined:
    Oct 18, 2016
    Posts:
    630
    New Version Submitted for Review, 2.6.9
    • Added Changelog Button to Integrations Tab
    • Now the Save Game Save and Save Game Load PlayMaker actions will use String array as default type.
    • Added 36 new PlayMaker Actions for Array Save & Load:
    • Save Game Save Bool Array
    • Save Game Save Color Array
    • Save Game Save Enum Array
    • Save Game Save Float Array
    • Save Game Save Int Array
    • Save Game Save Quaternion Array
    • Save Game Save String Array
    • Save Game Save Vector2 Array
    • Save Game Save Vector3 Array
    • Save Game Load Bool Array
    • Save Game Load Color Array
    • Save Game Load Enum Array
    • Save Game Load Float Array
    • Save Game Load Int Array
    • Save Game Load Quaternion Array
    • Save Game Load String Array
    • Save Game Load Vector2 Array
    • Save Game Load Vector3 Array
    • Save Game Web Save Bool Array
    • Save Game Web Save Color Array
    • Save Game Web Save Enum Array
    • Save Game Web Save Float Array
    • Save Game Web Save Int Array
    • Save Game Web Save Quaternion Array
    • Save Game Web Save String Array
    • Save Game Web Save Vector2 Array
    • Save Game Web Save Vector3 Array
    • Save Game Web Load Bool Array
    • Save Game Web Load Color Array
    • Save Game Web Load Enum Array
    • Save Game Web Load Float Array
    • Save Game Web Load Int Array
    • Save Game Web Load Quaternion Array
    • Save Game Web Load String Array
    • Save Game Web Load Vector2 Array
    • Save Game Web Load Vector3 Array
    Thanks.
     
  35. hasanbayat

    hasanbayat

    Joined:
    Oct 18, 2016
    Posts:
    630
  36. TobyYe

    TobyYe

    Joined:
    May 25, 2013
    Posts:
    24
    Only work on unity2018.2.5 and above? Pls fix it.
     
  37. hasanbayat

    hasanbayat

    Joined:
    Oct 18, 2016
    Posts:
    630
    Hi, It works with older versions, that's just a limitation when you try to download package if you install latest Unity version and download it, then you can import it to your older Unity versions.

    Thanks.
     
  38. hasanbayat

    hasanbayat

    Joined:
    Oct 18, 2016
    Posts:
    630
    Platform Game Assets Ultimate is out now.
    Get it now with 50% off, only for first 100 customers, Hurry up!
    Check it out on Unity Asset Store

    Thanks.
     
  39. hasanbayat

    hasanbayat

    Joined:
    Oct 18, 2016
    Posts:
    630
    New Version is now available, 2.7.1:
    • Save Game Pro is now portable and you can move it to anywhere in your project. Keep in mind, that the BayatGames/SaveGamePro structure shouldn't change, so you can move the BayatGames root folder anywhere you wish, but you can't separate the SaveGamePro folder from BayatGames folder.
    • Introducing Async API built on top of C# Tasks (Multi-threading) (Added a new Documentation article as well: https://bayatgames.com/docs/save-game-pro/tutorials/asynchronous-saving-and-loading)
    • SaveAsync
    • LoadAsync
    • LoadIntoAsync
    • SaveImageAsync
    • LoadImageAsync
    • Added Saving Asynchronous Example (available at BayatGames/SaveGamePro/Examples)
    • Fixed some issues with Multi-threading
    • Included PlayMaker Globals Variable for Cloud Example (Added a new documentation article on how to set it up: https://bayatgames.com/docs/save-ga...ing-playmaker-integration#cloud-example-setup)
    For more information about upcoming features and roadmap, please check out our Trello board.

    Thanks.
     
  40. hasanbayat

    hasanbayat

    Joined:
    Oct 18, 2016
    Posts:
    630
    New Version Submitted for Review, 2.7.2:
    • Added Support for Nullable Types
    • Added new Utility method called GetNullableType to TypeUtils (Mostly for internal use)
    Thanks.
     
  41. hasanbayat

    hasanbayat

    Joined:
    Oct 18, 2016
    Posts:
    630
    New Version Submitted for Review, 2.7.3:
    • Upgrade to Unity 2018.3
    • Upload with multiple Unity versions for most possible compatibility
    Thanks.
     
  42. hasanbayat

    hasanbayat

    Joined:
    Oct 18, 2016
    Posts:
    630
  43. Darkonen

    Darkonen

    Joined:
    Nov 9, 2018
    Posts:
    8
    Good Morning

    I have a problem, when I serialize in Bynary and I save a text string, when I run the game it works perfect, but when I go to the Persisten Data Path path:

    C: / Users / user / AppData / LocalLow / company / Terra of Gods

    I find the text file and I can read it and modify it easily.

    I have tried with this code in the aWake:

    SaveGameSettings settings = SaveGame.DefaultSettings;
    settings.Formatter = new BayatGames.SaveGamePro.Serialization.Formatters.Binary.BinaryFormatter ();
    SaveGame.DefaultSettings = settings;
    SaveGame.Save ("test2", "test2", settings);

    I have tried to compile the game, make a build with the .exe, and also with other tests and the same thing happens to me, which saves the text file in the computer but I can open it and modify it easily.

    I'm wrong about something, I thought if it was saved in binary it could not be read easily?

    I have to do something else, so that serialize in Binary?

    Have a good day
     
  44. hasanbayat

    hasanbayat

    Joined:
    Oct 18, 2016
    Posts:
    630
    Hello.
    I've used Saving Simple Data example and tried to edit the text file using Notepad saving in Application Persistent Data Path, but when I've made the changes and saved it and tried to load it, this error occurs:
    Code (CSharp):
    1. EndOfStreamException: Unable to read beyond the end of the stream.
    As you can see any changes to the save leads to crash in loading as the data have been changed and the binary format is corrupted, so you can easily detect it using try/catch.

    Update: Looks likes it is the Notepad problem, I've tried it using VSCode, and successfully edited data and loaded it., looks we need to apply encryption on it.

    Thanks!
     
    Darkonen likes this.
  45. Darkonen

    Darkonen

    Joined:
    Nov 9, 2018
    Posts:
    8
    Thank you!. Can you develop an update with some system to encrypt the data to save?
     
  46. hasanbayat

    hasanbayat

    Joined:
    Oct 18, 2016
    Posts:
    630
    Yeah, of course.
    I'll try to work on the update starting from today. (maybe it finishes right today)
    Thanks!
     
    Darkonen likes this.
  47. Darkonen

    Darkonen

    Joined:
    Nov 9, 2018
    Posts:
    8
    Thanks!!, i wish the update soon :D
     
  48. hasanbayat

    hasanbayat

    Joined:
    Oct 18, 2016
    Posts:
    630
    I'm currently (actively) researching for best practices and resources for Encryption in C# and Unity.
    So it may be a bit longer but I can say in this week.
    Also, I've tried to use the standard cryptographic library in C# but as the CryptoStream doesn't allow Seeking, I've to find a way around as Save Game Pro needs to seek in Stream back and forth.
    Any help would be greatly appreciated!

    Thanks for your patience!
     
  49. hasanbayat

    hasanbayat

    Joined:
    Oct 18, 2016
    Posts:
    630
    I've made good progress over Encryption.
    This is the sample encrypted data, the data is "Sample Encrypted Data" (string data)
    Annotation 2019-01-06 113330.jpg
    Encrypted using Rijndael with a custom padding, Key and IV.
    Here are new properties added to SaveGameSettings class for managing the Encryption behavior and configuration.
    Annotation 2019-01-06 113517.jpg
    Annotation 2019-01-06 113533.jpg
    Stay tuned!
    Thanks!
     
    Darkonen likes this.
  50. Darkonen

    Darkonen

    Joined:
    Nov 9, 2018
    Posts:
    8

    Looks great!, We will be looking forward to the update soon to be able to save and encrypt all the saved data, thank you very much and have a nice day!
     
    hasanbayat likes this.