Reducing Dependencies coming from DataTables

Hi there!

I designed my crafting system setup so that it is based on a data table that references what is crafted and also what materials it needs etc. So this table basically depends on almost all items in the game.

My widget now references this table in order to display a list of all the things you can craft and what ingredients you need. So the widget itself is also dependent on all the items in the game.

When I wanted to reduce dependencies in this scenario, for example to migrate the widget or the data components to another project, how would I do that?

All I can think of it using some “Data” interface that provides functions for data table access so my widget only depends on the interface and only the implementation depends on the data table, but I was thinking if the table itself is setup in a bad way… The problem is you have to go concrete at some point - after all at some point you stop developing and start creating content.

Any ideas are appreciated.

Thanks and have a nice day!

PS: Where could one find best practices for UE4 or generally game design specific topics. I really struggle finding anything on the web as most of it is just how-tos on the engine itself…

Hi Im still learning to reduce dependencies too & cant do c++. However you may be able to use soft references in your datatable (which acts as a directory to the asset unlike a hard reference). Then you use async load in bp graph to load the asset and then store it in a null actor hard reference in youre BP. See demistyfying soft references on youtube.
Also you can make crafting system only be dependent on actor refences (no custom bp hard references).
For example your widget may have an array of actors (not specific child) then you load from your soft references and set them in your array. You could then interface with these actors not needing to know which specific bp they are other than that they are actors and may implement the interface.