Hey guys, I’m working on a tracking system to know what “Objectives” my player is doing / has done in order to complete a “Quest” but I’m stuck.
The way I’m building it so far is like this :
S_DataObjective : Structure
- var ObjectiveID : FName
- var ObjectiveDescription : Text
- var ObjectiveIsCompleted : Bool
S_QuestTableFormat : Structure
- var QuestDescription : Text
- var QuestIsCompleted : Bool
- var QuestObjectives : Array of Structure of type S_DataObjective
DT_Quests : Data Table based of S_QuestTableFormat containing all the information about all the quests, one quest per row.
Finally, once I spawn a new quest at runtime, I look into this Data Table to assign the values to this specific quest on its beginplay, using the Row Name of the Data Table as an ID for the quest.
This is all working fine so far, but I fear it might be hard to scale this up or if I have to add new objectives or rename an objective of a quest.
I now have different objects that can interact with a Quest to update its state. For instance, I have a collision box that can address the quest by sending a S_DataObjective (manually typed) through an interface and set it as completed inside the quest.
Since I’m using FName as the Objectives identifiers, I have to write the exact same name as the Data Table each time I want to address a specific quest, and I feel there must be another way to do this that would be more secure. Currently, if for some reason the FName is changed in the Data Table, none of my objects will follow this updated ID which I find scary.
I was thinking of using an enum containing all the IDs of the objectives, and using this enum in the S_DataObjective structure instead of the FName. This way, I would only type the ID once in the enum, and select it (in drop-down menu) everywhere else when I need to address this objective. The thing though is that this enum would end up having maybe more than 200+ enumerators.
Am i setting myself for a catastrophe? What would you recommend I look into?
Thank you!