Thread: Quest System Design.

Page 1 of 2 12 LastLast
Results 1 to 10 of 17
  1. #1 Quest System Design. 
    Registered Member
    Stanaveli's Avatar
    Join Date
    Aug 2014
    Posts
    1,490
    Thanks given
    184
    Thanks received
    653
    Rep Power
    1338
    So i've been thinking about creating a system design that supports ease of creating new quests. I was thinking of something a long the lines:

    Code:
    @Override
    public void handleQuestStages(Player player) {
    
         String dragonSlayer = player.getQuest("Dragon Slayer");
    
         switch (dragonSlayer) {
    
             case null:
                 player.getEncoder().sendMessage("Go, slay the dragon and I will reward you.");
                 player.setQuestAction("Dragon Slayer", "kill");
                 break;
             case "kill":
                 player.getEncoder().sendMessage("What are you doing here? You must slay the dragon!");
                 break;
    
             ...............
    
         }
    }
    I also found out that this design is used in many RPG games. If any of you could throw out some ideas about a better design or about this one I would appreciate it.
    Keep your head up.



    Reply With Quote  
     

  2. #2  
    anInt69

    Max _'s Avatar
    Join Date
    Feb 2012
    Age
    26
    Posts
    1,801
    Thanks given
    426
    Thanks received
    727
    Rep Power
    599
    To be released or..?

    Either way best of luck with it.
    Reply With Quote  
     

  3. #3  
    Registered Member
    Stanaveli's Avatar
    Join Date
    Aug 2014
    Posts
    1,490
    Thanks given
    184
    Thanks received
    653
    Rep Power
    1338
    Quote Originally Posted by Max _ View Post
    To be released or..?

    Either way best of luck with it.
    I might release it if people would want me too, but I haven't finished it yet, for the moment i'm just looking for opinions.
    Keep your head up.



    Reply With Quote  
     

  4. #4  
    Registered Member
    Join Date
    Dec 2013
    Posts
    85
    Thanks given
    0
    Thanks received
    36
    Rep Power
    59
    Quote Originally Posted by Stand up View Post
    I might release it if people would want me too, but I haven't finished it yet, for the moment i'm just looking for opinions.
    please don't release stuff like this. this isn't good design at all. i think you should rethink your current design and see how you can improve it. for improved modularity why don't you consider some sort of quest manager class (one player = one quest manager) that manages all of the quests. you should also have some sort of base quest class in which all of your quests will subclass.
    Reply With Quote  
     

  5. #5  
    Registered Member
    Stanaveli's Avatar
    Join Date
    Aug 2014
    Posts
    1,490
    Thanks given
    184
    Thanks received
    653
    Rep Power
    1338
    Quote Originally Posted by FullyCharged View Post
    please don't release stuff like this. this isn't good design at all. i think you should rethink your current design and see how you can improve it. for improved modularity why don't you consider some sort of quest manager class (one player = one quest manager) that manages all of the quests. you should also have some sort of base quest class in which all of your quests will subclass.
    I think you misunderstood the main post. That's just an example of how the quest stages will be executed.

    There will be an abstract class holding all the functionality needed to check requirements etc. Also I was thinking of implementing Listeners for Object & Npc interactions.
    Keep your head up.



    Reply With Quote  
     

  6. #6  
    Registered Member
    Join Date
    Dec 2013
    Posts
    85
    Thanks given
    0
    Thanks received
    36
    Rep Power
    59
    Quote Originally Posted by Stand up View Post
    I think you misunderstood the main post. That's just an example of how the quest stages will be executed.

    There will be an abstract class holding all the functionality needed to check requirements etc. Also I was thinking of implementing Listeners for Object & Npc interactions.
    i understood what you are trying to say and it's not really an ideal quest system, especially with all of these string literals; it's prone to error. you could clearly introduce a stage system in your quest system which will outline clear goals. ex: each quest will have a collection of stages. it will also hold the current stage that the user is on. a stage will hold the requirements in order for it to be completed (in which it would go to the next stage if there is one). a quest would be completed when all stages are complete. i think you should scrap this and just write the code how you would want to access it, then you could fill in the functionality.
    Reply With Quote  
     

  7. #7  
    Registered Member
    Join Date
    Dec 2013
    Posts
    85
    Thanks given
    0
    Thanks received
    36
    Rep Power
    59
    err.. i wouldn't recommend a singleton approach to quests. remember, each player will likely be at diff points in the quest. ditch the Quests enum and turn the Quest interface into an abstract class, as you can provide a lot of helper methods. not sure how i feel about your QuestActions enum, i probably wouldn't recommend it. if you insist of keeping it, create a Requirement interface and create a class for each type of requirement (action).
    Reply With Quote  
     

  8. #8  
    Registered Member
    danimals br0's Avatar
    Join Date
    Aug 2010
    Posts
    885
    Thanks given
    64
    Thanks received
    94
    Rep Power
    109
    Well, i think best way to go for quests are a step of nodes eg:

    quest.add(new ObjectClickNode(treeId).istantlyAdvance().setNext( new NpcClick(1).addListener(ATTACK_LISTENER).waitForTr igger())

    Edit: this was written pseudo in notepad
    Reply With Quote  
     

  9. #9  
    Registered Member
    Stanaveli's Avatar
    Join Date
    Aug 2014
    Posts
    1,490
    Thanks given
    184
    Thanks received
    653
    Rep Power
    1338
    Quote Originally Posted by FullyCharged View Post
    err.. i wouldn't recommend a singleton approach to quests. remember, each player will likely be at diff points in the quest. ditch the Quests enum and turn the Quest interface into an abstract class, as you can provide a lot of helper methods. not sure how i feel about your QuestActions enum, i probably wouldn't recommend it. if you insist of keeping it, create a Requirement interface and create a class for each type of requirement (action).
    There is an abstract class named DefaultQuest which inherits the interface methods. I was thinking of using the QuestAction enum to support listeners.
    Keep your head up.



    Reply With Quote  
     

  10. #10  
    Registered Member
    Stanaveli's Avatar
    Join Date
    Aug 2014
    Posts
    1,490
    Thanks given
    184
    Thanks received
    653
    Rep Power
    1338
    Quote Originally Posted by danimals br0 View Post
    Well, i think best way to go for quests are a step of nodes eg:

    quest.add(new ObjectClickNode(treeId).istantlyAdvance().setNext( new NpcClick(1).addListener(ATTACK_LISTENER).waitForTr igger())

    Edit: this was written pseudo in notepad
    I don't think that's a good idea, what if you where to add a long detailed quest ?
    Keep your head up.



    Reply With Quote  
     

Page 1 of 2 12 LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Quest system using multidimensional arrays
    By tj007razor in forum Tutorials
    Replies: 25
    Last Post: 07-27-2009, 10:39 PM
  2. New quest system - updated+sample quest
    By tj007razor in forum Tutorials
    Replies: 55
    Last Post: 12-05-2008, 01:47 PM
  3. Fix for T X's Basic Quest System.
    By k1ng 0f k1ngs in forum Tutorials
    Replies: 7
    Last Post: 10-11-2008, 12:24 AM
  4. [508]3M Quest System
    By MoonShade in forum Projects
    Replies: 19
    Last Post: 09-03-2008, 01:39 AM
  5. New quest system - handled
    By tj007razor in forum Tutorials
    Replies: 83
    Last Post: 07-25-2008, 11:51 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •