Data Organization in your Project?

Hi everyone,
i have a game that relies heavily on data. So i have a lot of arrays and arrays of structs. I stumbled upon the usual data driven stuff here in the forums and answerhub like DataTables, Data Assets, SaveGAme und UObjects and tried all of them.

DataTables is by far the most convinient when it comes to editing arrays of structs.
What haunts me is simply the fact, that some variebles in these structs need change at runtime. For now i save these Variables in actors and all is fine. But its a bit tedious. For example: when i change the level i need to save them and reload them in the new level and so on. Cause i need them mostly for UMG and they dont need to be changed very often, they do not really belong into the level i think. Or is it ok to keep hundreds of structs in actors in the level?

I know, to set Variables at runtime in a DataTable will probably never happen, so there has to be another efficent way of doing this. How would u handle hundreds of small arrays of structs or just arrays? Is there something i missed with DataAssets, DT or UObjects?
i am using mostly BP but can do easy stuff in C++ too. I know there are some workarounds with c++ and not using UPROPERTY but i want that GarbageCollector.

Thanks for ur help. A_NDE

Hi AZTECCO,
thank u for u answer. Its ture the game instance can do this, but it wouldnt work with my project, because i would need multiple gameInstances at the same time. Otherwise things would get really messy in this one GameInstance.

I explain what my data looks like.
In my game, i have these huge Quest which are related to a lot of actors,charactoers and more. All the static data for these data sits in datatables right now. What makes things difficult are the changes i need to track, because all actors/character have complex relationships to each other.
For now i track these changes in one actor per quest. Means i have losts of arrays of structs in there tracking everything for the quest. When i would get all quest and all the arrays into one GameInstance it would get worse organizing that i think.

Dont really know, maybe my problem is not that big and i overoptimize.
But i have these huge quest actors, that are just sitting there, getting a change here and there.

You are absolutely right with that, the bigger it gets, the more u need that organisated structure or just small changes seem complicated.

I should have writen this right away, but the problem is the the physical representation in the level of the data as actor is a very short period in the lifetime of the data. For example. u have an actor in game that has all that data in him. You interact with that actor and the changes are simply saved in that actor. But now u collect that actor…
You still need all of that data, and some of it will still change. The instance in the level disapears but u still need to use the data for umg, comparisons, combine, talking about that data with others and so on.

Dream would really be to have a runtime changeable DataTable or DataAsset with all the static variables that never change und some changeable. So i wouldnt need to communicate with DataTables and that Save-Actors all the time, i would just enter the DataTable.
I Guess my needs are a bit unusual and need more work. Thank u for ur thoughts ASTECCO, it still helps to getting ur head around something.

I wouldnt even mind to get deeper into C++ to get this done. Just dont know if it is possible to have a DataAsset with static and changables that u can edit from Blueprint via C++ functions(BlueprintCallable).

Sorry I didn’t helped you,.

Your task seems to be very complicated: I think divide it in some big sections would be a good point to start.
For example why don’t you store relationship and any datata relative to a character inside the character? And make a robust system for this part?
I think is good to store data pertaining an actor inside that actor.

Then focus on quest in a separate part, I think you need to communicate a lot between the quest and every character and this could be a bit hard to accomplish.

Sorry if it’s not too much, just my point of view, when things becomes bigger, organization and fragmentation becomes indispensable.

Hi,

One option is to store the variables somewhere that doesn’t get reset when you change levels, like in your game instance.

Another option , although I didn’t test it, would be to use this.

Supposedly it saves variables in uasset files, and you can access them anytime from any other blueprint without casting or anything else.

Also something I always try to do is include as much info as I can in 1 struct, to limit the numbers of variables I have to make.