what data assets are friendly to iterative development?

I have been using data table to hold information about certain actor types. But as development goes on, you end up with some data that you don’t use anymore, and need to add new parameters.

Data table depends on struct, and when you change the struct then the data table gets nuked. This means that before making any changes to struct, you need to export the data table as CSV so you can reimport after changes.

It’s not a huge deal but does slow things down a bit and makes me wonder if I might be missing some alternative workflow possibilities?

my solution is to literally use data assets, structs have bricked my projects too many times.

more specifically look up primary data assets and their children if your not sure what i mean

2 Likes

thanks I’ll look into that more closely.
yeah i am feeling same way about structs, they are just too finicky.

I’ve played around with data assets but my only problem with those is that i cant find a way to set the class of the asset at runtime.

the way I set things up is that I have a single base class for enemy types and then the skeletal mesh, anim blueprint, and various other parameters just get pulled from the data asset (whether its data table, data asset, etc). In order to find which data to pull I search by an enum which is instance editable.

So, I’ve ended up just using a Uobject. I construct the Uobject and store it as a variable in the enemy class. Then from enum I can select which instance of the data object class to load.

Since instances are all derived from same uobject class I can use Bulk Edit Property matrix to edit data in tabular form, if needed. It is not as nice as CSV, however at least now I can confidently make changes to the data and it does not corrupt blueprints or cause crashes like structs too often do.

have a variable of the type of primarydataasset you’re using and you can select or set the dataasset in there

1 Like

does it have to be a Class type, or object type?

if it is object type, I do not see where you can set the class type in blueprint. There is no Setter function that I can find.

If it is a class type I can set the class at runtime but then you probably need to instantiate it as object somehow, right?

its an object type since its already instantiated in engine,
since its supposed to be data only you’d never need another instance but be aware though it does mean that if you changed a value in game it is permanently changed.
It also means it can be saved and loaded unlike normal object references

so just drag off a set node for the PDA object ref and you can set the DA in it

1 Like

gotcha, thanks a lot!

other than integration with the asset manager pipeline, do you know any reason to use the data assets over a vanilla UObject?

well technically it is a UObject but the main things are its already instantiated so saves you that step and there is only one instance meaning everyone can access it without having to spawn duplicates.

also interestingly since you can modify the values at runtime you could use it for interesting things, say for instance you could save variables to it that wont be lost between levels or on restarting the game/editor

1 Like

thanks a lot!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.