With the „Advanced Mission And Notification System V3" being free for the month in June 2019, I digged around the source files there and saw something that kinda shocked me. I am rather new to working with the Unreal Engine and there I stumbled upon something that I cannot quite solve by myself, concerning organizing specialized data.
Here is a simple example. In a game, you have missions, every missions has objectives. An objective could be to reach a certain actor, to collect something, to interact with something, you get the idea. Objectives and missions themselves are pure data, so an obvious approach would be to create structs that describe these object types. There could be an BPS_InteractObjective, a BPS_ReachObjective and so on.
At this point, you might already see something. Objectives, being pure data, share stuff, in theory. Every objective could have a description, could be colored in some way and so on. Fine, since structs do not support inheritance or interfaces, we could create something like BPS_ObjectiveDisplayInformation and add it to every struct that describes an objective. Bullet dodged.
Nonetheless, we will reach a point where we would need generalization. Mission have objectives, but what now? We have different structs for every type of objective that have nothing in common. How could we add these to a mission, which is also a struct? „Advanced Mission And Notification System V3" solves this by creating a struct that holds an array of every single objective type with an enumeration that determinates which objective type sohuld be used, however, this is incredibly inefficient, isn’t it, because you would allocate memory for every single objective type although only one, which is decided by the enumeration value, is actually used.
However, how would you solve this? I cannot think of any way to create different types of objectives as structs without having to use something like their solution. Around reddit, I saw someone suggesting using classes with an interface for IObjective or something, but classes for pure data loaded from a data table?
Another idea that I have are Actor Components. One Actor which represents and handles missions and then dropping Actor Components which represent objectives in there. Would this be a good idea?