Lots of functionalities use Data Tables to expose their variables. Data tables allow you to have a more data driven pipeline for creating your game, which can be really usefull.
Data Tables are a way to store datas of a certain type (Structures).
For each feature concerned with DataTables, an "empty" Data Table has been created in the same folder where the feature is implemented and a copy resides in the Demo/DataTables/ folder. Actually, the Actors/Components references the DataTables which are in this Demo/DataTables/ folder. You can directly modify these tables, or create new ones and make sure they are correctly referenced by the Actors/Components who need them.
Global Datas Access :
Several Datas are consider to be "global". Let say I need informations about a specific item (Its name, or its icon...). I need to retrieve this informations form somewhere and avoid duplicating these infos all over the project.
To solve this problème, I use the GameInstance class, and to make everything more modular, I've decided to split the Datas into separate UObjects :
- ItemGlobalDatas,
- EffectGlobalDatas,
- StatsGlobalDatas,
- MetaGlobalDatas,
- TravelGlobalDatas
These objects will store the global datas (mostly links to the DataTables)
The TopDownRPGTemplateGameInstance store all these objects.
To make things simpler, I've decided to associate a Blueprint Function Library to each Global Datas. These Blueprint Function Libraries are used to access datas :
- ItemUtilities,
- EffectUtilities,
- StatsUtilities,
Then, all you have to do to access the Global Datas is to call one of the Getters which resides in those Blueprint Function Libraries.
An example for Items. Here we get the Rarity color and the Display Datas of the items by calling GetItemAllDisplayDatas() and GetRarityColor().