Search Unity

Quest System Pro - Create quests, achievements and dialogues!

Discussion in 'Assets and Asset Store' started by jorisshh, May 3, 2016.

  1. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    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 :)



    There's also a more traditional quest window for the RPG fans :)


    (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 :)

    Code (CSharp):
    1.  
    2. public class MyPlayerCondition : IEdgeCondition
    3. {
    4.         public int minimalLevel = 3; // You can assign this in the custom inspectors.
    5.  
    6.         /// <summary>
    7.         /// Can the end node this edge is pointing to be seen (viewed by player)?
    8.         /// </summary>
    9.         public bool CanViewEndNode()
    10.         {
    11.               return CanUse();
    12.         }
    13.  
    14.         /// <summary>
    15.         /// Can this edge be used? If not it's action will become inactive.
    16.         /// </summary>
    17.         public bool CanUse()
    18.         {
    19.               return MyPlayer.level >= minimalLevel;
    20.         }
    21.  
    22.         /// <summary>
    23.         /// A short string visualizing the intent of this condition.
    24.         /// </summary>
    25.         public string FormattedString()
    26.         {
    27.              if(CanUse() == false)
    28.              {
    29.                     return "Your player level is to low";
    30.              }
    31.  
    32.              return string.Empty;
    33.         }
    34. }
    35.  

    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 :D
     
    Last edited: Mar 11, 2017
    Tinjaw likes this.
  2. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,682
    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.
     
  3. Collrain

    Collrain

    Joined:
    Oct 27, 2012
    Posts:
    45
    Fantastic it looks amazing :)

    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.
     
  4. Cartoon-Mania

    Cartoon-Mania

    Joined:
    Mar 23, 2015
    Posts:
    320
    APEX UTILITY AI :)
     
  5. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Check, check and check :) - The system is a lot larger than I showed off so far, I'll continue to highlight features :)
     
    hopeful likes this.
  6. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    And you already can :) (updated the first post a bit with some API calls).
     
    Collrain likes this.
  7. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    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?
     
  8. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    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 :)


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


    Better UI elements are coming, don't worry :p
     
  9. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,682
    I like the parallel independently timed tasks. That's something I've always wanted. I may have to get this. :)

    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.
     
  10. sanuvin

    sanuvin

    Joined:
    Feb 11, 2014
    Posts:
    61
    Perhaps a timer option for number of turns vice minutes/seconds for the turn based people :) ?
     
  11. montyfi

    montyfi

    Joined:
    Aug 3, 2012
    Posts:
    548
    How about Inventory Pro Sci-Fi Design? ;)
     
    jorisshh likes this.
  12. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Yes of course :) forgot to add it to the list (updated :))
     
  13. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,682
    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.
     
    jorisshh likes this.
  14. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    So I thought about how to fix this issue and I think I've come up with a very nice solution :)

    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 :) - 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 :)

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

    Code (CSharp):
    1.  
    2. public interface ITaskTimeHandler
    3.     {
    4.         void OnTimerStarted(Task task);
    5.         void OnTimerUpdated(Task task);
    6.         void OnTimerStopped(Task task);
    7.  
    8.         void OnReachedTimeLimit(Task task);
    9.     }
    10.  
    11. // Other script
    12. public class TaskTimeHandler : ITaskTimeHandler
    13. {
    14.         public bool failQuestWhenOutOfTime = true; // < This now serializes and can be set in the inspectors.
    15.  
    16.         public void OnTimerStarted(Task task)
    17.         { }
    18.  
    19.         public void OnTimerUpdated(Task task)
    20.         { }
    21.  
    22.         public void OnTimerStopped(Task task)
    23.         { }
    24.  
    25.         public void OnReachedTimeLimit(Task task)
    26.         {
    27.             task.Fail();
    28.  
    29.             if (failQuestWhenOutOfTime)
    30.             {
    31.                 QuestLogger.LogVerbose("Quest cancelled because time limit was reached on required task (" + task.key + ").");
    32.                 task.owner.Cancel();
    33.             }
    34.         }
    35. }
    36.  
    37.  
     
  15. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Oh I like it hadn't even thought of that :) - 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)
     
  16. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,682
    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?
     
  17. Brian-Ryer

    Brian-Ryer

    Joined:
    Mar 5, 2013
    Posts:
    43
    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.
     
  18. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    This too is interface based, for example:
    Code (CSharp):
    1.  
    2.     public interface IQuestRewardGiver
    3.     {
    4.         bool CanGiveRewards(Quest quest);
    5.         bool GiveRewards(Quest quest);
    6.     }
    7.  
    Inventory pro example:
    Code (CSharp):
    1.  
    2.     public class InventoryProQuestRewardGiver : IQuestRewardGiver
    3.     {
    4.         public InventoryItemAmountRow[] reward = new InventoryItemAmountRow[0];
    5.  
    6.         public bool CanGiveRewards(Quest quest)
    7.         {
    8.             return InventoryManager.CanAddItems(reward);
    9.         }
    10.  
    11.         public bool GiveRewards(Quest quest)
    12.         {
    13.             return InventoryManager.AddItems(InventoryItemUtility.RowsToItems(reward, true));
    14.         }
    15.     }
    16.  
    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.

     
    Last edited: May 5, 2016
    danreid70 and hopeful like this.
  19. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    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)
     
    danreid70 and hopeful like this.
  20. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Some proof :p - Things are coming along nicely. Inventory Pro integration is almost done, all that's left is polishing :D

    (Yes, you can hide completed tasks, there's an option for that :p)
     
    Nateply, danreid70 and Adrad like this.
  21. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,682
    So the quests can be kept as inventory items and the achievements can be kept as inventory items ...?
     
  22. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    The gif above is just a gathering example. But yes I'll add a 'scroll' which the player can use to accept a quest :)

    The difference between achievements and tasks is that an achievement becomes activated when you set it's progress, a quest has to be (manually) activated first. So, if you have an achievement: gather 1000 apples it will auto. start once you pickup the first apple. A quest has to be activated first, then it will start counting.

    Just consider achievements global quests :)
     
    hopeful, Tinjaw and montyfi like this.
  23. Carmexx

    Carmexx

    Joined:
    Jul 29, 2014
    Posts:
    63
    Howdy - nice, I'll be buying. I was just starting to think about quest/ach system, I'll wait now for you to do your magic.

    -Easysave integration ?
     
  24. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    I'm not a 100% sure which integrations I'll be adding but these I have at the moment:

    See first post for integration status'
     
    Last edited: Jun 8, 2016
    montyfi and hopeful like this.
  25. danreid70

    danreid70

    Joined:
    Aug 28, 2010
    Posts:
    225
    WUData integration, by MyBadStudios... :)
     
  26. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Decided to add some easy controls for basic cut-scenes to make the dialogue conversations more interesting.

    Using the editor you can define positions for you main camera. But you can also create 'child' camera's for your NPC's to create different angles for the face / and so on :)


    (in scene view)


    For the final result :D


    You can also chain animations and make them world-space. Which could be great for those 'a door is opening somewhere' cut-scenes.
     
    montyfi likes this.
  27. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,682
    Good to see some of where the dialogue / cutscene stuff comes in.

    Maybe this quest system could hook up to a popular camera / cutscene plugin, like Camera Path Animator ...? I have no idea what people are using for that (if anything).
     
  28. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Oh didn't know that one yet :). A cutscene or some cinematic integration would be great. These are the assets I've found (not really looked into them yet).

    https://www.assetstore.unity3d.com/en/#!/content/3666
    https://www.assetstore.unity3d.com/en/#!/content/18440
    https://www.assetstore.unity3d.com/en/#!/content/56558 (seems very nice, had my eyes on this one :))
     
    Tinjaw likes this.
  29. Tiny-Tree

    Tiny-Tree

    Joined:
    Dec 26, 2012
    Posts:
    1,315
    i think best solution is you make a robust but simple camera sequence system so we dont need these plugin, because the workflow become more messy if you have to switch between plugin to do same thing plus you dont have control when you player decide to click on next button or not. right now what you did on the example with camera movement is simple but enough for 99 % of the games. will you also add QTE?
     
  30. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Ah! Wordpress


    I'll put it on my to look into list though :p
     
    danreid70 likes this.
  31. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Exactly why I added in the simple camera solution :) Quick time events might be nice, but how would I add this into the dialogue? And examples of what you mean?
     
  32. Tiny-Tree

    Tiny-Tree

    Joined:
    Dec 26, 2012
    Posts:
    1,315
    add a node Qte with multiple field (qte types) for example kill/save the queen then the dialogue wait for use input, it can have an optional timer.

    the qte entity have an ui prefab, an input listener and it can play animation on actors
     
  33. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,682
    Probably Playmaker has methods of smoothly moving the camera around for cutscenes. There just needs to be an easy way of hooking things in.

    I see there is also a tutorial on how to use Playmaker with Camera Path Animator ...
     
  34. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    I like it :) I'll put it on my list

    Right now there's already an player decision node (not timed) which can do mostly this :) - Adding in a timer per node would of course be a nice addition.
     
  35. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Yep got you covered there; You can define an event in playmaker and call it from within a dialogue at any given point:


    Which allows you to call playmaker things inside the dialogue conversations
     
    hopeful likes this.
  36. Tiny-Tree

    Tiny-Tree

    Joined:
    Dec 26, 2012
    Posts:
    1,315
    can we use multiple action per node ? like one event one dialogue and one camera sequence at same time ?
     
  37. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Sort of. It's really 1 action per node, however depending on the node you can define if it should wait to complete it's task, or immediately continue and run 'async'. For example, the camera position is async. When the node is activated it will 'queue' the camera to transition between 2 points and jump to the next node.

    Nodes have an OnExecute() method that you can override to define your own behavior. By calling Finish(true) you automatically hop to the next node, and Finish(false) will remain where it is.

    There's a timer utility class: TimerHelper.GetTimer().StartTimer(2f, () => { Finish(true); /* Finish after 2 seconds */ }); // < which you can use to create async actions.
     
  38. wood333

    wood333

    Joined:
    May 9, 2015
    Posts:
    851
    Suggested 3rd party integration:

    ICE Creature Control
    Third Person Controller Template (Invector)
     
    jorisshh likes this.
  39. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Yep those would certainly make great additions :) - Updated the list
     
    wood333 likes this.
  40. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    So... Who'd like to test out the first version of the quest system :)? Send me a PM and I'll send you a copy of the first build. I'd like to get some early feedback, so please be very critical :D
     
  41. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    I'd like to see SALSA integration and if you're already considering the Invector 3rd Person Controller then why not Opsive's Third Person Controller also? Sending PM for beta test. I could use this in current project almost immediately.
     
    jorisshh likes this.
  42. Cartoon-Mania

    Cartoon-Mania

    Joined:
    Mar 23, 2015
    Posts:
    320
    Actually .. Inventory Pro need to integrate with Third Person Controller Template (Invector) :)
     
    wood333 likes this.
  43. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    All in due time, let's get the first version solid and production ready first :p - SALSA would be great for the dialogue part, and the a third person controller for both actually (disabling controls during cutscenes, triggers on killing an enemy, etc).

    I've got a lot of great feedback over the past few days. I'll post the progress soon and gear up for the first release :) - I've built the quest system a little different than Inventory Pro to allow for faster expansion cleaner code, which should also help with the maintainability, etc, blah blah, geek talk :)
     
  44. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    I've gotten a lot of great feedback these past few days so I thought I'd highlight the new changes, so here goes :)

    First off: Dialogue nodes owners + Auto focus

    Nodes now belong to the player, dialogue owner (NPC) or no one in particular. The player's nodes are green, while the owner's nodes are grayish.


    I've added an AutoFocus component that allows the dialogue camera to automatically focus on the player or dialogue owner when the node becomes active. This allows you to specify focus locations and the dialogue camera will auto. move to these positions. This way you can set up conversations without having to manually specify location position all the time (of course you can do it manually if you'd like :p)


    More to come soon :)
     
    danreid70 and hopeful like this.
  45. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    @magique

    A quick update, I've just contacted Michael the creator of SALSA, whom send me a voucher code for development :) - Will keep everyone posted.
     
    Tinjaw likes this.
  46. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Just integrated SALSA, that was (almost) to easy :), probably the easiest API I've worked with so far :D @Crazy Minnow Studio

    And a little proof (green is the main player) + some auto focus in action:



    Next up UI, cleanup, documentation and demos :) - And of course some nice asset store art :p
     
    wood333, recon0303, magique and 3 others like this.
  47. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    It's been a while since I've posted, but I do have some good news :)

    It's awaiting approval ... :D
     
    Tinjaw likes this.
  48. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    Perhaps Cinema Director integration?
     
    recon0303 likes this.
  49. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Looks good - added to the list :)
     
    Tinjaw and magique like this.
  50. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    I was thinking, how about an integration with Love/Hate: https://www.assetstore.unity3d.com/en/#!/content/33063 It sounds like a great asset, and would make a questing system so much more dynamic. Imagine quests with rewards based on your relation to the NPC or give a NPC only quests if your relation to that NPC is good, and so on :)

    Who'd like to see Love/Hate integrated?