Search Unity

Game Data Editor: The Visual Data Editor [Released]

Discussion in 'Assets and Asset Store' started by Celestipoo, Jun 6, 2014.

  1. Celestipoo

    Celestipoo

    Joined:
    Jul 1, 2013
    Posts:
    379
    That would create a circular dependency. You don't want to do that. Imagine, you load Ice, which loads Fire. Fire loads Ice, and Ice loads Fire, and on, and on, and on, until the whole system runs out of memory :)

    You could do one of two things:

    1) Instead of linking the opposing Element inside the Element schema, you can create a string field that will holds the key of the opposing element. So inside Ice Element, there would be a string opposing field, and set that to the key of the Fire element. That way you know what's opposing, but that Fire element won't get loaded. But you can load the Fire element later with that key, if you needed to. Like this:

    Element: Ice
    string opposing (This would be set to the Fire key)​

    2) Create a third schema that contains the two opposing Elements, call that schema "ElementPair" like this:

    ElementPair:
    Element element1 (This would be set to Ice)
    Element element2 (This would be set to Fire)​

    Elements that appear in the same ElementPair are opposing. Then in your Spell schema, you would have a list of ElementPairs, instead of elements. You can assume that ElementPair.element1 is the active Element in the spell. Any elements in ElementPair.element2 are there just for convenience (to know that is the opposing element).

    With this method, note that you would need to create an Ice Element Pair:
    ElementPair: Ice
    Element element1 (This would be set to Ice)
    Element element2 (This would be set to Fire)​

    And a Fire Element Pair:
    ElementPair: Fire
    Element element1 (This would be set to Fire)
    Element element2 (This would be set to Ice)​

    And your Spell schema would look like this:

    Spell
    List<ElementPair> elements
    [0] This could be set to Ice ElementPair
    [1] This could be set to Wind ElementPair
    etc.​
     
  2. Duffer123

    Duffer123

    Joined:
    May 24, 2015
    Posts:
    1,216
    @Celestipoo ,

    Thanks - I have gone with option 1... ;)

    Sorry - went and added some ideas for enhancements in last thread after the original posting.
     
  3. Celestipoo

    Celestipoo

    Joined:
    Jul 1, 2013
    Posts:
    379
    There's a search at the top. Why not type in the full name of the schema you want to display?

    Yes. Item order has been requested. I haven't been able to get to that feature yet. The easiest way to order your items is to export to a spreadsheet and move things around. The schemas will be ordered the way they appear in the spreadsheet (from left to right). The items will be ordered the way they appear in the spreadsheet. Items in the first schema will be listed first (top to bottom), items in the second schema will show next, etc.
     
  4. Duffer123

    Duffer123

    Joined:
    May 24, 2015
    Posts:
    1,216
    Hadn't thought to use the search function... Doh! thanks again. Looking forward to item sorting stuff.... ;)
     
    Celestipoo likes this.
  5. ConjuringTheFuture

    ConjuringTheFuture

    Joined:
    Feb 19, 2014
    Posts:
    19
    Any news on this addition?

    I'm not looking for anything too fancy. More just a check box for something like manual mode. When it is checked GDE would have no interaction with player prefs and no auto saving to disk. Instead there is a single call to get the current data state as a string, just like the init from string.

    That way I could pack any GED data that changed during run time in with the data from my others system in my already existing save file format / IO op system.
     
  6. Celestipoo

    Celestipoo

    Joined:
    Jul 1, 2013
    Posts:
    379
    Ah, I see. I haven't gotten to this yet. We are currently working on GDE Online, which is a data hosting service for GDE. I'm not sure when the next update for GDE will be available. I'll know more once our work on GDE Online gets closer to completion. @stevebu56 can give a better status on GDE Online development than me.
     
  7. kbm

    kbm

    Joined:
    Aug 7, 2014
    Posts:
    84
    Hi, when I try to update my Google Spreadsheets / reimport them into Unity I get these errors:



    What is that about? I recently upgraded to Unity 5.2.1..maybe this has something to do with that? Has anyone else had these Errors? I can't update my Data and need a fix urgently..
     
  8. Celestipoo

    Celestipoo

    Joined:
    Jul 1, 2013
    Posts:
    379
    It could be Unity 5.2.1. I'll take a look now.
     
  9. Wadjey

    Wadjey

    Joined:
    Feb 4, 2015
    Posts:
    244
    Hi,
    I've sent an email to celeste [at] stayathomedevs.com but I don't received any response!
     
  10. Celestipoo

    Celestipoo

    Joined:
    Jul 1, 2013
    Posts:
    379
    Hi, sorry about that. Your messages your marked as spam. I see them now. If that happens again, reply here.
     
  11. Celestipoo

    Celestipoo

    Joined:
    Jul 1, 2013
    Posts:
    379
    I tested a clean project on Windows without any issue. Could you try clearing your GDE Import/Export settings and reauthenticate with Google, then try again?

    I'll test upgrading from an older Unity version to 5.2.1 and see if I can get the exception.
     
  12. Wadjey

    Wadjey

    Joined:
    Feb 4, 2015
    Posts:
    244
    Thanks for your quick response Celeste, are you receiving my emails now?
     
  13. Celestipoo

    Celestipoo

    Joined:
    Jul 1, 2013
    Posts:
    379
    I am, thanks :)
     
  14. kbm

    kbm

    Joined:
    Aug 7, 2014
    Posts:
    84
    Hi and thanks for your help. I already tried resetting the Import/Export Settings, reauthenticating with Google as well as completely reinstalling GDE. All to no avail. My temp workaround for now is locally importing an excel file, but I would really like to be able to use the Google Spreadsheet functionality.
     
  15. Celestipoo

    Celestipoo

    Joined:
    Jul 1, 2013
    Posts:
    379
    Are you on OSX or Windows? (Windows it sounds like)
    What version of Unity did you upgrade from?

    Have you tried restarting Unity? Have you tried reimporting your entire project?
    I'll try to reproduce the problem.
     
  16. stevebu56

    stevebu56

    Joined:
    Apr 16, 2014
    Posts:
    26
    Sounds like some features are stacking up for another GDE update. I'm the one holding that up, sorry. Currently I'm working on the hosting service GDE Online so your data can be hosted in the cloud by us & served up in game. This will allow us to do a lot more with getting & setting data at runtime and to be able to change your data and have it immediately change live systems.

    @Celestipoo pinged me for a schedule update. I probably have about 2 weeks until we will shift gears and work on the next GDE update. Stay tuned.
     
  17. kbm

    kbm

    Joined:
    Aug 7, 2014
    Posts:
    84
    I am on Windows 7 64 bit. I upgraded from Unity 5.1.
    I already restarted Unity & reimported all assets, but it didn't change anything.
     
    Celestipoo likes this.
  18. Celestipoo

    Celestipoo

    Joined:
    Jul 1, 2013
    Posts:
    379
    I found the issue. If you set your target platform to Web, you'll get this error. If you target PC/Standalone import will succeed without issue. I'll look into this, but at least you can switch your target to Standalone when you want to import from Google.

    [Edit] The issue is a bug with Google Drive API and cors (cross-origin HTTP requests). Unfortunately, it only affects new google sheets. According to a dev at google, it does not affect old google sheets or other google drive file types (sigh). GDE uses Unity's WWW class to make the request for the Google Sheet during import, so if you have Web platform active, then the Web security will kick in and this bug will show up.
     
    Last edited: Oct 13, 2015
  19. kbm

    kbm

    Joined:
    Aug 7, 2014
    Posts:
    84
    Thanks for helping me! :) I actually did NOT target Web, but somehow the Error vanished nonetheless, don't know how, really: I switched from PC/Standalone Windows x86_64 to x86 (no 64) and then back again.. somehow the Error didn't trigger anymore.

    Super weird! But thanks, and I hope it doesn't reoccur..
     
    Celestipoo likes this.
  20. Celestipoo

    Celestipoo

    Joined:
    Jul 1, 2013
    Posts:
    379
    Unity always gets in a funky state when upgrading. I'm happy the platform switch sorted it out. My guess is the switch caused a recompile of WWW that fixed the issue. No matter, happy day! :)
     
  21. puzzlekings

    puzzlekings

    Joined:
    Sep 6, 2012
    Posts:
    404
    Hi

    I'm having problems importing from Excel while following the docs which are quite confusing :(

    After import I have a gde_data file and I am trying to read the file with the following:

    GDEHotspotsDataHotspotData;

    if (!GDEDataManager.Init("gde_data"))
    Debug.LogError("Error initializing gde_data");
    else
    {
    if(!GDEDataManager.DataDictionary.TryGetCustom(GDEItemKeys.Hotspots_1, outHotspotData))
    Debug.LogError("Could not get stringHotspotData");
    else
    {
    Debug.Log ("Heading = " + HotspotData.Hotspot_Heading);
    }

    The problem is that the HotspotData.Hotspot_Heading seems to come out as an empty string, despite no errors and the data being inside the gde_data.txt file.

    Do you have any idea what's going on or could you point me in the right direction?

    thanks

    Nalin
     
  22. Celestipoo

    Celestipoo

    Joined:
    Jul 1, 2013
    Posts:
    379
    Can you show me your data item in the GDE Item Editor? Also, the item in your spreadsheet as well?
     
  23. puzzlekings

    puzzlekings

    Joined:
    Sep 6, 2012
    Posts:
    404
    Hi

    I have attached a screenshot of both.

    Any help much appreciated :)

    cheers

    Nalin
     

    Attached Files:

  24. Celestipoo

    Celestipoo

    Joined:
    Jul 1, 2013
    Posts:
    379
    And your data file is in Resources and is named "gde_data.txt"?
     
  25. puzzlekings

    puzzlekings

    Joined:
    Sep 6, 2012
    Posts:
    404
    yes

    I tried importing into a brand new empty project and got the same results. No data.

    Unity 5.2.0
     
  26. Celestipoo

    Celestipoo

    Joined:
    Jul 1, 2013
    Posts:
    379
    Could you email me an export of your empty project and I'll take a look? celeste@stayathomedevs.com
     
  27. puzzlekings

    puzzlekings

    Joined:
    Sep 6, 2012
    Posts:
    404
    ok will do

    cheers

    Nalin
     
  28. Celestipoo

    Celestipoo

    Joined:
    Jul 1, 2013
    Posts:
    379
  29. ajifsk

    ajifsk

    Joined:
    Dec 22, 2013
    Posts:
    2
    Hi,

    I can't use the Object field on the item editor, it will go back to null/none after I press play button or generate data class.....

    Thanks
     
  30. Celestipoo

    Celestipoo

    Joined:
    Jul 1, 2013
    Posts:
    379
    Hi, sorry about that. There's a bug in v2.5 when loading Unity types from subdirectories inside Resources (on Windows). Apply this patch, and it should fix the issue for you. Let me know if you need anything else.
     
  31. peterkungen

    peterkungen

    Joined:
    Feb 5, 2015
    Posts:
    18
    Hi, just bought it and have I miss understood this? I can't import excel during runtime in an interface I build?
     
  32. Celestipoo

    Celestipoo

    Joined:
    Jul 1, 2013
    Posts:
    379
    No. Excel import is a prebuild step that is done from the Unity Editor.

    We are building a micro service that will provide a full backend to host your GDE data. That should come online in the next couple of months.
     
  33. MattyMatt

    MattyMatt

    Joined:
    Oct 7, 2011
    Posts:
    21
    I have a pretty extensive random loot/inventory/crafting system setup using GDE as my data system using Google Sheets. However, I think I am missing something simple: I have a part of my system setup as such:
    Scheme: LootItem
    Scheme: LootValue
    Scheme LootInventory
    List: LootItem defaults to nothing
    List: LootValue default to nothing

    So I have a single LootInventory Item Type: Loot_Inventory that I want to use to add a Item and Value to duriong runtime. Right now I use: the set_item and set_value after I assign the data using the correct logic. I even verify during runtime that I am adding to the list correctly. However, this is not reflected in the actual GDE item editor when I look after gameplay.... In other words, can I not "save" data to a Item? I need to use this data in my crafting scene. which I plan on loading from my data file.
     
  34. Celestipoo

    Celestipoo

    Joined:
    Jul 1, 2013
    Posts:
    379
    Any data saved during runtime is saved to PlayerPrefs, not back to the data file. I do have a patch that I made for someone that allows for writing back to the data file during runtime, but only when in Play mode in the Unity Editor. This wouldn't work in a build on a device. I can send you the patch in a DM if you're interested.
     
  35. MattyMatt

    MattyMatt

    Joined:
    Oct 7, 2011
    Posts:
    21
    So I use GDE to arrange all of my defaults, item baselines etc at which point everyting is saved to PlayerPrefs. So when GDE is Init you are setting all GDE data to PlayerPrefs as well. Then any data modifications even those using the GDE functions are also being set and modified in playerPrefs? Is this a correct assumption? If so I would just need to use playerprefs to read the LootInventory list items in another scene?
     
  36. Celestipoo

    Celestipoo

    Joined:
    Jul 1, 2013
    Posts:
    379
    Think of the data file as your defaults. This is the data that will be loaded when no modifications have been saved before (i.e. the first time your game is played). When any item is loaded, GDE will load the defaults, and override values from PlayerPrefs automatically. Your game logic doesn't need to worry about that. The most recent version of your items will be loaded. If you want to reset an item (or particular field), you can do that with the Reset methods.

    All your scenes will load the modified LootInventory list items. There is nothing extra you need to do.
     
  37. MattyMatt

    MattyMatt

    Joined:
    Oct 7, 2011
    Posts:
    21
    Ok great. Is there any 3rd part player prefs api you guys might endorse for saving and loading? (other than default player prefs )
    BTW: Awesome work! Look forward to the service I have heard about and some other things... Let me know if you guys need any "testing" .
     
    Celestipoo likes this.
  38. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    413
    Any way to make each instance value unique?

    I'm using a similar setup in your Shop example, but made a simple example here to illustrate.
    *I have what I need now working, so I guess this is a feature request mostly

    every time you use TryGetCustom the value is the last saved that was changed on any instance.
    The way i'm getting around this is cache all items on startup (however you have to reset then set correct values).

    as you see Item1_intTest is what is used to save to playerpref.
    notice in the example when you get player3 the value is 3 because it was changed in player2

    so as you can see changed data will not be saved or loaded correctly.

    like in you shop example, shops with the same "stock" would not have a unique num_available so if you change it in one shop, next time you start all shops will use that value.

    The fix I suggest is how you create the playerpref key...
    <root><listindex><schema><name>
    so for my example each value saved/loaded from playerpref would be:
    Player1_0_Item1_intTest
    Player2_0_Item1_intTest
    Player2_0_Item1_intTest

     
  39. Celestipoo

    Celestipoo

    Joined:
    Jul 1, 2013
    Posts:
    379
    This will be resolved with runtime cloning. I have a change that will allow for you to clone any item, either a shallow clone (only clones basic types, does not clone custom types) or a deep clone (clones all fields and custom fields all the way down the chain).

    In your case, you could deep clone a player which would make copies of all the fields and types. When you went to modify that list item, it would be independent of the list item in the other player items. I can DM you a beta of this feature if you like.
     
  40. Celestipoo

    Celestipoo

    Joined:
    Jul 1, 2013
    Posts:
    379
    I don't officially support any third party playerpref replacements. There are a couple scripts you'd need to change in the GDE API directory. You can do a search for PlayerPrefs and replace all those calls with the equivalent call to the package you want to use.

    I've also seen some packages say you can switch by a using statement like:
    Code (csharp):
    1. using PlayerPrefs = PlayerPrefsPro;
    in any scripts that access PlayerPrefs. I can't remember which one though :/
     
  41. Celestipoo

    Celestipoo

    Joined:
    Jul 1, 2013
    Posts:
    379
    Thanks :) We will need beta users soon. I'll ping you when we're ready.
     
  42. cavila

    cavila

    Joined:
    Jun 4, 2013
    Posts:
    67
    The last update with GameObject support is awesome. Thanks to it I was able to do away with all kinds of hacks and use GDE alone.

    Is there a reason why two items on two different schemas can't have the same name? on the surface I don't see conflicts.

    Also a suggestion: in the same vein as item keys, can schema keys be generated? I'm currently doing just that manually.
     
  43. Celestipoo

    Celestipoo

    Joined:
    Jul 1, 2013
    Posts:
    379
    Fantastic :) That would be great in a review (hint, hint) ;)

    The reason is, that's how it was designed 1+ years ago. All items must have a unique key because they all live in the same dictionary. There are parts of GDE that are due for an overhaul. I'll put it on the wish list.

    I'm not sure what you mean. Do you have that many schemas that you need to auto generate them? Tell me how you're using them and I'll see what I can do.
     
  44. cavila

    cavila

    Joined:
    Jun 4, 2013
    Posts:
    67
    It would just be nice to have compile-time errors instead of runtime bugginess. For example, I had a schema named 'Ingredients', after some time it was renamed to 'Ingredient' and things broke during runtime in a weird way (due to UniRx). It turns out I was selecting a random ingredient from the group as follows:

    GDEDataManager.GetAllDataKeysBySchema("Ingredients", out keys)

    If I have had GDESchemaNames.Ingredients the moment classes get regenerated the compiler would have told me I had an error. It's also quite nice to use the IDE to find all references to a variable (let's say GDEItemKeys.Ingredient_MilkIngredient) to know quickly where it's being used. Currently, that can't be done with schemas unless I start doing greps with regular expressions.
     
  45. Celestipoo

    Celestipoo

    Joined:
    Jul 1, 2013
    Posts:
    379
    Oooooooh! You said generate and my head was totally somewhere else. Yes, I will definitely add that.
     
    Tinjaw likes this.
  46. cavila

    cavila

    Joined:
    Jun 4, 2013
    Posts:
    67
    Awesome :)
     
    Celestipoo likes this.
  47. vamky

    vamky

    Joined:
    Aug 9, 2014
    Posts:
    70
    Hi!

    I think I come cross a bug when using gde to store game object info:

    If you create an item than contains a game object field, then drag a game object (a prefab, for example).
    Save it. Then enter play mode, exit play mode. Use item editor to load data. You will find out the data you entered before play mode is gone. I am also cannot get related item using playmaker. But if you open gee_data.txt, you can see the data is still there.

    FYI: I am using unity 5.2.2f1

    gde_error01.png

    gde_error02.png
     
  48. Celestipoo

    Celestipoo

    Joined:
    Jul 1, 2013
    Posts:
    379
    Make sure any Unity types you are linking are in a Resources directory or sub directory.
     
  49. vamky

    vamky

    Joined:
    Aug 9, 2014
    Posts:
    70
    Hi!
    That works. Thank you!
     
  50. stevebu56

    stevebu56

    Joined:
    Apr 16, 2014
    Posts:
    26
    Happy Monday to everyone. I wanted to give a quick update about GDEOnline. I just ran a stat generator for the repo of the gdeonline project which showed some interesting things. Here's the link. GDEOnline Repo Stats They are a little misleading with the amount of time the project has been around. I forked an existing project we worked on at the end of last year so that's why there is activity from Nov 2014. For this project we started around the beginning of Sept 2015.

    I'm not a huge stats person but I figured it would be interesting. It shows what times I work best and usually peak on Wednesday. Thursday & Friday is a wash :)

    On to what GDEOnline can do. A lot of users want to be able to read and save data during runtime to a spreadsheet. Back and forth to a spreadsheet is tough for a variety of reasons but back and forth to a database running in the cloud is a better solution and doable. GDEOnline does just that, you can host your dataset in the cloud so all your deployed clients can have access to it and then your clients can save their data at runtime which can then get saved in the cloud too. So functionally it will be the same as reading and writing to a spreadsheet in the cloud. But it will be secure & much faster.

    The site needs more work & some scrubbing but for now I attached a screenshot which shows the dashboard. It's where you will manage your games & datasets that are live in the cloud. Next up @Celestipoo is going to make some additions to GDE to support GDEOnline and work to make it as seamless as possible to use on the Unity side.

    I can't promise a date when things will be ready but it's coming along pretty quick. I'm excited. :) Stay tuned.

    gdeonline_screenshot.png