Quest System Pro - Create quests, achievements and dialogues!

Quest System Pro

Quest System Pro is an extremely flexible quest, achievement and dialogue / conversation trees system.

Quests (can) consist of multiple tasks. Each task can be progressed through the built-in components, your own code, or using a FSM like PlayMaker. Using this, you can create ANY type of quest.

Quests can have a set of tasks. These tasks can be defined in an editor (WIP)

Set up dialogue conversations

Realtime debugging and editing

Create conditions. Example: You can only use the conversation tree below IF you have an active quest (all set up using editors). (The red box is the edge condition, it will show a red box if the conditions aren’t met and green if they’re met).

Which will look like this:

The UI can be completely modified to your liking and new nodes can be added to create your own behaviors, just in case you want to do something unique :slight_smile:

There’s also a more traditional quest window for the RPG fans :slight_smile:



(UI Will be improved…)

By default there are the following quest types:
Gather quests
Delivery quests
Discovery quests
Kill quests
Talk quests
Escort quests
User input (example: Enter a password phrase)
Timed quests (set a time limit to quest will auto. be cancelled if you run out of time).

Or any of these combinations. A quest can have any number of tasks and each task can be set separately.

API:
Interfaces, generics and polymorphic types are serialized, using this you can create restrictions based on your own game. For example, maybe you only want the user to be able to start a quest IF they’re the right level. Using the following code you can do so :slight_smile:

public class MyPlayerCondition : IEdgeCondition
{
        public int minimalLevel = 3; // You can assign this in the custom inspectors.

        /// <summary>
        /// Can the end node this edge is pointing to be seen (viewed by player)?
        /// </summary>
        public bool CanViewEndNode()
        {
              return CanUse();
        }

        /// <summary>
        /// Can this edge be used? If not it's action will become inactive.
        /// </summary>
        public bool CanUse()
        {
              return MyPlayer.level >= minimalLevel;
        }

        /// <summary>
        /// A short string visualizing the intent of this condition.
        /// </summary>
        public string FormattedString()
        {
             if(CanUse() == false)
             {
                    return "Your player level is to low";
             }

             return string.Empty;
        }
}

Integrations
Already done:
Inventory Pro
PlayMaker
Rewired input
SALSA (lip sync) (V0.2)
Easy Save 2 (V0.2)
Love/Hate (V1.0)
LipSync (pro) (V1.0.1)

Certain:
Behavior Designer

Maybe (somewhat likely)
The Dialogue system
Node Canvas
(Feel free to suggest more :p)

Maybe - To look into
ICE Creature Control
Third Person Controller Template (Invector)
Cinema Director

On the TODO List:

  • Update UI visuals
  • More inventory Pro combination examples
  • Sci-FI UI Design
  • More dialogue camera control (crossfade, movement, interpolation, etc) - 3rd party asset

If you have any questions let me know :smile:

1 Like

Here’s a few ideas for you, not sure if these are already represented or out of scope …

Not necessarily a new quest type, but a quest complication: timed objective, which could apply to the whole quest, or just to a task.

Quest successful / failed.

Quest events: conditions like on task start, on task completion, on task success, on task fail, etc., so that when one task starts or ends, a dialogue, ambush, teleport, door open, reward, or other event can occur.

Fantastic it looks amazing :slight_smile:

As “hopeful” mentions above you may already have done this but I like his quest events idea. Would be nice to trigger things from either code or inspector, based on what stage of a quest is occurring.

Keep up the awesome work, can’t wait to try it once its ready.

APEX UTILITY AI :slight_smile:

Check, check and check :slight_smile: - The system is a lot larger than I showed off so far, I’ll continue to highlight features :slight_smile:

1 Like

And you already can :slight_smile: (updated the first post a bit with some API calls).

1 Like

Heard a lot of good things about APEX, but what kind of integration would you like to see? Could be used for quests where you have to escort a NPC to a specific location. / Defend a carrage while it’s moving between places, etc?

I decided to work a bit more on the timed quests. Previously the timer was for the entire quest, now you can set timers per task and the task order behaves accordingly as well.

For example:
Say there’s 2 tasks (Main, and Main2)
When the task order is Single tasks have to be done 1 after another. When task Main is completed task Main2 will start and activate it’s timer. If task Main is not completed within the allotted time (and the task is required) the quest will be cancelled.

When the task order is Parallel the tasks will all start at the same time. Each task can still have it’s own timer, they’ll just all start at the same time. For example, Talk to a NPC and gather 5 apples, both tasks will start the timer when the quest starts.

