Can I use data assets as data table?

Hi, so I have a data table with info I use to represent each item in the game, in a UI (like name, icon etc.).
Can I use data assets for that purpose instead? Is it better?
Can you iterate through all your data assets, like you do with data table, to find a certain one?
Thanks.

I normally use data assets when I know there are few elements, and that there are usually only a few of them on the maps. You select them specifically and don’t have to interact with all of them.
If you’re going to create data assets and then create an array of them all, I don’t see the point.

And data tables to store many items, and if you have to interact with many. Also, now with chatgpt, which can fill in or review the tables, is another plus.

1 Like

you can use BulkEditViaPropertyMatrix

you can use the AssetRegistry for this

in my opinion, yes. structs are broken and datatables suck :stuck_out_tongue: unless you need to import/export the data

1 Like

Thanks. It seems like the forced way to do it, doesn’t it?
In my case, those data assets represent each of the items in the game. So it’s going to be a lot.

you can do it by filepath so it only looks up items, no worse than a massive data table, but if you handle it well you dont even have to load the asset so its much more performant

1 Like

Does that improve over having datatables contain only soft pointers (not loading the asset)?

Structs are broken on the asset / blueprint side, and Core Redirectors don’t work for them. Datatables can die after a small struct change and won’t let you edit their binary files to update them.

However, I found them useful. Haven’t used the asset registry yet.

In the past I used to have pointers within datatables to refer to other datatables. This grouped things together nicely. For example, I could map entries like “apple, pear, banana” to another entry “fruit”. This way I could specify the effects of eating a fruit just once (“add health by X”) just once and reuse that. That pointer could be soft, loading into memory only when required.

1 Like

technically i would say yes as you still have to load the entire data table to check anything but of course if the data is small like soft pointers then yeah its irrelevant.

the other reason i prefer the asset registry is you can say add optional DLC which doesnt touch the original Table or could expand on it with DA Inheritance.

agreed i was somewhat joking with my original post that said i cant think of much i use them for anymore

1 Like

Interesting!

I think so yes. There is a sub-class of Data Asset (or overriding a UObject virtual) which “upgrades” data assets to Primary Data Assets. When using this type of Data Asset you can markup the soft pointers with meta values for “bundles” that they belong to. Then you can use the Asset Manager (not Registry) to load bundles of soft pointers instead of gathering those paths individually to make load requests (either through the Registry or direct LoadSynchronous calls).

In XCom2 and Marvel’s Midnight Suns, we went so far as to have the Primary Data Assets all loaded all the time. But since the “expensive” content were soft pointers on bundles it wasn’t really a memory problem. I’ve expanded on this pattern in a plugin on my github that also integrates game feature plugin support (those weren’t available for MMS) so that one specific type (and it’s children) are loaded as long as the feature is active. Then the game is able to just ask the Asset Manager for “all weapons” or “all costumes” and you know it’s only the ones that are valid right now.

(edit: I’m just realizing this is in the Blueprint filter, so it’s worth mentioning that all the Asset Bundle support requires creating asset types in native as you can’t set the meta data on blueprint members without a third-party plugin solution)

2 Likes