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

EpicPrefs - PlayerPrefs on Steroids

Discussion in 'Assets and Asset Store' started by HMTEngineering, Mar 31, 2016.

  1. HMTEngineering

    HMTEngineering

    Joined:
    Aug 8, 2015
    Posts:
    39
    Hello everyone !
    We would like to present you our newest asset : EpicPrefs !

    You can find the asset here : https://www.assetstore.unity3d.com/en/#!/content/58303



    EpicPrefs is basically a replacement for Unity's PlayerPrefs. It has alot of additional features and removes some of it flaws, like writing to the registry on Windows machines.
    Here is the full description :

    PlayerPrefs on Steroids

    EpicPrefs is the next gen PlayerPrefs.
    It supports tons of types, has a visual editor, and full encryption.

    With EpicPrefs, you can simply save any of the following types with one line of code :
    * Integer
    * Float
    * String
    * Bool
    * Double
    * Long
    * Lists of all the above
    * Dictionaries of all the above with strings as keys
    * Quaternions
    * Vector2
    * Vector3
    * Vector4
    * Color
    * Custom classes
    * AND MANY MORE!


    We streamlined our access methods with the original PlayerPrefs, but without bloating your registry!
    EpicPrefs is NOT using PlayerPrefs and is NOT storing its prefs in the registry like Unity does. It is file based and can be tweaked to your needs!
    BUT we tried to make the switch for you as simple as possible, e.g. setting a string works like so :
    EpicPrefs.SetString("Name","Value",true);
    See that third parameter ? This is an optional bool to encrypt your EpicPrefs with full AES Encryption.

    You can take a look at the Documentation for more details on the usage!
    As mentioned before, this package also includes a fully functional editor GUI to add,save,remove or modify EpicPrefs of any of the supported types.
    Plus, you can export these right into your game! Yes, you read right, you can set EpicPrefs in the Editor, and by the hit of a single button all your EpicPrefs will be exported to your built and be ready for your game to call them !

    EpicPrefs is compatible and tested on Unity 2017.1 upwards and works on mobile, console and PC!

    We hope some might find this usefull and we really hope to get some feedback on what to add because we really want to make this as complete as possible !

    You can find the asset here :
    https://www.assetstore.unity3d.com/en/#!/content/58303

    Thanks
    Hot Totem
    http://hot-totem.com


     

    Attached Files:

    Last edited: May 29, 2019
  2. HMTEngineering

    HMTEngineering

    Joined:
    Aug 8, 2015
    Posts:
    39
    Changelog :
    • Version 1.0 - 31.03.2016
      • Initial Release
    • Version 1.1 - 07.04.2016
      • Minor bug fix to remove an occasional error warning
    • Version 1.2 - 10.05.2016
      • Initialisation bugfix
      • Added support for double arrays
     
    Last edited: May 12, 2016
  3. HMTEngineering

    HMTEngineering

    Joined:
    Aug 8, 2015
    Posts:
    39
    We made a little showcase video here :


    It is a brief overview of what you can do with EpicPrefs and how you use it either by code or with the built in visual editor :) Hope you like it !
     
  4. HMTEngineering

    HMTEngineering

    Joined:
    Aug 8, 2015
    Posts:
    39
    Update 1.1 was approved, it fixes some minor bug that could happen to show an error in the editor without affecting the functionality tough.
     
  5. HMTEngineering

    HMTEngineering

    Joined:
    Aug 8, 2015
    Posts:
    39
    Version 1.2 is released now and it added support for double arrays due to a user request :)
    If you miss anything don't hesitate to ask!
     
  6. graviton

    graviton

    Joined:
    Jan 11, 2013
    Posts:
    75
    What's EpicPrefs equivalent of "PlayerPrefs.HasKey"
     
  7. HMTEngineering

    HMTEngineering

    Joined:
    Aug 8, 2015
    Posts:
    39
    Hey, sorry for the late reply! Currently there is no such function, but You can simply call the key, and check if the result is null. But this seems like a great addition and we added it to our todo, it will come in the next update :)
     
  8. HMTEngineering

    HMTEngineering

    Joined:
    Aug 8, 2015
    Posts:
    39
  9. benthroop

    benthroop

    Joined:
    Jan 5, 2007
    Posts:
    259
    Hey there... we just picked this up and appreciate your work so far. We'd love two additions before we can integrate this as a drop in replacement to PlayerPrefs

    .HasKey
    .DeleteAll usable at runtime

    Thanks!
     
  10. benthroop

    benthroop

    Joined:
    Jan 5, 2007
    Posts:
    259
    We can almost live without .HasKey, but .DeleteAll is how we reset progress in our game. Any suggestions for how to remove all keys? Is it possible to just delete the underlying file?
     
  11. HMTEngineering

    HMTEngineering

    Joined:
    Aug 8, 2015
    Posts:
    39
    Hello!
    The reason why there is no haskey is because you can always just query a key and pass a default value to it, and find out if it has the given key or not by simply checking against the default value. However, it should really be there and we will implement it in the coming version!

    As for the deleteall, there is also no real reason why it is not available at runtime, we simply didn't think about adding it, so good you asked! Please send us an email with your invoice number to support@hot-totem.com and I will send you an updated copy of EpicPrefs so you do not have to wait until the update goes live on the asset store :)
     
  12. benthroop

    benthroop

    Joined:
    Jan 5, 2007
    Posts:
    259
    Hi thanks for the updated version! We're testing it out now.

    Can you help me understand where and what the file is that EpicPrefs writes to disk? Is it a single file or multiple files? When turning encryption on, EpicPrefs generated a TON of files in is own Resources folder and I'm not sure what those are yet. Are those just used for the encryption process?

    Ultimately, we want to use this for cloud storage on Steam/Oculus stores and so understanding what files are part of the save file are important. Thanks!
     
  13. HMTEngineering

    HMTEngineering

    Joined:
    Aug 8, 2015
    Posts:
    39
    Hello,
    The Prefs themselves are stored in two seperate files, one for the encrypted prefs and one for the normal ones.

    Yes these files are for the encryption, and they are automatically added to the game. Once you set up your own encryption keys they will not change anymore. What exactly do you need to know in order to get it set up for Steam :)?
     
  14. benthroop

    benthroop

    Joined:
    Jan 5, 2007
    Posts:
    259
    Great! So, at runtime, what is the location and the name of the encrypted file? I have to imagine that there is no corresponding unencrypted file at runtime? (otherwise what's the point of encrypting?)

    Excellent news that all of those crazy files and folders will not change. I checked them into source control and crossed my fingers you'd say that. :)

    Beyond that I don't think there's much more I need to know, but I'm just getting going with this, so I'm sure more questions will follow.
     
  15. HMTEngineering

    HMTEngineering

    Joined:
    Aug 8, 2015
    Posts:
    39
    It is stored at the Applications persitent datapath, in a subfolder called HotTotem/EpicPrefsData/Encrypted
    There is no unencrypted file at runtime, correct. However, once you Get the pref , it is no longer encrypted on your side of the code but that is unavoidable as you want its content :)

    As long as you dont change the keys, they will ("should") stay as they are !

    Great, let me know if you need anything else!
     
  16. HMTEngineering

    HMTEngineering

    Joined:
    Aug 8, 2015
    Posts:
    39
    One more thing ( also for everyone else using source control and EpicPrefs ) , there is a folder outside the assets folder called HotTotem that needs to be versioned as well to guarantee a smooth experience across multiple Pcs and developers! :)
     
  17. briangraf

    briangraf

    Joined:
    Oct 28, 2016
    Posts:
    3
    Hi - I just purchased this tonight before reading the thread. I also need the DeleteAll to be usable at runtime before I will be able to switch. Is there an update on a new version?
     
  18. HMTEngineering

    HMTEngineering

    Joined:
    Aug 8, 2015
    Posts:
    39
    Hello!
    Sorry for the late reply. The latest version has a DeleteAll included, which works anywhere, runtime or editor :)

    It should be available in a couple of days at the asset store, it also brings alot of other updates and fixes !
     
  19. rezaaprian

    rezaaprian

    Joined:
    Jul 20, 2017
    Posts:
    2
    Hi there, I just bought EpicPrefs. Can you make sure the newest version of EpicPrefs is working on mobile with newest Unity?

    Everything is working well on the Editor but when I build to mobile somehow I cannot touch anything (get stuck)

    Even only adding EpicPrefs.Initialize (); or calling for example money=EpicPrefs.GetInt("PlayerMoney",true); on Awake() make the main menu scene stucked (cannot be touched)

    I tried to comment the EpicPrefs part and the menu worked as usual. Could you help me on this?
    I'm using the latest (3.5) EpicPrefs and Unity 2017.3 .0f3
     
  20. Deleted User

    Deleted User

    Guest

    Also getting issues on mobile. Created a very simple test project just to make sure it wasnt an issue with my configuration and can confirm its an issue with epicprefs.
    In my test, I had 2 UI panels with a button in each. Pressing the button in panel 1 would set panel 1 to inactive, and panel 2 to active. The button in panel 2 would do the opposite. Doing a build without epicprefs, it works fine.
    I add in an epicprefs encrypted bool called FirstTime, set to true by default. When its true and button 1 is pressed, it (should) take you to panel 2 and set FirstTime to false. However, pressing the button I get the visual indicator to show it is being pressed (the color tint on the button), but nothing happens.
     
  21. HMTEngineering

    HMTEngineering

    Joined:
    Aug 8, 2015
    Posts:
    39
    Hello,
    Have you set up the encryption keys in the settings inside Unity ?
    If the issue persists, please send us an email so we can help you better with fixing the issue :)!
     
  22. HMTEngineering

    HMTEngineering

    Joined:
    Aug 8, 2015
    Posts:
    39
    We are happy to announce that version 5 has just been released!

    The new release is a complete rewrite of the whole Asset.
    It is now much faster and much more reliable, and can be used to store even more types!
    You can even save your own classes! All in a single line of code.
    Plus, the Editor is now much easier to use so you can start adding, editing or monitoring Prefs easier and faster!

    Enjoy!
    P.s. To celebrate version 5 the asset is now 40% off for a couple of days!
     
    briangraf likes this.
  23. jbizzy129

    jbizzy129

    Joined:
    Dec 26, 2012
    Posts:
    11
    Their seems to be a problem with EpicPrefs. On Import, it states "
    Assets/HotTotemAssets/EpicPrefs/Plugins/EpicPrefs.cs(430,39): error CS1644: Feature `null propagating operator' cannot be used because it is not part of the C# 4.0 language specification"
     
  24. jbizzy129

    jbizzy129

    Joined:
    Dec 26, 2012
    Posts:
    11
    Issue resolved!! Thanks for the quick help!
     
  25. tonOnWu

    tonOnWu

    Joined:
    Jun 23, 2017
    Posts:
    83
    Hello, guys.

    I'm trying to use this on my first project. But nothing seems to work. The Editor does not show an option to create my first keys. I'm using Unity 2019.2.19f1. I'm attaching an image.

    BTW, I followed all the steps in the tutorial twice.

    Any help will be great.
     

    Attached Files:

  26. tonOnWu

    tonOnWu

    Joined:
    Jun 23, 2017
    Posts:
    83
    I updated to Unity 2019.3. It's not working either.
     
  27. HMTEngineering

    HMTEngineering

    Joined:
    Aug 8, 2015
    Posts:
    39