Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

.

Discussion in 'Assets and Asset Store' started by KayaOrsan, Jun 16, 2015.

  1. KayaOrsan

    KayaOrsan

    Joined:
    Jan 22, 2013
    Posts:
    20
    .......
     
    Last edited: Nov 28, 2016
    Onpolyx and Meltdown like this.
  2. KellyThomas

    KellyThomas

    Joined:
    Jul 1, 2012
    Posts:
    39
    What platforms does this support?
     
  3. jellybit

    jellybit

    Joined:
    Nov 21, 2009
    Posts:
    32
    You mention that you've tested web. You use the web player in your example (which I can't run in Chrome). I assume it doesn't work with WebGL, right? That seems to be Unity's web support going forward.
     
  4. NioFox

    NioFox

    Joined:
    Dec 28, 2012
    Posts:
    65
    Does Perlib handle savefile changes?
    For example, if I add a few new variables and remove a few, would it still load the savefile so that I could salvage the stuff that remained the same?
     
  5. lukaking032

    lukaking032

    Joined:
    Oct 26, 2014
    Posts:
    2
    Can I use it to save for mobile?
     
    Gekigengar likes this.
  6. NioFox

    NioFox

    Joined:
    Dec 28, 2012
    Posts:
    65
    I probably should have given some context, my apologies.
    I am concerned about making new versions of savegames and upgrading old ones. As I continue to develop my game through it's alpha stages I want to ensure that I don't lose player's save data too often when I add new features and so on.
     
  7. KellyThomas

    KellyThomas

    Joined:
    Jul 1, 2012
    Posts:
    39
    It would be nice to see nice to see a compatibility matrix if the feature set is not uniform.
     
  8. NioFox

    NioFox

    Joined:
    Dec 28, 2012
    Posts:
    65
    Oh this is perfect.
    Buying now :)
     
  9. NeatWolf

    NeatWolf

    Joined:
    Sep 27, 2013
    Posts:
    924
    Hi, I've just bought the package and read the posts till now.

    I'd like to know if *all* features listed in the description are available and have been tested on the following platforms: PC, iOS, Web, Android and all other mobile platforms.

    I'm particularly concerned about the encryption feature, which I personally would like to use.

    I'm worried about that "fallback to the default playerprefs" I read in the posts before.

    Thanks for your answer.
     
  10. jellybit

    jellybit

    Joined:
    Nov 21, 2009
    Posts:
    32
    Excellent! So to be perfectly clear, do you mean that even on WebGL, we would have the "Lets you save any serializable type" feature using Unity's PlayerPrefs fallback?
     
  11. NioFox

    NioFox

    Joined:
    Dec 28, 2012
    Posts:
    65
    I'm having some trouble saving arrays.
    Is there a proper way to do this:

    Code (CSharp):
    1. Perlib savefile = new Perlib(filename, null, libKey, valueKey);
    2. savefile.SetValue<SaveItem[]>("items", null);
    Console output:

    Something went wrong trying to set Value for Key items.
    Nothing was set.
    There was an error reflecting type 'SaveItem[]'.
    UnityEngine.Debug:LogWarning(Object)
    SentientBytes.Perlib.Perlib:SetValue(String, SaveItem[]) (at Assets/Sentient Bytes/Perlib/Source/Perlib.cs:181)
     
  12. NioFox

    NioFox

    Joined:
    Dec 28, 2012
    Posts:
    65
    Actually, it's not arrays specifically it seems.
    I'm trying to save the following class I made as a single object with no luck (same console output)


    Code (CSharp):
    1. [System.Serializable]
    2. public class SaveStatEx
    3. {
    4.     public float
    5.         valueCurrent,
    6.         valueBase;
    7.  
    8.     public SaveStatEx(StatEx stat)
    9.     {
    10.         valueCurrent = stat.valueCurrent;
    11.         valueBase = stat.valueBase;
    12.     }
    13.     public void unpack(StatEx stat)
    14.     {
    15.         stat.valueCurrent = valueCurrent;
    16.         stat.valueBase = valueBase;
    17.     }
    18. }
     
  13. bvesco

    bvesco

    Joined:
    Jul 7, 2013
    Posts:
    3
    Perlib is the 24-hour sale today. I never knew about it before. It looks great. Just purchased it :)
     
  14. NioFox

    NioFox

    Joined:
    Dec 28, 2012
    Posts:
    65
    So I thought it was just me doing something wrong, but then I dragged the Simple Example Usage script on to an empty game object in a scene and this is what the console said:

    • Something went wrong trying to set Value for Key My Object.
    • Nothing was set.
    • There was an error reflecting type 'PerlibExamples.MyClass'.
     
  15. NioFox

    NioFox

    Joined:
    Dec 28, 2012
    Posts:
    65
    Ah, the example did work after changed it to public.

    I also figured out the 2nd problem in my own usage: The constructors for my classes have parameters. To solve this, I added another plain constructor (no parameters) and it worked fine.
     
    KayaOrsan likes this.
  16. Duffer123

    Duffer123

    Joined:
    May 24, 2015
    Posts:
    1,215
    Does it have Playmaker support, actions?
     
  17. Duffer123

    Duffer123

    Joined:
    May 24, 2015
    Posts:
    1,215
    excellent - thanks
     
  18. handre

    handre

    Joined:
    Nov 24, 2013
    Posts:
    1
    Hi KayaOrsan,

    I bought your asset yersterday, since I'm trying to play with it but I have some trouble with custom classes. I understood we can only use serialize classes but I need to save data from class with a monobehavior because I assigned some value in the editor. Is this possible ? There is a work arround ?
     
  19. then00b

    then00b

    Joined:
    Oct 5, 2012
    Posts:
    8
    Does Perlib have methods to encrypt the data while saving or does it simply support encrypted data?
     
  20. then00b

    then00b

    Joined:
    Oct 5, 2012
    Posts:
    8
    Sorry for the confusion there! I just meant does Perlib do the encryption for you? (I'm new to the idea of file encryption so sorry if this is a dumb question!) It sounds like the answer is yes but I just want to make sure.
     
  21. then00b

    then00b

    Joined:
    Oct 5, 2012
    Posts:
    8
    Great, thank you for your answers. I'll be picking this up later today! :)
     
    KayaOrsan likes this.
  22. NeatWolf

    NeatWolf

    Joined:
    Sep 27, 2013
    Posts:
    924
    Thanks for your answer.

    I honestly haven't dabbled with the asset yet, but would like to know: are there examples of the simplest use of encryption using Perlib, just to get started easily?

    Thanks for your time :)
     
  23. NeatWolf

    NeatWolf

    Joined:
    Sep 27, 2013
    Posts:
    924
    I think you did a great job, love the possibility to choose what to encrypt, it's a nice feature to have!

    Thanks for your answer! ;)
     
  24. wrstscrnnm6

    wrstscrnnm6

    Joined:
    Jan 31, 2011
    Posts:
    20
    Hey @KayaOrsan
    If I decide not to specify a file location, where does Perlib store the library? (in the editor and for a build)
    Assuming I have encryption turned off, is the library "human readable"?

    Thanks
     
  25. wrstscrnnm6

    wrstscrnnm6

    Joined:
    Jan 31, 2011
    Posts:
    20
    Thanks @KayaOrsan Everything with Perlib seems to be working great. I needed to take a peek to figure out how I screwed up my own de-serialization functions. :(
    Keep up the good work.
     
  26. Eoghan

    Eoghan

    Joined:
    Jun 6, 2013
    Posts:
    80
    Looks like it's working great for general object storage, and primitives.. but unfortunately, it's falling apart on me when attempting to store an IDictionary, with a custom class type indexed via string.

    Seems to be storing it as a null type every time - any ideas?
     
  27. Eoghan

    Eoghan

    Joined:
    Jun 6, 2013
    Posts:
    80
    Cheers @KayaOrsan , much appreciated! Are there any other types that we should be wary of?
     
  28. gskinner

    gskinner

    Joined:
    Aug 28, 2014
    Posts:
    43
    How does this handle changes to Custom Data Classes?

    For example, say in v1.0 of my game, I have MyCustomObject { int PlayerHealth } property, and then later, in v.1.1 I rename that field. Will the plugin still be able to de-serialize the v1.0 MyCustomObject without blowing up?
     
  29. MABManZ

    MABManZ

    Joined:
    Sep 29, 2011
    Posts:
    144
    Do you have any plans to support Playmaker? I'm currently using Playerprefs in my game project which I've used extensively, but will need to switch to a encrypted file save system in the future to support cloud saves and work better if I release on consoles in the future.
     
  30. gskinner

    gskinner

    Joined:
    Aug 28, 2014
    Posts:
    43
    Thanks the the reply Kaya, this is what I figured, was just curious if you had found some magic way to make this work.

    The one time I wish C# wasn't so strict! Apparently BinaryFormatter _should_ have basic support for Version Tolerance, but Unity is just not supporting it:
    https://msdn.microsoft.com/en-us/library/ms229752(v=vs.110).aspx
     
  31. bioert

    bioert

    Joined:
    Nov 9, 2014
    Posts:
    8
    Hi, First! Great asset! I have been using it a lot to store floats, vector3 and ints.
    Question: Can it save Lists?
    Can you provide a example on how to save and load a Lists?

    Thanks!
     
  32. bioert

    bioert

    Joined:
    Nov 9, 2014
    Posts:
    8

    Thank you! It worked!. Actually what happens is that I created a custom class that contained some int, float and Gameobject and sprites. Then when trying to save the list it gave me an error. But I manage to do a work around using the example you just provided me.

    Again, thanks!
     
  33. jprocha101

    jprocha101

    Joined:
    Apr 8, 2015
    Posts:
    134
    Is there a way to call Save() that will not hinder performance very much?

    I am seeing a 100+ ms time spike in the profiler in editor and a noticeable lag on device since objects are moving as the save is taking place. I am saving a custom class that has 3 fields in it. I tried calling from within a coroutine but the results were the same. I am also not encrypting the individual saves, only the file as a whole.
     
    Last edited: Aug 29, 2015
  34. wrstscrnnm6

    wrstscrnnm6

    Joined:
    Jan 31, 2011
    Posts:
    20
    So when I built to iOS I hit the following issue:

    Code (csharp):
    1. Something went wrong trying to deserialize PersistentLibrary GAMENAMEGameData.
    2. Creating new Library.
    3. Access to the path "/var/mobile/Containers/Data/Application/AF41C641-4J5A-432F-B7F6-4DFB21207998/Documents\GAMENAMEGameData" is denied.
    4. UnityEngine.Debug:Internal_Log(Int32, String, Object)
    5. UnityEngine.Debug:LogWarning(Object)
    6. SentientBytes.Perlib.Perlib:.ctor(String, String, String, String) (at /Users/userName/git/GAMENAME/Assets/Sentient Bytes/Perlib/Source/Perlib.cs:124)
    7. Data:get_saveData() (at /Users/userName/git/GAMENAME/Assets/Scripts/Data.cs:255)
    8. MainMenuManager:selectPuzzle() (at /Users/userName/git/GAMENAME/Assets/Scripts/MainMenuManager.cs:104)
    9. UnityEngine.Events.InvokableCall:Invoke(Object[])
    10. UnityEngine.Events.InvokableCallList:Invoke(Object[])
    11. UnityEngine.Events.UnityEventBase:Invoke(Object[])
    12. UnityEngine.Events.UnityEvent:Invoke()
    13. UnityEngine.UI.Button:Press()
    14. UnityEngine.UI.Button:OnPointerClick(PointerEventData)
    15. UnityEngine.EventSystems.ExecuteEvents:Execute(IPointerClickHandler, BaseEventData)
    16. UnityEngine.EventSystems.ExecuteEvents:Execute(GameObject, BaseEventData, EventFunction`1)
    17. UnityEngine.EventSystems.TouchInputModule:ProcessTouchPress(PointerEventData, Boolean, Boolean)
    18. UnityEngine.EventSystems.TouchInputModule:ProcessTouchEvents()
    19. UnityEngine.EventSystems.TouchInputModule:Process()
    20. UnityEngine.EventSystems.EventSystem:Update()
    21. (Filename: /Users/userName/git/GAMENAME/Assets/Sentient Bytes/Perlib/Source/Perlib.cs Line: 124)
    22.  
    23. UnauthorizedAccessException: Access to the path "/var/mobile/Containers/Data/Application/AF11C641-4E5A-432F-B7F6-4DFB21107998/Documents\GAMENAMEGameData" is denied.
    24.   at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean anonymous, FileOptions options) [0x00000] in <filename unknown>:0
    25.   at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share) [0x00000] in <filename unknown>:0
    26.   at System.IO.StreamWriter..ctor (System.String path, Boolean append, System.Text.Encoding encoding, Int32 bufferSize) [0x00000] in <filename unknown>:0
    27.   at System.IO.StreamWriter..ctor (System.String path, Boolean append, System.Text.Encoding encoding) [0x00000] in <filename unknown>:0
    28.   at SentientBytes.Perlib.Serializer.SerializeObjectToFile[SerializableDictionary`2] (SentientBytes.Perlib.SerializableDictionary`2 toSerialize, System.String filePath, System.String sharedSecret) [0x00000] in <filename unknown>:0
    29.   at SentientBytes.Perlib.Perlib.Save () [0x00000] in /Users/userName/git/GAMENAME/Assets/Sentient Bytes/Perlib/Source/Perlib.cs:162
    30.   at SentientBytes.Perlib.Perlib.CreateNew () [0x0000b] in /Users/userName/git/GAMENAME/Assets/Sentient Bytes/Perlib/Source/Perlib.cs:224
    31.   at SentientBytes.Perlib.Perlib..ctor (System.String name, System.String path, System.String libraryPassword, System.String valuesPassword) [0x000a0] in /Users/userName/git/GAMENAME/Assets/Sentient Bytes/Perlib/Source/Perlib.cs:125
    32.   at Data.get_saveData () [0x0000a] in /Users/userName/git/GAMENAME/Assets/Scripts/Data.cs:255
    33.   at MainMenuManager.selectPuzzle () [0x00006] in /Users/userName/git/GAMENAME/Assets/Scripts/MainMenuManager.cs:104
    34.   at UnityEngine.Events.InvokableCall.Invoke (System.Object[] args) [0x00000] in <filename unknown>:0
    35.   at UnityEngine.Events.InvokableCallList.Invoke (System.Object[] parameters) [0x00000] in <filename unknown>:0
    36.   at UnityEngine.Events.UnityEventBase.Invoke (System.Object[] parameters) [0x00000] in <filename unknown>:0
    37.   at UnityEngine.Events.UnityEvent.Invoke () [0x00000] in <filename unknown>:0
    38.   at UnityEngine.UI.Button.Press () [0x00000] in <filename unknown>:0
    39.   at UnityEngine.UI.Button.OnPointerClick (UnityEngine.EventSystems.PointerEventData eventData) [0x00000] in <filename unknown>:0
    40.   at UnityEngine.EventSystems.ExecuteEvents.Execute (IPointerClickHandler handler, UnityEngine.EventSystems.BaseEventData eventData) [0x00000] in <filename unknown>:0
    41.   at UnityEngine.EventSystems.ExecuteEvents.Execute[IPointerClickHandler] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.EventFunction`1 functor) [0x00000] in <filename unknown>:0
    42. UnityEngine.Debug:Internal_LogException(Exception, Object)
    43. UnityEngine.Debug:LogException(Exception)
    44. UnityEngine.EventSystems.ExecuteEvents:Execute(GameObject, BaseEventData, EventFunction`1)
    45. UnityEngine.EventSystems.TouchInputModule:ProcessTouchPress(PointerEventData, Boolean, Boolean)
    46. UnityEngine.EventSystems.TouchInputModule:ProcessTouchEvents()
    47. UnityEngine.EventSystems.TouchInputModule:Process()
    48. UnityEngine.EventSystems.EventSystem:Update()
    49. (Filename: /Users/userName/git/GAMENAME/Assets/Sentient Bytes/Perlib/Source/Perlib.cs Line: 162)
    50.  
    It looks like Perlib can't access the filesystem correctly. Is there some setting in unity (or Xcode) that I should chage to get this working?
     
  35. wrstscrnnm6

    wrstscrnnm6

    Joined:
    Jan 31, 2011
    Posts:
    20
    So I think the issue was the "directory separator bug" that was fixed in 1.0.3 I had not updated it yet.
     
  36. wrstscrnnm6

    wrstscrnnm6

    Joined:
    Jan 31, 2011
    Posts:
    20
    @KayaOrsan With the refactor, What is the right way to delete keys? In the earlier version is looked like this:
    Code (CSharp):
    1. libName.DeleteKey("keyname");
    But the Delete method is gone now, and after looking around the source, I can't seem to find the new way to do it.
    -Thanks
     
  37. kscarlett

    kscarlett

    Joined:
    Jan 5, 2015
    Posts:
    3
    Hey,
    I just finished implementing perlib in my game and when I started the game in Unity 5 (latest update), Unity seemed to compile some scripts and then the Perlib window (thank you for purchasing) popped up. When I clicked the window to close it, the window went blank and the console displays multiple instances of "UnityException: You are not allowed to call this function while declaring a variable. Move it to the line after without a variable declaration."
    This completely freezes Unity and throws the error again whenever I click anywhere in that window.
     
  38. Meltdown

    Meltdown

    Joined:
    Oct 13, 2010
    Posts:
    5,796
    Does it support Windows Store Apps and Windows Phone?
     
  39. Meltdown

    Meltdown

    Joined:
    Oct 13, 2010
    Posts:
    5,796
    Seems like this asset is no longer supported. (The last response to someone by the author to this thread was on 24 August).

    Don't waste your money people.
     
  40. Duffer123

    Duffer123

    Joined:
    May 24, 2015
    Posts:
    1,215
    @bioert,

    Does this asset allow load / save of list of a custom class?

    What about a list of class x which itself contains one or more collections?

    What about dictionaries?
     
  41. Duffer123

    Duffer123

    Joined:
    May 24, 2015
    Posts:
    1,215
    @KayaOrsan,

    Sorry - think my question above for you?
     
  42. Duffer123

    Duffer123

    Joined:
    May 24, 2015
    Posts:
    1,215
    @KayaOrsan,

    High, just came across this asset. . How much can it serialize and what are the limits and exceptions?

    More particularly, can it serialize all unity engine types as well as standard types?, things like say sprite, texture, mesh, audio clip, animation clip?

    Can it serialize custom classes? Containing collections? . Containing lists within lists?
     
  43. sathya

    sathya

    Joined:
    Jul 30, 2012
    Posts:
    279
    Code (CSharp):
    1.  
    2. [Serializable]
    3. public class Normal
    4. {
    5.     public GameObject startPoint;
    6.     public GameObject endPoint;
    7.     public float bestTime;
    8. }
    9.  
    10. [Serializable]
    11. public class QuestData
    12. {
    13.     public string questName;
    14.     public QuestType questType;
    15.     public Normal normal;
    16. }
    17.  
    18. public class Quest : MonoBehaviour
    19. {
    20.     public QuestData questData;
    21.  
    22.     void Awake()
    23.     {
    24.         Perlib savefile = new Perlib("MyAwesomeGame.sav", "csDKndc30ns");
    25.         savefile.SetValue(questName, questData);
    26.         savefile.Save();
    27.     }
    28. }
    29.  
    I get the following error
    InvalidOperationException: To be XML serializable, types which inherit from IEnumerable must have an implementation of Add(System.Object) at all levels of their inheritance hierarchy. UnityEngine.Transform does not implement Add(System.Object).

    Cant save above QuestData when it has another Serializable object inside. I have many such objects that has to be saved. How to do that.
     
  44. KyleFN

    KyleFN

    Joined:
    Aug 11, 2015
    Posts:
    1
    Hey there KayaOrsan ... I was looking through my download manager and I was about to download this package but I see it listed as "deprecated". It seems like I can't download it anymore, what's going on here?
     
  45. sathya

    sathya

    Joined:
    Jul 30, 2012
    Posts:
    279
    Asset is deprecated and you can not download it anymore. I too lost my money without even using it properly.
     
  46. electroflame

    electroflame

    Joined:
    May 7, 2014
    Posts:
    177
    Not only is it deprecated, but the publisher name has been changed to "Unity Sucks" and the publisher website and support link have both been changed to point to "unrealengine.com".

    That seems pretty drastic, not to mention fairly malicious towards the users (like myself) that bought this. Deprecated packages are getting more and more common, but this seems to go beyond normal deprecation.
     
  47. Ruekaka

    Ruekaka

    Joined:
    Sep 12, 2014
    Posts:
    119
    That's not completely true. Even if it deprecated you can still download your asset from the download manager.
    (see attached image, looks a bit different when opening from Unity, but I tested it, download still works)

    Nevertheless it really sucks if items get deprecated without giving any reason.
     

    Attached Files: