How to organize task system?

Hello. I want to orginize task system for each NPC in my game, so it’ll look like this: string with task description, boolean to make sure if the task is completed and maybe additional variable to see the progress of the task (like talk 1/5). How can I organize it to easily add to character as many tasks as I want from prepared list? I suppose I should use structures with enumerables?

I am using a system based from this:
Introducing the Command Design Pattern in Unreal Engine 4 - YouTube

this way I can put task, or commands, into a queue. Each task/command is wrapped in an uobject, which makes it easy to assign custom logic per task, while also sharing common data via an abstract parent uobject class that each task derives from.

I dont know if it is the most performant or “correct” way to code, but for me as a solo-developer it is the easiest way to manage a complex system I’ve found so far. Blueprint graphs stay short, problem-space stays small as each task has a small responsibility and no dependencies on other classes, and it’s easy to search.

2 Likes

I suppose it’s not quite suitable answer for me. I don’t need a pattern. Maybe it’s misunderstanding, because when I’m talking about tasks I mean something like daily tasks in Warframe or in Witcher 3:


So my question is more about using suitable structures for my needs.