Announcement

Collapse
No announcement yet.

[FEATURE REQUEST] Better support for arrays in CSV DataTables

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [FEATURE REQUEST] Better support for arrays in CSV DataTables

    Now that I can edit Data Table contents directly within UE4, I can use Array types for certain cells and manually fill them out. My specific case involves a large data table which specifies all of the various parameters associated with player attacks; I have converted my "Damage" column from a single float to a float array, which lets me specify multiple damage values for each attack, which I can then pull with a "Get" node at the appropriate instance (for example, I can specify 5 values for a chargeable attack with 5 charge "tiers", and use a get node to pull the appropriate one, rather than making a special set of BP logic specifically for that attack).

    The problem is, even though this works behind-the-scenes of the engine, it isn't very user-friendly. When viewing the data table, my "Damage" column is blank, and I can only see the appropriate values by clicking on that specific row. And, of course, I have to manually manage the data table myself, since importing it no longer works as expected and causes the engine to freak out at me.

    So, my suggestions:

    (1) Add a (hacky) way to specify multiple values in a CSV which are "in the same cell", which will cause them to be interpreted as an array. By way of example, suppose that you use a "\" or "~" or some other character which flags the distinctions. So if the engine is looking for an array of floats, and it reaches the comma which designates that column, and it sees "1\15\25", it knows to interpret that as three array entries. Failing that,
    (1b) At least make the CSV, on import, identify the value in the column in question as a single-item array. So for a cell which wants an array of names, interpret a value of "HammerArm" as a one-entry array with the single entry (at Index 0) being the value "HammerArm". At least this way you can get CSVs working in a rudimentary way with arrays, even if it means that after-the-fact the user must go and change certain values to expand the "default" specified in the CSV.

    (2) PLEASE display the values from arrays in the column when viewing the Data Table asset in UE4. As I said, I have an array of floats, and it looks like this:
    Click image for larger version

Name:	DamageTables.png
Views:	1
Size:	143.2 KB
ID:	1143331

    It would be an absolute delight to see the values in that column, either (preferably) as comma or slash-separated values (i.e. Damage: 24, 48, 57), or at least just displaying the first entry of the array.

    Thanks for your consideration!

    #2
    Hi RhythmScript,

    Thank you for your request, we will take this into consideration.
    Adam Davis | Marketplace Support | Epic Games
    How to report a bug? | Installation & Setup issues? | Answerhub Bug Reports | Twitter

    Comment


      #3
      Hi RhythmScript,

      A feature request for this has been added for the engineers to take a look at for future consideration. For your reference the ticket is UE-8294.
      Tim Hobson | Learning Resources | Epic Games
      UE4 Documentation

      Comment


        #4
        This has been done as part of 6af0f20199e5f59d6658d30e00a30900a5463206 (which relies on f715c7fbfac75868e5b744c4b77c1cc022710a6b).

        You can now export, import, and view arrays in both the CSV and JSON DataTable formats.

        For CSV they use our standard property export array format, eg)
        Code:
        "(10,20)"
        "(""String1"",""String2"")"
        For JSON they use a standard JSON array.
        Last edited by Jamie Dale; 03-27-2015, 02:49 PM.

        Comment


          #5
          You are truly my hero.

          Now if only there was an easy way to EXPORT my current data table back to CSV, so I didn't have to retype changes by hand...

          ah well! Thank you guys!

          Comment


            #6
            What format is your data table? If it's a .uasset, I've also added the ability to export those to CSV in the above change

            Click image for larger version

Name:	UE4_ExportAsCSV.png
Views:	1
Size:	102.7 KB
ID:	1071380
            Last edited by Jamie Dale; 03-27-2015, 06:44 PM.

            Comment


              #7
              Well, shut my mouth.

              Exceptional. That will enable me to export my current array-filled data table back to CSV whenever I want to do things like reorganize rows (which I very frequently want to do, and which the current uasset editor doesn't allow).

              Comment


                #8
                That's a pretty bad workflow just to re-order some rows

                I'll look into adding that to the editor while I'm working on the other UI improvements.

                Comment


                  #9
                  Apparently the export feature does not work for field with the "Set" attribute. How are those supposed to be formatted in CSV or JSON? How about for fields done as maps?

                  Comment


                    #10
                    I added map and set support to the Data Table import/export for 4.16.

                    Comment


                      #11
                      Originally posted by Jamie Dale View Post
                      I added map and set support to the Data Table import/export for 4.16.
                      Thank you! 4.16 keeps getting better. Just wish it was stable enough for production.

                      Comment


                        #12
                        Is there any place these import/export formats are fully documented with what types are supported? And I mean individually and not the generic reply "any of class X". I'm going to hazard a guess that the import/export of sets and maps are going to be similar to arrays?

                        Comment


                          #13
                          DataTableUtils::IsSupportedTableProperty lists the property types that are supported by Data Tables in general. If a property is in that list then it (and any derived property types) should support import/export.

                          As of 4.16 the list is: UIntProperty, UNumericProperty, UDoubleProperty, UFloatProperty, UNameProperty, UStrProperty, UBoolProperty, UObjectPropertyBase, UStructProperty, UByteProperty, UTextProperty, UArrayProperty, USetProperty, UMapProperty, UEnumProperty.

                          Comment


                            #14
                            Originally posted by Jamie Dale View Post
                            DataTableUtils::IsSupportedTableProperty lists the property types that are supported by Data Tables in general. If a property is in that list then it (and any derived property types) should support import/export.

                            As of 4.16 the list is: UIntProperty, UNumericProperty, UDoubleProperty, UFloatProperty, UNameProperty, UStrProperty, UBoolProperty, UObjectPropertyBase, UStructProperty, UByteProperty, UTextProperty, UArrayProperty, USetProperty, UMapProperty, UEnumProperty.
                            While that is useful information the short answer so far is "no". You just described acceptable input but not how that input is formatted. This is information that should be under Learn > Documentation. No worries. I know just how much a pain it can be to fully document what you've coded.

                            Comment


                              #15
                              Originally posted by Avelworldcreator View Post
                              While that is useful information the short answer so far is "no". You just described acceptable input but not how that input is formatted. This is information that should be under Learn > Documentation. No worries. I know just how much a pain it can be to fully document what you've coded.
                              Finding out how stuff is formated is trivial. Create a data table that has the type you need, enter something then export the table as csv. Look at the resulting .csv file and voila, you now know how to format it.

                              Comment

                              Working...
                              X