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?
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.
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
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