Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

[RELEASED] Databox - Data editor & save solution

Discussion in 'Assets and Asset Store' started by propeller, Oct 30, 2019.

  1. propeller

    propeller

    Joined:
    Jul 2, 2012
    Posts:
    230


    Every game relies on data. That's why we made Databox. A simple yet powerful data editor which allows you to manage and save all your data at one place. Use Databox for your game data, save games, game configurations, profiles, localisation...

    FEATURES
    • Intuitive data editor - Manage all your data in one place
    • Scriptable object workflow
    • Runtime editor - Edit your data directly in your builds
    • Read and save data at runtime
    • Supports all common Unity types + custom classes
    • Import from GOOGLE spreadsheet or local CSV file
    • Cloud sync - sync data to your MySQL webserver
    • XOR Encryption
    • PlayMaker support
    • Demo scenes included
    • Powered by FullSerializer and OdinSerializer
    • more


    RUNTIME EDITOR

    Databox comes with a ready to use runtime editor, which allows you to edit your data directly in your game. This is great for testing different values on the fly without the use of the Unity editor.



    IMPORT GOOGLE SPREADSHEET
    Import google spreadsheet without the hassle of complicated authentication. Simply copy the share link into Databox, enter the worksheet id and click on download.

    CLOUD
    Databox unique cloud feature allows you to setup your own cloud sync to your MySQL – Webserver database.

    EXAMPLES
    The package includes 5 detailed example scenes. One of them also demonstrates a dynamic techtree with the use of a custom data class. By changing the dependency values the techtree UI gets updated automatically.



     
    Last edited: Feb 5, 2020
  2. propeller

    propeller

    Joined:
    Jul 2, 2012
    Posts:
    230


    Databox has been nominated for the Unity Awards in the category best development tool! :)
    I feel very honored and if you want to support a small indie studio I'd be very happy if you leave a vote for it here:

    https://awards.unity.com/#best-development-tool

    Thank you so much!
     
  3. jazzplough

    jazzplough

    Joined:
    Dec 15, 2012
    Posts:
    2
    Hi there,


    Thanks for creating such a professional asset in Data box.

    Just working through using Databox. Just couldn't see anywhere in the documents that describes how you can delete an entry or table through code? Does this functionality exist or can you suggest a workaround?

    Thanks,
     
  4. jazzplough

    jazzplough

    Joined:
    Dec 15, 2012
    Posts:
    2
    ahh think I have found it!
     
  5. GigaDrone

    GigaDrone

    Joined:
    Jan 14, 2020
    Posts:
    1
    my problem is, i use a textfield for a input field where i need floats "0.1"
    but as soon as i type "1." it gets parsed as 1, so its not possible to enter a float number...
     
  6. propeller

    propeller

    Joined:
    Jul 2, 2012
    Posts:
    230
    @jazzplough
    Hi,
    sorry I didn't noticed the message here in the forum. I'm happy to hear you like Databox and that I could help you through email :)

    @GigaDrone
    Hi,
    same here. I didn't noticed your message here. Sorry for that. Your issue is fixed since the new update 1.0.4
     
  7. propeller

    propeller

    Joined:
    Jul 2, 2012
    Posts:
    230
    New Update 1.0.4 is out and available at the AssetStore.
    Always backup your project before updating!

    This update adds Odin Serializer support. It is now possible to choose between FullSerializer and OdinSerializer.

    Changelog:
    • Now support for Odin Serializer (Choose between FullSerializer and Odin Serializer)
    • Editor: Better gui float fields for all decimal values
    • CSV Importer: Less error prone csv importer
    • Editor: Unique cloud id must be filled out
    • Bugfix: Fixed Vector4 w value
     
  8. propeller

    propeller

    Joined:
    Jul 2, 2012
    Posts:
    230
    New Update 1.0.5 is out and available.

    This update introduces Databox - PlayMaker integration and the new int and float types with modifiers.
    When using the modifiable int and float type you can add additional modifiers to the base value. When getting a value it will be modified by the modifiers which are enabled.

    Changelog
    • New: PlayMaker integration
    • New: Modifiable int and float type
     
  9. APSchmidt

    APSchmidt

    Joined:
    Aug 8, 2016
    Posts:
    3,823
    The link to the Assets Store in post #1 is broken.
     
  10. propeller

    propeller

    Joined:
    Jul 2, 2012
    Posts:
    230
    hm that's weird. It's working for me.... maybe the shortlink doesn't work. I changed it to the normal link. Thanks for mentioning :)
     
  11. APSchmidt

    APSchmidt

    Joined:
    Aug 8, 2016
    Posts:
    3,823
    It's working now. :) Short links can be moody sometimes.
     
  12. Talis_Renston

    Talis_Renston

    Joined:
    Oct 24, 2016
    Posts:
    18
    Hey, nice work on the asset! I got two question, though:
    1. Is there an easier way to set a value? I can of course load my data using databox.GetData<>(); and then set the referenced object, but is there some way to set it directly, something like databox.SetData()? i could not find anything.
    2. Is there a way of checking if a certain entry already exists? I did not find a way to check (maybe I did not find it)
    Other than that, I really enjoy your asset, it is really worth it.
    Sincerly
     
  13. propeller

    propeller

    Joined:
    Jul 2, 2012
    Posts:
    230
    Happy to hear you like Databox! :)

    Currently there's no direct functionality to set data like this. Same for checking if an entry already exists.
    I will add these asap. Thanks for the feedback!

    Cheers!
     
  14. Talis_Renston

    Talis_Renston

    Joined:
    Oct 24, 2016
    Posts:
    18
    Thank you :)

    Another thing I noticed when using Databox is that when selecting a DataboxObject in the Project-view, I cant open a separate window beacuse the popup icon is too far to the right (this is probably my fault, cause I keep my inspectors rather small). Is there another way to open a separate window for the object? Right now I have to widen the inspector a lot to then press the popup button to get another window, which is kinda annoying.

    Databox.PNG
     
  15. propeller

    propeller

    Joined:
    Jul 2, 2012
    Posts:
    230
    Ah I see... hmm how about if I add the possibility to double click on a DataboxObject file to open it in a new window?
     
  16. Talis_Renston

    Talis_Renston

    Joined:
    Oct 24, 2016
    Posts:
    18
    That would be amazing!
     
  17. _dandroid

    _dandroid

    Joined:
    Feb 1, 2016
    Posts:
    10
    Getting the error below at line 47 every time I try to import any data from a Google Spreadsheet or Local CSV. Any clues? It's a very simple file that I created just to test with a key and a StringType "name". I'm using DB_FIELD_NAMES and DB_FIELD_TYPES just like the documentation shows.

    NullReferenceException: Object reference not set to an instance of an object
    DataboxCSVConverter.ConvertCSV (System.String _input, System.Collections.Generic.List`1[DataboxCSVConverter+Entry]& entries) (at Assets/Databox/Core/CSV/DataboxCSVConverter.cs:47)
    DataboxGoogleSheetDownloader+<DownloadIE>d__9.MoveNext () (at Assets/Databox/Core/CSV/DataboxGoogleSheetDownloader.cs:78)
    Databox.Utils.EditorCoroutines.Update () (at Assets/Databox/Core/Utils/EditorCoroutines.cs:36)
    System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <437ba245d8404784b9fbab9b439ac908>:0)
    Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <437ba245d8404784b9fbab9b439ac908>:0)
    System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <437ba245d8404784b9fbab9b439ac908>:0)
    System.Delegate.DynamicInvokeImpl (System.Object[] args) (at <437ba245d8404784b9fbab9b439ac908>:0)
    System.MulticastDelegate.DynamicInvokeImpl (System.Object[] args) (at <437ba245d8404784b9fbab9b439ac908>:0)
    System.Delegate.DynamicInvoke (System.Object[] args) (at <437ba245d8404784b9fbab9b439ac908>:0)
    UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at /Users/builduser/buildslave/unity/build/Editor/Mono/EditorApplication.cs:310)
     
  18. Talis_Renston

    Talis_Renston

    Joined:
    Oct 24, 2016
    Posts:
    18
    I just downloaded the update and I am very thankful that you integrated my ideas. Thank you very much!
    _dandroid could you post your CSV file (or a picture of your google spreadsheet)? Maybe that would ease helping a bit.
     
  19. propeller

    propeller

    Joined:
    Jul 2, 2012
    Posts:
    230
    Ah yes forgot to notice you about the update! :)

    @_dandroid As Talis_Renston said, It be great if you could share the CSV file with me. You can of course also write me an email. Also make sure the key names are correct in your Google sheet file (check for empty spaces and such).
     
  20. _dandroid

    _dandroid

    Joined:
    Feb 1, 2016
    Posts:
    10
    So, I've tried many different variations of files and get the same error every time. I get the same error even when recreating the table in the documentation, as seen in one of the attachments. The other attachment is what I would consider the bare-minimum to function, according to my understanding of the documentation, and I still receive the error. Is anyone else able to get this working?

    CSV Documentation Test.png very simple csv.png
     
  21. Talis_Renston

    Talis_Renston

    Joined:
    Oct 24, 2016
    Posts:
    18
    I tried it on my own and got the same error. Anyway, the UI shows "DOWNLOADED SUCCESSFULLY". Seems like an internal error. I dont have time right now, but if @propeller doesnt respond faster, I will have a look at it tomorrow.
     

    Attached Files:

  22. propeller

    propeller

    Joined:
    Jul 2, 2012
    Posts:
    230
    @_dandroid @Talis_Renston I have fixed the issue! If you send me an email with your invoice number I can quickly send you the hotfix. :)
     
  23. SocialFreak

    SocialFreak

    Joined:
    Dec 12, 2015
    Posts:
    33
    I am running the most recent version of Databox and creating an Android application with Unity 2019.3.7f1. When I run the application in the Unity Editor everything works fine, however, when I build the application, as soon as I run the ExtractData method below I get a "NullReferenceException: Object reference not set to an instance of an object" error. I am using a TRY trap and that ends up in the NullReferenceException catch.

    I specify the DataboxObject in the script and have the actual Databox dropped into the inspector for the script. Am I supposed to do anything else to include the database in the build? I have the config set to Streaming Asset and the JSON copy is in the StreamingAssets folder.



    public DataboxObject data;

    void Start() {
    MakeDefaults.Set();
    this.DrawTable();

    LoadDatabase();
    }

    public void LoadDatabase()
    {
    data.LoadDatabase();
    }

    public void ExtractData(int i) {
    try {
    Debug.Log("ExtractData - i: " + i + " Name: " + data.GetData<StringType>("GTSITES", i.ToString(), "LOCATION_NAME").Value);
    }
    catch (NullReferenceException ex) {
    Debug.Log("GetData Exception");
    }
    }
     
  24. propeller

    propeller

    Joined:
    Jul 2, 2012
    Posts:
    230
    Hi,

    According to the official Unity documentation:
    It is not directly possible to access the StreamingAssets folder on WebGL and Android platforms.
    https://docs.unity3d.com/ScriptReference/Application-streamingAssetsPath.html

    We have to use the Unity Web request to load the file. Also note that you can't save to a StreamingAssets folder on Android. So therefore it's a bit more tricky.
    So before you access the data hook up the OnDatabaseLoaded event in your OnEnable method, so we can be sure the data has been loaded.
    Something like this:

    Code (CSharp):
    1. void OnEnable()
    2. {
    3.     data.OnDatabaseLoaded += OnLoaded;
    4. }
    5.  
    6. public void Load()
    7. {
    8.     data.LoadDatabase();
    9. }
    10.  
    11. public void OnLoaded()  
    12. {
    13. // Get your data
    14. }
    If you still have any issues you can write me an email: mail [AT] doorfortyfour.com

    Cheers!
     
    tik_tikkers likes this.
  25. MrIconic

    MrIconic

    Joined:
    Apr 5, 2013
    Posts:
    214
    A few questions

    1. If Databox saves itself as JSON is there a way to get the raw JSON? The .asset file doesn't seem to be it.
    2. Is it possible to embed dictionaries with custom classes? Ex. Dictionary<String, Dictionary<String,String>
     
  26. propeller

    propeller

    Joined:
    Jul 2, 2012
    Posts:
    230
    @MrIconic
    1. Not sure what you mean by raw JSON. The asset file loads and saves it's data to an external file. The format can be Json or Binary. You specify the save path and name of the file in the .asset file configuration.
    2. Yes this is possible although you will have to create a custom type and also create a custom "editor" to display the values. Databox comes with a Dictionary<string, string> type as an example. This would be a good starting point for your own custom type.
     
  27. MrIconic

    MrIconic

    Joined:
    Apr 5, 2013
    Posts:
    214
    When I opened the .asset file yesterday it didn't appear to be JSON of the database entries etc. but instead configuration of the table (such as encryption code etc.). However, thinking about it- that might've been my text editor not showing everything. I'll have to check again late today in a different program.
    Works, thanks. Had to use the "Save Path" file instead of the actual Databox .asset.

    Offtopic: I also see that you updated tileworldcreator. I'll have to check that out too~ looks like a good asset.

    EDIT: Is there any difference between serialization with FullSerializer vs. Odin?
     
    Last edited: May 7, 2020
  28. propeller

    propeller

    Joined:
    Jul 2, 2012
    Posts:
    230
    Great! Glad to hear you figure it out! :)

    Here's a chart comparing both serializer systems:
    https://github.com/TeamSirenix/odin-serializer#serialization-of-a-simple-object-with-no-polymorphism
    In the end it's a matter of taste... Odin is the fastest and can also serialize to binary, FullSerializer creates a nicely readable JSON format without much clutter.
     
  29. icd_agency

    icd_agency

    Joined:
    Aug 15, 2019
    Posts:
    1
    @propeller

    First of all, thank you for amazing tool.

    We have developed an WebGL application and have found that Databox not working correctly with streaming assets.

    We fixed it on our own in your source code in DataObject.cs file by following lines
    Code (CSharp):
    1.  
    2. if (selectedApplicationPath < 2 && Application.isEditor && (Application.platform != RuntimePlatform.Android || Application.platform != RuntimePlatform.WebGLPlayer))
    3. {
    4. ...
    5. }
    We put it in several places and all work great. Can you please fix it on your side. If you want, we can send modified files.

    Thank you!
     
  30. propeller

    propeller

    Joined:
    Jul 2, 2012
    Posts:
    230
    Hey that's great! Thank you for letting me know! It'd be great if you could send me the modified files so I can check them.
     
  31. marshmatter

    marshmatter

    Joined:
    Oct 2, 2013
    Posts:
    43
    I fixed a minor bug where custom data types could not be added if they were inside a namespace by using the FullName of the type rather than just the Name.

    Having the FullName as the displayed name is a matter of personal preference, but I make extensive use of namespaces so it's definitely welcome.

    In DataboxEditor.cs:

    Code (CSharp):
    1. public static void GetDataTypes(out List<string> _allTypes, out List<string> _typeNames)
    2.         {
    3.             System.Type[] _types = System.Reflection.Assembly.GetExecutingAssembly().GetTypes();
    4.             System.Type[] _found = (from System.Type type in _types where type.IsSubclassOf(typeof(DataboxType)) select type).ToArray();
    5.          
    6.             _allTypes = new List<string>();
    7.             _typeNames = new List<string>();
    8.          
    9.             for (int i = 0; i < _found.Length; i++)
    10.             {
    11.                 var _attribute = _found[i].GetCustomAttributes(typeof(DataboxTypeAttribute), false);
    12.                 if (_attribute.Length > 0)
    13.                 {
    14.                     var _targetAttribute = _attribute.First() as DataboxTypeAttribute;  
    15.                     _typeNames.Add(_targetAttribute.Name);
    16.                 }
    17.                 else
    18.                 {
    19.                     _typeNames.Add(_found[i].FullName.ToString());
    20.                 }
    21.              
    22.                 _allTypes.Add(_found[i].FullName.ToString());
    23.             }
    24.  
    25.         }
     
  32. propeller

    propeller

    Joined:
    Jul 2, 2012
    Posts:
    230
    Good catch! Thanks for sharing, I'll change it! :)
     
  33. cyberlmq

    cyberlmq

    Joined:
    Jun 16, 2020
    Posts:
    1
    Hi All! I am actually very new to Unity here and would like so help, apologies in advance if my question is obvious.

    1.) I would like to know if I can store and retrieve images for this database?
    2.) I understand that it shows that we can modify at runtime, does it means I can store and save the data while the game is running with codes?
    3.) I also understand that it can connect with MySQL database, does that means whichever charged here in Databox, it will reflect MySQL database too?
    4.) Is this a solution if I need to store data for a multiplayer online game with a huge amount of players' data?

    Again sorry if my questions are all listed in the documentation and I am really keen on getting this asset. :)
     
  34. PanthenEye

    PanthenEye

    Joined:
    Oct 14, 2013
    Posts:
    78
    Is this WebGL/Android compatible?

    P.S. Tons of warnings when importing in the latest 2019.4
     
    Last edited: Jun 24, 2020
  35. propeller

    propeller

    Joined:
    Jul 2, 2012
    Posts:
    230
    Yes it is compatible with WebGL and Android.
    Sorry for the obsolete warning messages. They all come from the Odin serializer but don't affect the functionality of Databox. I will fix them by the next update.
     
  36. propeller

    propeller

    Joined:
    Jul 2, 2012
    Posts:
    230
    @PanthenEye New patch is now available which fixes the obsolete warning messages! :)
     
  37. SocialFreak

    SocialFreak

    Joined:
    Dec 12, 2015
    Posts:
    33
    Just did an update of Databox and got the errors below. I'm using 219.4.1f1 and previous ver was working fine.

    Assets\Databox\Core\Utils\GUIFloatField.cs(72,20): error CS0121: The call is ambiguous between the following methods or properties: 'GUIFloatField.ForceParse(string)' and 'GUIIntField.ForceParse(string)'

    Assets\Databox\Core\Utils\GUIIntField.cs(42,26): error CS0103: The name 'activeFloatFieldString' does not exist in the current context

    Assets\Databox\Core\Utils\GUIIntField.cs(64,20): error CS0103: The name 'floatFieldID' does not exist in the current context

    Assets\Databox\Core\Utils\GUIIntField.cs(72,20): error CS0121: The call is ambiguous between the following methods or properties: 'GUIFloatField.ForceParse(string)' and 'GUIIntField.ForceParse(string)'

    Assets\Databox\Core\Utils\GUIIntField.cs(89,11): error CS0103: The name 'FloatField' does not exist in the current context
     
  38. propeller

    propeller

    Joined:
    Jul 2, 2012
    Posts:
    230
    @SocialFreak
    Sorry for the inconvenience. I've sent you the fixed script by mail.
    New patch should be available very soon at the asset store.
     
  39. PEMMC

    PEMMC

    Joined:
    Jan 22, 2019
    Posts:
    4
    ===

    For ANDROID, it worked well ...
    I believe it works well for IOS:

    // I got this one too, using the databox initially in the Resources folder
    // 1) Create the databox of the initial .json file in the Resources folder
    // 2) After the .json file is created and saved ... Change the databox setting to <persistentDataPath>
    // 3) Now manage the application (BUILD)
    // --- Call the function below in your OnEnable () event
    void GetResources ()
    {

    if (File.Exists (Path.Combine (Application.persistentDataPath, "Data.json")))
    {
    Debug.Log ("DATA PATH - File has already been created successfully !!!");

    }
    else
    {
    // From Resources folder: ("Data" -> file name without extension
    var jsonString = Resources.Load <TextAsset> ("Data");
    File.WriteAllText (Path.Combine (Application.persistentDataPath, "Data.json"), jsonString.text);

    }
    }
     
  40. PEMMC

    PEMMC

    Joined:
    Jan 22, 2019
    Posts:
    4

    http://databox.doorfortyfour.com/documentation/databox/save and load on android
     
  41. quincyHuang

    quincyHuang

    Joined:
    May 30, 2013
    Posts:
    9
    Does the new version support 2020.1? planing to buy it
     
    dannyalgorithmic likes this.
  42. dannyalgorithmic

    dannyalgorithmic

    Joined:
    Jul 22, 2018
    Posts:
    51
    Such a sexy solution, great work, man!
     
  43. dannyalgorithmic

    dannyalgorithmic

    Joined:
    Jul 22, 2018
    Posts:
    51

    This is a good question. :)
     
  44. SocialFreak

    SocialFreak

    Joined:
    Dec 12, 2015
    Posts:
    33
    Using AddData to grab selected records from one db and add to another but I need to figure out how many records are in the second db so I can set the _entryID. How can I get the number of records from a db during runtime and as I add records will this number increase or do I need to do a SaveDatabase after each add?
     
  45. adamlegg

    adamlegg

    Joined:
    Jan 22, 2019
    Posts:
    1
    I Am just starting to integrate this into my game. Is it possible to use Odin inspector to draw the types?? I noticed it uses Odin serialization and i have Odin. So is there a way i could use it??
    Thanks
     
  46. Feldruebe

    Feldruebe

    Joined:
    Jun 11, 2015
    Posts:
    2
    Hi,

    In the current Version you cannot use the resource option under config to save your data.
    The problem is that Application.dataPath is used in a task (DataBoxObject line 1354). That throws an exception because it can only be used from the unity main thread. Same should apply to the calls to Application.persistentDataPath.

    And i think after saving the data there is a missing AssetDatabase.Refresh().
     
    Last edited: Sep 11, 2020
  47. Wyntersoft

    Wyntersoft

    Joined:
    Jul 29, 2020
    Posts:
    2
    Hi, adding this to an existing project causes Unit tests to fail to compile via the command line
    (-runTests -testPlatform editmode -batchmode -nographics)
    `Assets/Databox/Core/Serializers/OdinSerializer/Utilities/Misc/EmitUtilities.cs(20,8): error CS1029: #error: 'Odin Inspector is incapable of compiling source code against the .NET Standard 2.0 API surface. You can change the API Compatibility Level in the Player settings.'`
     
  48. Freznosis

    Freznosis

    Joined:
    Jul 16, 2014
    Posts:
    280
    Is this asset abandoned? Author doesn't seem to reply.
     
    Barritico likes this.
  49. HypnotistDK

    HypnotistDK

    Joined:
    Feb 14, 2016
    Posts:
    8
    I think you have to change to .net 4.0 in unity player settings
     
    Doblin likes this.
  50. tik_tikkers

    tik_tikkers

    Joined:
    Jan 5, 2018
    Posts:
    28
    I am confused by the need to follow the instructions in Save and load on Android. I have a DataboxObject that is configured as a Streaming Asset Path. I used the following code to load the database in a SO:

    Code (CSharp):
    1. public class SpreadsheetData : ScriptableObject
    2. {
    3.     [SerializeField] private DataboxObject databoxObject = null;      
    4.  
    5.     private void Awake()
    6.     {
    7.         databoxObject.LoadDatabase();
    8.     }
    9. }
    Now I can use the DataboxObject to get information without the need to copy the DataboxObject to the persistant data folder.
     
unityunity