Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Easy Save - The Complete Save Data & Serialization Asset

Discussion in 'Assets and Asset Store' started by JoelAtMoodkie, May 28, 2011.

  1. JoelAtMoodkie

    JoelAtMoodkie

    Joined:
    Oct 18, 2009
    Posts:
    912
    Support has now been added for 2D native arrays.

    Support for 3D and 4D arrays is to follow in a later update. If you would like this functionality sooner, email us and we'll move it up in the queue.

    Thanks,
    Joel
     
  2. John-G

    John-G

    Joined:
    Mar 21, 2013
    Posts:
    1,122
    Just bought this, and have gotten the web setup working (Using it locally via EasyPHP.
    Really looking forward to Playmaker Integration - just bought as well, as coding is very alien to me at this moment ;)

    Is there any example scene for ES2Web for simple testing that tables are been read/written to via ES2?

    All the best.
     
  3. JoelAtMoodkie

    JoelAtMoodkie

    Joined:
    Oct 18, 2009
    Posts:
    912
    Hi John,

    Playmaker integration for ES2Web should be coming in the next update. With regards to testing, the easiest way to check that ES2Web is working is simply to save a piece of data to web and then load it.

    Alternatively you could look at your database in something like PHPMyAdmin and check that the tables are not empty after saving data.

    All the best,
    Joel
     
  4. John-G

    John-G

    Joined:
    Mar 21, 2013
    Posts:
    1,122
    Nice, thanks Joel.
     
  5. vrmind

    vrmind

    Joined:
    Nov 11, 2012
    Posts:
    3
    Hi Joel. Easy save is great, but I have some issues with webplayer - saving to playerprefs. I used the example of saving audioclip that you have on easy save forum, and just changed saving destination to "myAudio.txt?savelocation=playerprefs". First time I published it on the webplayer everything worked fine, but then, when I wanted to publish the project again, I'm not able to read the data from playerprefs. I tried clearing playerprefs, changed the name of the file, and even started new project and repeated the steps that previously worked. All without success.
    Another issue is downloading from server database to webplayer. I got web setup working well - uploading data, downloading and saving them to file on desktop publish, but it doesn't work with webplayer, even when I changed destination in es2web.savetofile to playerprefs. I can send you my project files in case you'd like to have a look..
    Thanks in advance for help,
    Marcin
     
  6. JoelAtMoodkie

    JoelAtMoodkie

    Joined:
    Oct 18, 2009
    Posts:
    912
    Hi Marcin,

    It might be easier to answer your question outside of this thread. If you could post a thread on the Easy Save forum or contact me directlyat moodkie.com/contact, I'll get back to you as soon as possible.

    All the best,
    Joel
     
    Last edited: Jun 1, 2017
  7. paraself

    paraself

    Joined:
    Jun 30, 2012
    Posts:
    139
    Hii Joel. I am making an in-game level editor right now. I would like to know if I should used Easy save 2 or the WWW.audioclip to load audio files at runtime? Which method is more efficient as for runtime loading. Also the same confusion as for texture loading. Many thanks!

    Best!
     
  8. JoelAtMoodkie

    JoelAtMoodkie

    Joined:
    Oct 18, 2009
    Posts:
    912
    Hi paraself,

    Because Easy Save 2 uses the same underlying WWW methods as Unity to load AudioClips and Textures, there won't be much difference in performance, so you can do whichever you find easier.

    All the best,
    Joel
     
  9. paraself

    paraself

    Joined:
    Jun 30, 2012
    Posts:
    139
    Hi Joel

    Thanks for your fast reply. Another dumb question is: I have several scenes, each contains different audio effect groups, each group contains different clips. I found it's quite hard to use tags as key to save/load audio files. Do you have some suggestions on saving/loading/managing large amount of data using Easy Save 2? It's grateful to get advised. Thanks a lot!

    Best!
     
  10. JoelAtMoodkie

    JoelAtMoodkie

    Joined:
    Oct 18, 2009
    Posts:
    912
    If you're not doing so already, grouping the AudioClips into an Array, List or even Dictionary and then saving that might make life easier, and would also improve save/load times slightly.
     
  11. MooMoo-Games

    MooMoo-Games

    Joined:
    Jan 10, 2013
    Posts:
    10
    Hi joel,

    I bought ES2 last week, but I'm in trouble to use it.

    In brief, I'd like to save data in local file with encryption, but it doesn't work.

    PlayerPrefsEx was made for a wrapper of ES2 just like Unity's,

    and PlayerPrefsEx.Test() is called for the test.

    Without using ES2Settings everything works fine,

    otherwise only ES2.Load<int>( ... ) in GetInt() always makes an error such as below.

    (Loading float value works fine.)

    Is there any mistake in ES2Settings, Load or Save usages?


    Code (csharp):
    1.  
    2. public class PlayerPrefsEx
    3. {
    4.     static public bool m_initalized = false;
    5.  
    6.     static string m_filename = "mygame.txt";
    7.     static ES2Settings m_settings;
    8.  
    9.     public static void Test()
    10.     {
    11.         PlayerPrefsEx.Init();
    12.  
    13.         PlayerPrefsEx.SetInt( "intqwer", 777 );
    14.         PlayerPrefsEx.SetFloat( "float", 1.23f );
    15.  
    16.         float b = PlayerPrefsEx.GetFloat( "float", 0.0f );
    17.         int a = PlayerPrefsEx.GetInt( "intqwer", 0 );
    18.  
    19.         int c = PlayerPrefsEx.GetInt( "asd", 7 );
    20.  
    21.         int breaker = 7;
    22.     }
    23.  
    24.     public static void Init()
    25.     {
    26.         if( m_initalized )
    27.         {
    28.             return;
    29.         }
    30.  
    31.         m_settings = new ES2Settings( m_filename + "?tag=mySettingsTag");
    32.         m_settings.encrypt = true;
    33.         m_settings.encryptionPassword = "abcd1234ABCDwxyz";
    34.  
    35.         m_initalized = true;
    36.     }
    37.  
    38.     public static void SetInt( string key, int data )
    39.     {
    40.         string path = m_filename + "?tag=" + key;
    41.  
    42.         ES2.Save( data, path , m_settings );
    43.     }
    44.  
    45.     public static int GetInt( string key, int defaultValue )
    46.     {
    47.         int ret;
    48.         string path = m_filename + "?tag=" + key;
    49.  
    50.         if( ES2.Exists( path ) )
    51.         {
    52.             ret = ES2.Load<int>( path, m_settings );
    53.         }
    54.         else
    55.         {
    56.             ret = defaultValue;
    57.         }
    58.  
    59.         return ret;
    60.     }
    61.  
    62.     public static void SetFloat( string key, float value )
    63.     {
    64.         string path = m_filename + "?tag=" + key;
    65.  
    66.         ES2.Save( value, path, m_settings );
    67.     }
    68.  
    69.     public static float GetFloat( string key, float defaultValue )
    70.     {
    71.         float ret;
    72.         string path = m_filename + "?tag=" + key;
    73.  
    74.         if( ES2.Exists( path ) )
    75.         {
    76.             ret = ES2.Load<float>( path, m_settings );
    77.         }
    78.         else
    79.         {
    80.             ret = defaultValue;
    81.         }
    82.  
    83.         return ret;
    84.     }
    85. }
    86.  
     
  12. JoelAtMoodkie

    JoelAtMoodkie

    Joined:
    Oct 18, 2009
    Posts:
    912
    Hi there,

    Because the ES2Settings object overrides parameters in the path (such as the 'tag' parameter), you need to set the tag in the ES2Settings object.

    In your case, the easiest way to do this would be to put the following line before you call ES2.Save or ES2.Load:

    Code (csharp):
    1. m_settings.filenameData.tag = key;
    All the best,
    Joel
     
  13. JoelAtMoodkie

    JoelAtMoodkie

    Joined:
    Oct 18, 2009
    Posts:
    912
    Major ES2Web Update 2.11 Now Available

    1. Playmaker Support for ES2Web now available.

    2. The following Load methods have been added to ES2Web which enable you to load data without having to save it to file:

    - Load
    - LoadArray
    - Load2DArray
    - LoadList
    - LoadDictionary
    - LoadHashSet
    - LoadQueue
    - LoadStack
    - LoadHashtable
    - LoadRaw

    Thanks,
    Joel
     
  14. Mars91

    Mars91

    Joined:
    Mar 6, 2012
    Posts:
    572
    I'm getting this error tryinjg to compile on WP8

    Windows Phone 8 doesn't support "System.Security.Cryptography.PasswordDeriveBytes, mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e". Used by "Elixis.TripleDESEncryptor, Elixis, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null". Context: "Decrypt" method.
    UnityEngine.Debug:LogWarning(Object)
    PostProcessWP8Player:MakeManagedAssembliesWp8Compatible(String[], String[], String, String) (at C:/BuildAgent/work/cac08d8a5e25d4cb/PlatformDependent/WP8Player/Extensions/Managed/PostProcessWP8Player.cs:365)
    PostProcessWP8Player:postProcess(BuildTarget, BuildOptions, String, String, String, String, String, Guid) (at C:/BuildAgent/work/cac08d8a5e25d4cb/PlatformDependent/WP8Player/Extensions/Managed/PostProcessWP8Player.cs:227)
    UnityEditor.HostView:OnGUI()


    Do you think it's due to ES2?
     
  15. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    Hi Joel,

    didn't follow Easy Save thread since a while, simply because Easy Save is working so well with my projects that I don't look for support at all :) So this is just a thank you: awesome plugin once again. I just pre-released my last game (Goscurry, I put a description and link to Easy Save in the Credits page), and managing all types of saves for every platform is being a breeze.
     
  16. meta87

    meta87

    Joined:
    Dec 31, 2012
    Posts:
    254
    I've also been really enjoying the ease of use of Easy Save, thanks for the great product :)

    I've run into an issue though that I can't seem to figure out. I'm using Easy Save to save an INT Value corresponding to the current level with this code:
    Code (csharp):
    1. ES2.Save(level, playerName+"currentLevel");
    and load it with this code:
    Code (csharp):
    1.  
    2. if(!ES2.Exists (playerName+"currentLevel")) return;
    3. currentLevel = ES2.Load.<int>(playerName+"currentLevel");
    4.  
    On Android this works great. On iOS it works when I do a development Build, but a normal build gives me these errors in the XCode Logs:

    Jul 27 12:47:56 blobgame[2542] <Warning>: IOException: Invalid parameter
    at System.IO.FileStream.Dispose (Boolean disposing) [0x00000] in <filename unknown>:0
    at System.IO.Stream.Close () [0x00000] in <filename unknown>:0
    at System.IO.Stream.Dispose () [0x00000] in <filename unknown>:0
    at System.IO.File.ReadAllBytes (System.String path) [0x00000] in <filename unknown>:0
    at MoodkieFileReader.CreateStream () [0x00000] in <filename unknown>:0

    (Filename: Line: -1)

    I also got a System.IO sharing exception which I forgot to copy.

    Any ideas would be greatly apppreciated, thanks!
     
  17. alexlam127

    alexlam127

    Joined:
    Jun 4, 2013
    Posts:
    36
    hello im kinda noob with sql stuff
    i would like to try to set up esweb to a free webhosting site
    where should i put the modified es2.php file to ? i tried to put it in the ftp server,seems not working
    Any ideas would be greatly apppreciated, thanks!
     
  18. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,459
    @Izitmee,

    Interesting to hear that you are having a good experience with EasySave. I just bought the package and finding it not so Easy to use. For example, I need to save a gameObject with custom components and many of these components have List<GameObject>. How did you go about saving references to GameObjects ? I asked this question in the EasySave forum but no answer.

    Is there example project of using EasySave to save a scene that has custom components which references other gameObjects within the scene?

    Thanks.
     
    Last edited: Jul 29, 2013
  19. JoelAtMoodkie

    JoelAtMoodkie

    Joined:
    Oct 18, 2009
    Posts:
    912
    Hi rocki,

    As you asked your question on a Friday night, and working hours here in the UK are Monday - Friday, 09:00 to 17:00, we've not been able to respond to your message until now (Monday morning). The response can be found here.

    Regards,
    Joel
     
  20. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    @rocki: you can't save a reference to a GameObject (here are the supported types that Easy Save works with). What you can do instead, is use some logic to convert the data you need into one of the supported types, and then save it.

    EDIT: ooops answered a second after Joel's better one :D
     
  21. JoelAtMoodkie

    JoelAtMoodkie

    Joined:
    Oct 18, 2009
    Posts:
    912
    Hi Alex,

    I'm afraid we're no longer answering questions in this thread anymore as it becomes quite confusing when talking to multiple people, and we don't always get notified when there are new questions in here. However, you can contact me directly at moodkie.com/contact. There is also an Easy Save General Discussion Forum for less urgent questions.
     
    Last edited: Jun 1, 2017
  22. JoelAtMoodkie

    JoelAtMoodkie

    Joined:
    Oct 18, 2009
    Posts:
    912
    Hi meta87,

    As mentioned above, we're no longer answering questions in this thread. However, if you email me directly at moodkie.com/contact I'll answer as soon as possible.

    All the best,
    Joel
     
    Last edited: Jun 1, 2017
  23. meta87

    meta87

    Joined:
    Dec 31, 2012
    Posts:
    254
    Hi Joel,

    Sorry I missed that post! Just sent you an email, thanks. :)
     
  24. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,459
    @ EasySave users -

    I made the following post in the forum:

    Hey Joel,

    I noticed that one of the reasons that it's so hard to handle the hierarchy with EasySave is that fact that there's no hierarchy information being saved. Most of what is being saved are individual data items. Unity's paradigm is really built on the Scene Hierarchy and if this information is not persisted, then it's very hard to rebuilt the scene. Currently, when restoring a GO that has been deleted in the scene, we have to first load it into the scene together with it's parent's ID or name, then use Find() to look for the parent transform then attach. This process has to rely on the scene hierarchy because it does not have its own scene graph.

    Perhaps the situation would be much simpler if EasySave keeps track of the objects with some sort of scene graph data of its own. This will make restoring the scene much easier because as the unity scene hierarchy comes and go, we still have the relationships between the individual objects. Each time something is saved, the Scene Graph is updated. If each GO had a uniqueId, an associated prefab, and each component within the prefab had save()/Load() functions, then restoring with the scene graph data is quite simple.

    There are also many advantages to having this Scene Graph:
    1. It can be used to store additional meta-data about the stored objects.
    2. We can also query the graph to get useful information about the saved objects without having to load the object into the scene.
    3. Selectively restore a part of the graph.

    The best scenario is to get access to the GO like they were all in the scene. Ex: Find(), FindChildren(), getParent(), etc...

    We'll add hierarchical information to the To Do list, and if there's demand for it, we'll implement it. However, this is the first time that anyone has requested it as most people don't require it, and those who do implement it by saving the unique parent ID with the data and searching a list.

    All the best,
    Joel

    According to Joel, no one has asked for this feature. This is very much a surprise to me because UnitySerializer and SavitPro main focus has been to serialize the entire scene. I realized that I am very new at EasySave, only use it a few days. Therefore, I am asking those who have used EasySave longer than me to offer some suggestions as to how they solved this problem.

    Thanks.
     
  25. JoelAtMoodkie

    JoelAtMoodkie

    Joined:
    Oct 18, 2009
    Posts:
    912
    To anyone who was interested in the solution to Rocki's question, we've created an example here which should adequately describe how to go about this.

    All the best,
    Joel
     
  26. stevenapolo7

    stevenapolo7

    Joined:
    Aug 15, 2012
    Posts:
    24
  27. JoelAtMoodkie

    JoelAtMoodkie

    Joined:
    Oct 18, 2009
    Posts:
    912
    Hi there,

    We're no longer answering questions in this thread because it gets a bit complicated. However, if you get in touch with us directly or on our dedicated Easy Save forum, we'll try our best to answer your question.

    For the record, you shouldn't save to Application.dataPath because this directory will not exist at runtime (by default Easy Save saves to Application.persistentDataPath). If you're just saving in the editor and not at runtime, you can provide an absolute path to Easy Save. Just do Debug.Log(Application.dataPath) to get the path, and then use it as the "Save File" field.
     
  28. Scellow

    Scellow

    Joined:
    Jan 25, 2013
    Posts:
    32
    Hi,

    Is there a way to implement a simple function to load/save everything ? like this one :

    Code (csharp):
    1.  
    2.  
    3. function saveGame()
    4.  
    5. {
    6.  
    7. save.state("save1");
    8.  
    9. }
    10.  
    11.  
    12.  
    13.  
    14.  
    15. function loadGame()
    16.  
    17. {
    18.  
    19. load.state("save1");
    20.  
    21. }
    22.  
     
  29. JoelAtMoodkie

    JoelAtMoodkie

    Joined:
    Oct 18, 2009
    Posts:
    912
    Hi there,

    We're no longer answering questions in this thread because it gets a bit complicated. However, if you get in touch with us directly or on our dedicated Easy Save forum, we'll try our best to answer your question.
     
  30. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,546
    Hi there,

    Your product looks interesting but before I purchase I had a question regarding if windows phone 8 and windows store is supported?

    Your description on the assetstore does list windows phone 8 but then there was a forum entry I read somewhere from September 2013 that stated that WP8 was not supported and was at the time throwing a not in target framework error due to WP8 not using mono runtime (and the runtime on the phone didn't implement a cryptograph class).

    These two pieces seem to contradict eachother and I was wondering if WP8 and windows store apps are currently supported by easy save 2.
     
  31. JoelAtMoodkie

    JoelAtMoodkie

    Joined:
    Oct 18, 2009
    Posts:
    912
    Hi there,

    Windows Store support is coming in the next couple of weeks, and Windows Phone 8 is currently supported. Some people were having intermittent problems with encryption back in September, but that was fixed in an update.

    All the best,
    Joel
     
  32. hima

    hima

    Joined:
    Oct 1, 2010
    Posts:
    183
    Sorry for bumping this but I have a question regarding saving a file to Resources folder.

    Currently it only works if you run the game inside the editor. Is it possible to run ES2.Save to the Resources folder without clicking the Play button? I'm working on an editor window that process files, encrypt them and save them into Resources folder. It isn't convenient having to press play in order to do that.
     
  33. JoelAtMoodkie

    JoelAtMoodkie

    Joined:
    Oct 18, 2009
    Posts:
    912
    Hi there,

    We're no longer answering questions in this thread as it becomes quite confusing when you get a lot of people asking questions, and occasionally it forgets to notify us when there are new posts in the thread. However, I've placed your question on our own forums and answered it there.

    You can also contact us directly.

    All the best,
    Joel
     
  34. Krileon

    Krileon

    Joined:
    Oct 30, 2012
    Posts:
    642
    I'm not sure what's going on but my JSON string is being saved in Chinese. Why is it doing this? I'm saving to a text file a standard JSON string yet it keeps turning it into Chinese characters when I open it.
     
  35. JoelAtMoodkie

    JoelAtMoodkie

    Joined:
    Oct 18, 2009
    Posts:
    912
    Hi there,

    Easy Save 2 uses its own form of binary serialisation as it's faster and more compact than JSON, which is why you get the strange characters in your file.

    All the best,
    Joel
     
  36. Krileon

    Krileon

    Joined:
    Oct 30, 2012
    Posts:
    642
    Is it possible to shut that off? It also doesn't seam to always happen. For some reason sometimes it saves as raw JSON and not binary. I'd like to be able to save as raw JSON. I want it to be parse-able outside of Unity/EasySave2 and that's easily doable as JSON.
     
    Last edited: Apr 28, 2014
  37. JoelAtMoodkie

    JoelAtMoodkie

    Joined:
    Oct 18, 2009
    Posts:
    912
    Hi there,

    Easy Save 2 currently has no JSON functionality so I'm afraid this isn't possible. You can use ES2.SaveRaw and ES2.LoadRaw to save and load raw bytes to and from a file if you would like to write your own JSON or XML string however.

    (There's a good guide on converting strings to byte arrays at DNP)

    All the best,
    Joel
     
    Last edited: Apr 28, 2014
  38. Krileon

    Krileon

    Joined:
    Oct 30, 2012
    Posts:
    642
    I don't understand how this is the case. My smaller file saves as JSON perfectly fine. My smaller file (options) saves as the below.

    Code (csharp):
    1.  
    2. ~   þ {"Options_Gameplay_Lang":"en","Options_Gameplay_ScrollSpeed":15,"Options_Gameplay_MouseScroll":1,"Options_Gameplay_FPS":1,"Options_Graphics_QualityLevel":2,"Options_Graphics_Resolution":"640x480","Options_Graphics_FullScreen":1,"Options_Graphics_AntiAlias":0,"Options_Graphics_VSync":0,"Options_Graphics_Bloom":1,"Options_Graphics_MotionBlur":1,"Options_Graphics_SSAO":1,"Options_Graphics_ColorCorrection":1,"Options_Graphics_Anisotropic":0,"Options_Graphics_TextureQuality":0,"Options_Graphics_Brightness":0.0,"Options_Audio_SpeakerMode":2,"Options_Audio_GlobalVolume":1.0,"Options_Audio_MusicVolume":1.0,"Options_Audio_SFXVolume":1.0,"Options_Controls_PickAxe":["Alpha1","None"],"Options_Controls_Box":["Alpha2","None"],"Options_Controls_Bridge":["Alpha3","None"],"Options_Controls_Ramp":["Alpha4","None"],"Options_Controls_BouncePad":["Alpha5","None"],"Options_Controls_Torch":["Alpha6","None"],"Options_Controls_TNT":["Alpha7","None"],"Options_Controls_KillMiner":["Alpha8","None"],"Options_Controls_Use":["Mouse0","None"],"Options_Controls_Swap":["Mouse1","None"],"Options_Controls_Cancel":["Space","None"],"Options_Controls_ScrollLeft":["A","None"],"Options_Controls_ScrollRight":["D","None"],"Options_Controls_ScrollUp":["W","None"],"Options_Controls_ScrollDown":["S","None"],"Options_Controls_ToggleHUD":["F1","None"],"Options_Controls_ZoomIn":["Mouse Wheel Up","None"],"Options_Controls_ZoomOut":["Mouse Wheel Down","None"],"Options_Controls_SpeedIncrease":["Equals","None"],"Options_Controls_SpeedDecrease":["Minus","None"]}{
    3.  
    Yet, my levels JSON (I have a level editor, I parse through it and output a JSON string) stores as a bunch of gibberish, which you say is binary, but it is not binary it is Chinese. Binary looks nothing like the below (cut short as it's quite long).

    Code (csharp):
    1.  
    2. ~㯖턁ӷ≻慎敭㨢䴢⁹敌敶≬∬楐正䄠數䰠浩瑩㨢〱∬潂⁸楌業≴ㄺⰰ䈢楲杤⁥楌業≴ㄺⰰ䈢畯据⁥楌業≴ㄺⰰ刢浡⁰楌業≴ㄺⰰ吢牯档䰠浩瑩㨢〱∬乔⁔楌業≴ㄺⰰ䈢捡杫潲湵≤∺屻爢睯屳㨢〳尬挢汯浵獮≜㌺ⰰ≜牢獵敨屳㨢筛≜牢獵屨㨢畮汬尬爢睯≜〺尬挢汯浵屮㨢細第≜牢獵屨㨢畮汬尬爢睯≜〺尬挢汯浵屮㨢紱第≜牢獵屨㨢畮汬尬爢睯≜〺尬挢汯浵屮㨢紲第≜牢獵屨㨢畮汬尬爢睯≜〺尬挢汯浵屮㨢紳第≜牢獵屨㨢畮汬尬爢睯≜〺尬挢汯浵屮㨢紴第≜牢獵屨㨢畮汬尬爢睯≜〺尬挢汯浵屮㨢紵第≜牢獵屨㨢畮汬尬爢睯≜〺尬挢汯浵屮㨢紶第≜牢獵屨㨢畮汬尬爢睯≜〺尬挢汯浵屮㨢紷第≜牢獵屨㨢畮汬尬爢睯≜〺尬挢汯浵屮㨢紸第≜牢獵屨㨢畮汬尬爢睯≜〺尬挢汯浵屮㨢紹第≜牢獵屨㨢畮汬尬爢睯≜〺尬挢汯浵屮㨢〱ⱽ屻戢畲桳≜渺汵ⱬ≜潲屷㨢ⰰ≜潣畬湭≜ㄺ紱第≜牢獵屨㨢畮汬尬爢睯≜〺尬挢汯浵屮㨢㈱ⱽ屻戢畲桳≜渺汵ⱬ≜潲屷㨢ⰰ≜潣畬湭≜ㄺ紳第≜牢獵屨㨢畮汬尬爢睯≜〺尬挢汯浵屮㨢㐱ⱽ屻戢畲桳≜渺汵ⱬ≜潲屷㨢ⰰ≜潣畬湭≜ㄺ紵第≜牢獵屨㨢畮汬尬爢睯≜〺尬挢汯浵屮㨢㘱ⱽ屻戢畲桳≜渺汵ⱬ≜潲屷㨢ⰰ≜潣畬湭≜ㄺ紷第≜牢獵屨㨢畮汬尬爢睯≜〺尬挢汯浵屮㨢㠱ⱽ屻戢畲桳≜渺汵ⱬ≜潲屷㨢ⰰ≜潣畬湭≜ㄺ紹第≜牢獵屨㨢畮汬尬爢睯≜〺尬挢汯浵屮㨢〲ⱽ屻戢畲桳≜渺汵ⱬ≜潲屷㨢ⰰ≜潣畬湭≜㈺紱
    3.  
    All I want it to do is always save like it already does for my options.. in JSON. I don't need EasySave2 to handle serialization of JSON. I need it to just save the string I gave it. No additional serialization is needed.
     
  39. JoelAtMoodkie

    JoelAtMoodkie

    Joined:
    Oct 18, 2009
    Posts:
    912
    My apologies, I understand now.

    When you open a binary file in a text editor, it will try to convert the binary to an encoding (usually UTF8 ), which is why you are getting the Chinese characters, as these are the character representations of the binary.

    To prevent this, you will need to convert your string to a byte array and use the SaveRaw method I mentioned in the previous post to save without any binary formatting.

    For example, this code could be used to save your JSON string to file correctly:

    Code (csharp):
    1. byte[] bytes = System.Text.Encoding.UTF8.GetBytes( yourJSONString );
    2. ES2.SaveRaw( bytes, "myFile.txt" );
    I hope this helps!

    All the best,
    Joel
     
  40. Krileon

    Krileon

    Joined:
    Oct 30, 2012
    Posts:
    642
    Aha, good to know. Thank you very much! That indeed is working perfectly. Wonderful asset. Makes saving super easy!
     
  41. kilik128

    kilik128

    Joined:
    Jul 15, 2013
    Posts:
    909
    link dead

    i have this when i try
    ES2TypeNotSupportedException: Easy Save does not support saving this type. If you are trying to load a collection such as a Dictionary or Array, use the collection classes (for example, LoadDictionary<>() or LoadArray<>()).
    MoodkieWriter.Write (System.Object param)
    MoodkieWriter.Write[tool] (System.Collections.Generic.List`1 param)
    MoodkieSave.Save[tool] (System.Collections.Generic.List`1 param, .ES2Settings settings)


    save one class any help is welcome please thank's
    stuff = ES2.LoadList<tool> ("stuff");
    ES2.Save(stuff,"stuff");
     
  42. JoelAtMoodkie

    JoelAtMoodkie

    Joined:
    Oct 18, 2009
    Posts:
    912
    Hi there,

    We are no longer using this thread as much of the data in it is out of date, so questions should be aimed at our forum or directly at our contact page.

    However, the documentation for saving custom types can now be found HERE, and the Supported Types list can be found HERE.

    All the best,
    Joel
     
  43. Kiori

    Kiori

    Joined:
    Jun 25, 2014
    Posts:
    161
    Have you guys considered having a gui/window option to edit/create variables/lists/tags/everything?
    This is the one thing holding me back from buying this asset right now, I'd really like a gui option to easy the workflow of creating the individual values/variables/etc.
     
  44. JoelAtMoodkie

    JoelAtMoodkie

    Joined:
    Oct 18, 2009
    Posts:
    912
    Hi Kiori,

    We're actually working on this functionality at the moment, and have been discussing it on our own forums. I'm unable to give an exact ETA on it, but we're hoping to have it included within the next couple of weeks.

    All the best,
    Joel
     
  45. Kiori

    Kiori

    Joined:
    Jun 25, 2014
    Posts:
    161
    will it allow you to edit custom lists with any sort of types? will it have the option of enabling encryption per item or list, in gui?
    Point me to the post in your forums if you can,
    All the best!

    edit: also,i was reading up on your asset, i thought you guys just implemented serialization, but it looks like you created your own solution. i read around the forum that you have your own 'file format'. does that mean any data saved with easy save is obfuscated? even if not encrypted?
    also, i saw some people saving in file.es but the examples files are in file.txt, what's that all about?
    Does saving in .es give you any extra functionality.

    If easy save obfuscates info, even on 'playerprefs' and is simpler than serializing manually, then it's a winner from my pov.
     
    Last edited: Nov 22, 2014
  46. JoelAtMoodkie

    JoelAtMoodkie

    Joined:
    Oct 18, 2009
    Posts:
    912
    Hi there,

    I'll try to answer your questions in order:

    • It will only allow you to edit basic types to begin with (i.e. those which Unity have their own Editor implementations for), and enabling encryption through the GUI may come at a later date too. We don't want to add too much functionality to begin with because we just want to get basic feedback first. The thread doesn't go into great detail but when we have some examples to show, we'll add a dedicated thread on our forums for it.
    • We use our own binary serialisation which is structured in a way which makes it very quick, very powerful and require much less storage space. It allows features such as random access, and doesn't require slow reflection libraries which bloat the size of your app. It's generally obfuscated, apart from strings. If you require strings to be obfuscated, you can just encrypt them. And to confirm, Easy Save obfuscates on PlayerPrefs too.
    • You can use whatever filenames and extensions you like. Some people like to use .es so they know that it's an Easy Save file, but we usually use .txt in our examples because it's just a widely used file extension.
    All the best,
    Joel
     
  47. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    2,255
    Hi, In my fishing game i use easy save to load bait .txt files that users can create in a separate program on PC/Mac. This works really well and I'd like to bring that functionality to mobile devices with a free companion app for my game.

    My question is, if I create a bait file in the companion app, is it possible to store it in a location that the game can also access? So at game start it loads any custom files the player has made in the companion app?

    Thanks
     
  48. JoelAtMoodkie

    JoelAtMoodkie

    Joined:
    Oct 18, 2009
    Posts:
    912
    Hi there,

    As iOS actively isolates data for each app, the only way I can think of to do this would be to integrate it with an iCloud plugin (see this thread for more information on how you could do this). If you do go this route, you'll also want to check with the makers of the iCloud plugin that their plugin indeed allows access between apps.

    All the best,
    Joel
     
  49. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    2,255
    Thanks for the Reply Joel, would perhaps saving to dropbox be an option?
     
  50. JoelAtMoodkie

    JoelAtMoodkie

    Joined:
    Oct 18, 2009
    Posts:
    912
    If you could integrate it into a Dropbox plugin then that would also work, or any other cloud storage for that matter.

    - Joel