Search Unity

Public Open Source Save/Loading Parser.

Discussion in 'General Discussion' started by N1warhead, Jun 3, 2017.

  1. N1warhead

    N1warhead

    Joined:
    Mar 12, 2014
    Posts:
    3,884
    EDIT: FIXED LICENSE TO MIT FOR ANYONE SEEING LICENSE ISSUES BELOW IN THE COMMENTS.

    Hello there, I am making my saving/loading system called UniSave open source as I've done everything I needed with it for my purposes. Figured you'd guys love to take a shot at it to making it even better! You can pretty much kiss the whole (Serialization) stuff goodbye, it's no longer needed. With everything I make, I go for simplicity in mind for all the end users while taking care of the obnoxious stuff (You're welcome hehe).

    EDIT 1: License is under MIT.

    EDIT 2: Spoiler Video Demonstrating how to use UniSave Below
    #END EDIT. (Read Below To Learn About UniSave).

    Now what makes this any different than every other saving and loading system out there? Well, all you do is -

    1. Drag the main Save Script onto an empty game object.
    2. Drag the main Loading script onto an empty game object.
    3. Add a script to objects you want to save, done.

    The only thing that may be a drawback to some (not for me as I made it for my purpose to what I was wanting to achieve), is that any object you want to be able to load, just drag the (PREFAB) into the List on the SaveParser script - the list is called "Prefabs", that's it.

    I also added basic Triple DES Encrpytion or Plain text, which ever you prefer, didn't see a point in trying to make some super strong encryption when it could be broken into anyways.

    It also has the needed PHP Files if you want to upload player saves to a remote database.


    Now with this being said, there is a couple drawbacks.

    1. It doesn't save Private variables (Didn't need to for my purposes).
    2. It does NOT like Script References (So make sure they are private if you can) (as per #1)
    3. I didn't make it care about Rigidbody settings and other components, so it only cares about variables inside YOUR SCRIPTS (E.G. - Float, Bool, etc).
    4. Currently only works for prefabs that are instantiated (What I needed it for).
    5. As always - using Encryption - it takes up more space than pure text (For obvious reasons). Encryption is NOT required.

    Now here are some PROS

    1. When you save an object in your scene (if it was a prefab that was instantiated) it WILL - reinstantiate it, to the proper location, rotation and any and all script values for most variables.
    2. Variables it does support as of the first version (Quaternion, Vector3, Vector2, RGBA(Color), bool, int, float, double, string and GameObject & Transform References).
    3. It saves whether a gameobject is (ActiveSelf) or not (so it loads properly based on that).
    4. It saves whether a script is on or off.
    5. Completely custom written system using my own method of saving, not using crap Json or XML or Using crap Serialization Methods, I find this not only easier to read, but also requires less space.
    6. Well, completely open source! So modify to your desires and lets make this the best save system for Unity!


    From my testing, it it can save 5,000ish objects in roughly 1 to 1.5 seconds and loading is about the same speed (Testing on two devices - my 8 Core AMD and my Android Phone).


    Well, that's all folks!
    It's currently on GitHub, so lets make this a community endeavor to make this even better!

    GITHUB LINK
    https://github.com/WarheadDesignz/UnISave

    If you would like to be a Contributor let me know in here!
     
    Last edited: Mar 22, 2018
    Martin_H and Socrates like this.
  2. mysticfall

    mysticfall

    Joined:
    Aug 9, 2016
    Posts:
    649
    I'm glad to see another open source asset released. I think we really need more of them :)

    However, I'd like to ask if the choice of a license was intentional, because GPL is not an usual choice for such a library. Wouldn't it make it quite problematic, if not impossible to create a game in combination with other proprietary assets?
     
  3. QFSW

    QFSW

    Joined:
    Mar 24, 2015
    Posts:
    2,906
    Looks cool! Is it thread safe?
     
  4. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,205
    Yes, but we need more of them to be released under permissive licenses and not GPL or equivalents. With the way the GPL works you violate the license as soon as you try to put GPLed code into your project. Until the author changes the license the code is only useful for learning purposes.

    For the actual details as to why read this post by @neginfinity.

    https://forum.unity3d.com/threads/s...-believe-steam-doe.416250/page-2#post-2712586
     
    Last edited: Jun 3, 2017
    QFSW and mysticfall like this.
  5. mysticfall

    mysticfall

    Joined:
    Aug 9, 2016
    Posts:
    649
    That's why I chose APL for my own project. I used to be a proponent of GPL/LGPL, but I see no good reason to choose either of them for Unity based projects.
     
  6. N1warhead

    N1warhead

    Joined:
    Mar 12, 2014
    Posts:
    3,884
    Sorry guys, just always seen things as gpl, so figured that was the thing to use. Will try to change it here in a moment.

    @QFSW honestly, it didn't even cross my mind to do threading because of how fast it was, at least for my purposes.. big reason I've made this open source and free is because I want to encourage others to make it even better.
     
  7. N1warhead

    N1warhead

    Joined:
    Mar 12, 2014
    Posts:
    3,884
    Sorry didn't see your message sorry. As I told @QFSW I just always seen things use gnu, so figured that's what I was suppose to use, I'm not a lawyer, so what kind of license is ideal?
     
  8. N1warhead

    N1warhead

    Joined:
    Mar 12, 2014
    Posts:
    3,884
    @mysticfall @Ryiah I changed the license, it is now using Unlicensed. So it's in Public Domain... I don't care to keep any copyrights from it or anything, I want it to be as free as possible to do as you wish with it.

    Hope that's the correct kind of license to use, it seems that gives end users the most freedom.
     
  9. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,205
    Generally speaking the MIT license is very popular and attaching the required notice is trivial.

    https://opensource.org/licenses/MIT

    Many of the discussions involving the license were about copyleft but I was able to find a StackExchange thread that mentioned the Unlicense license may not be legal in some countries because they lack the concept of a public domain.

    https://softwareengineering.stackexchange.com/questions/147111/what-is-wrong-with-the-unlicense

    Additionally the Open Source Initiative mentioned in a discussion that they refuse to review the license because it was not written by a legal professional and may end up causing harm.

    https://www.slant.co/versus/3574/3575/~the-unlicense_vs_mit-license
    https://lists.opensource.org/pipermail/license-review/2012-January/001360.html
    https://lists.opensource.org/pipermail/license-review/2012-January/001381.html
    https://opensource.stackexchange.com/questions/1445/how-can-a-crayon-license-be-a-problem

    See this is why I'm happy I never became a lawyer. :p
     
    Last edited: Jun 3, 2017
    zenGarden, Martin_H and mysticfall like this.
  10. Tzan

    Tzan

    Joined:
    Apr 5, 2009
    Posts:
    736
    I'm in favor of making yet another license, that has its meaning in its name.
    Absolutely nobody has any idea what all the licenses mean without doing hours of reading from the correct resources

    So I propose the Fold Spindle Mutilate license : FSM
    Everyone already know the abbreviation and its definition defines its purpose.
    No long pages to read.
    Just do whatever you want.
     
  11. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,205
    The Finite State Machine license? Or did you mean the Flying Spaghetti Monster? :p
     
  12. Tzan

    Tzan

    Joined:
    Apr 5, 2009
    Posts:
    736
    The second one of course :)

    ... really I did mean the second one.
     
  13. mysticfall

    mysticfall

    Joined:
    Aug 9, 2016
    Posts:
    649
    I also recommend using such a license as MIT, or Apache Public License(APL) rather than making it public domain.

    Aside from the effect of promoting open source, it can prevent someone to steal your whole project and claim that he or she was the original author, for example.

    A custom license could be a problematic too, because as with the case with unlicensed mentioned by @Ryiah, there might be potential disputes or incompatibilities with other licenses, and so on.

    And you might want to read the following sites to decide which license to choose for your open source project:
     
  14. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,205
    That's what APL stood for! I was searching and kept coming up with a programming language (GNU APL). :p
     
  15. mysticfall

    mysticfall

    Joined:
    Aug 9, 2016
    Posts:
    649
    Oops, sorry I should've been clearer :)
     
  16. passerbycmc

    passerbycmc

    Joined:
    Feb 12, 2015
    Posts:
    1,741
    im giving a other vote to the MIT licenses, it is what i use on all projects i open source. It is short and to the point, and protects you from liability.

     
    Martin_H likes this.
  17. QFSW

    QFSW

    Joined:
    Mar 24, 2015
    Posts:
    2,906
    Agreed, MIT is a good license.
     
    Martin_H likes this.
  18. N1warhead

    N1warhead

    Joined:
    Mar 12, 2014
    Posts:
    3,884
    Will change to mit when I get home. Thanks guys. Have any of you tried the system yet?
     
    Martin_H likes this.
  19. N1warhead

    N1warhead

    Joined:
    Mar 12, 2014
    Posts:
    3,884
    License now updated to MIT.
    Appreciate all the advice guys.
     
    Ryiah, Martin_H and QFSW like this.
  20. N1warhead

    N1warhead

    Joined:
    Mar 12, 2014
    Posts:
    3,884
    Just posted a video into the first post showing how to use UniSave... I can't believe I didn't have a video showing how to use it, sorry guys/gals.... Hope the video explained and showed how to use it well enough.

    Can't wait too see what y'all do with this.