Data Assets???

Hey, I’m trying to work out a good solution for manipulating, controlling and progressing data over the course of a game.

I’ve resently been looking at Data Assets and they seem like a good way to control data say for a character, weapon, etc. similar to Scribtable Objects in Unity.

Here’s example screenshots:

Simple ‘Weapon data’ stuct, kept it bare bones for now :slight_smile:

UE4Editor_aeneaKomvl.png

This struct is implamented within a Primary Data asset that has simple methods to manipulate and return the data.

[Data Asset for reference]

Blueprint that contains the data asset.

The problem I’m running into is that run in editor I can get and set the data within the data asset and it stays changed even when the level changes. But, in a built version the data will revert back to the origial value upon level change.

I’m wondering if I am using these data assets not for their intended purpose? or what might be a relitivly optimal solution for doing something like this within blueprint;

  • Storing the data into an instance (though this doesn’t feel right)
  • saving and loading (for all stat changes?)
  • Would streaming in the data assets work?
  • Am I missing something with the asset manager?

Any help, advise or even a better solution would be massivly apreciated!

:slight_smile:

Eyo,

Starters, DataAssets <3
Second, I went from Unity to Unreal a couple of years ago and did something similar so I understand where you come from.

Well, I have only worked with them in c++ so take this with a grain of salt.
I have it somewhere in the back of my head that you never should set a DataAsset value as I believe that they are not instanced at all, if you, for example, use one DA_ in two different BP’s, set one of the values in runtime, and then read the information from both BP’s you’d get the same value from both of them.
There is a lot of different ways to use them and I think some of their “intended” purposes is:

  1. Refactor - Make it easier to collect and save data when refactoring code
  2. SourceControl - Remove the need for programmers and Designers to work using the same BP at the same time.
  3. Centralize information - Removes the unnecessary “extra” time to find all the values that are specifically for Designers
  4. Iteration - It is easy to duplicate a data asset and set new variables.

I believe that the “Player State” is the “official” way to save information between levels.

4 Likes