Using a task order of single would allow you to create multi-tasked quests and make some tasks time based. Once all (required) tasks are completed the quest can be completed and rewards are given to the player :slight_smile:

And timer indicators (can be a slider, text or a image fill)

Better UI elements are coming, don’t worry :stuck_out_tongue:

I like the parallel independently timed tasks. That’s something I’ve always wanted. I may have to get this. :slight_smile:

However, I don’t think a failed task should cause the quest to automatically fail. What I’d prefer is to be able to check for “on task end” and if it has ended, then I want to check “on task fail” and if so, maybe move to the next task, or maybe restart the last task, or maybe branch to an optional task that occurs only on fail, or maybe fail the quest. If I check “on task success” maybe I want to give an extra reward before moving onto the next task.

In this way I can include optional tasks, and if the task succeeds maybe the player gets an extra reward or extra time on the main quest clock or something, and if they fail, no big deal, the quest continues.

Perhaps a timer option for number of turns vice minutes/seconds for the turn based people :slight_smile: ?

How about Inventory Pro Sci-Fi Design? :wink:

1 Like

Yes of course :slight_smile: forgot to add it to the list (updated :))

Just off the top of my head, maybe integration with Core Game Kit and Master Audio? Those are popular in the store, and I think integration would mainly be triggering music changes and spawning / ambushes on quest events …?

I don’t think that sort of hookup is a great necessity, but it could be a way of demonstrating how to use the quest events.

1 Like

So I thought about how to fix this issue and I think I’ve come up with a very nice solution :slight_smile:

Quests now have a time handler, this handles time based actions for this quest.

Now that interfaces serialize properly we can do all sorts of funky stuff :slight_smile: - Based on the interface below you can create any script and directly set it in the inspector. For example, the default time handler has the option to fail the quest when you run out of time, but you could also write your own time implementation to give the player a warning and 1 extra minute, or start any other task, etc, etc :slight_smile:

So, how you can just create your own type and select it from the dropdown in the inspector (see image below)

public interface ITaskTimeHandler
    {
        void OnTimerStarted(Task task);
        void OnTimerUpdated(Task task);
        void OnTimerStopped(Task task);

        void OnReachedTimeLimit(Task task);
    }

// Other script
public class TaskTimeHandler : ITaskTimeHandler
{
        public bool failQuestWhenOutOfTime = true; // < This now serializes and can be set in the inspectors.

        public void OnTimerStarted(Task task)
        { }

        public void OnTimerUpdated(Task task)
        { }

        public void OnTimerStopped(Task task)
        { }

        public void OnReachedTimeLimit(Task task)
        {
            task.Fail();

            if (failQuestWhenOutOfTime)
            {
                QuestLogger.LogVerbose("Quest cancelled because time limit was reached on required task (" + task.key + ").");
                task.owner.Cancel();
            }
        }
}

Oh I like it hadn’t even thought of that :slight_smile: - I’ll save this for later though, adding manual progression for the timers might be a bit to specific for the initial release (otherwise I keep tacking on features :P)

I suppose another part of the quest system would be handing out rewards, like XP, currency, inventory items, and achievements, with the possibility of bonuses if certain criteria are met.

How does this quest system handle that?

Like hopeful said above I would love a way to once a certain quest is finished the reward will be an item that unlocks
in the vendor inventory, and available to purchase, to add a sense of progression.

This too is interface based, for example:

    public interface IQuestRewardGiver
    {
        bool CanGiveRewards(Quest quest);
        bool GiveRewards(Quest quest);
    }

Inventory pro example:

    public class InventoryProQuestRewardGiver : IQuestRewardGiver
    {
        public InventoryItemAmountRow[] reward = new InventoryItemAmountRow[0];

        public bool CanGiveRewards(Quest quest)
        {
            return InventoryManager.CanAddItems(reward);
        }

        public bool GiveRewards(Quest quest)
        {
            return InventoryManager.AddItems(InventoryItemUtility.RowsToItems(reward, true));
        }
    }

You can create your own reward givers. The quest system will scan through your assemblies (entire project) and allow you to select them from the dropdown :). Quests can have any number of reward givers. Tasks also have reward givers in case you wish to give your player extra rewards for finishing a (optional) task.

2 Likes

Yep certainly possible. I’ll see if I can add it to the initial release :). You could also give the player an item, which unlocks extra items in the shop (as in dark souls 3)

2 Likes

Some proof :stuck_out_tongue: - Things are coming along nicely. Inventory Pro integration is almost done, all that’s left is polishing :smile:

(Yes, you can hide completed tasks, there’s an option for that :P)

3 Likes