(WIP)[RPG] QuestBook - Dynamic quest creation with endless possibilities

Discussion in 'WIP and Development Status' started by 2n3904, Aug 15, 2011.

Thread Status:
Not open for further replies.
  1. Offline


    I've been developing a quest plugin for Bukkit recently, since the ones out there currently don't really fit the niche that I want them to - something with the kind of possibilities you can find in MineQuest, but more accessible and stand-alone - something like EpicQuest, but much more versatile in quest creation. I'm almost completely new to coding with Bukkit & Java (in fact I hadn't even tried Java until a little more then a week ago). I've made some simple plugins in my learning experience so far, including a full featured teleport plugin from scratch (mainly to have tping with selective cross-world teleport prevention).
    Obviously this is kind of a momentous undertaking for someone so green: yes, I know I am crazy. However this plugin lets me explore basically every aspect of programming in Java + Bukkit, and I learn best by smashing my head against something until I comprehend it...

    When Will It Be Released?:
    I've been happy with the speed of progress I have made so far but that has also resulted in a lack of extensive bug testing. So keep in mind that this may take a while to complete, even though it seems far along at the moment - I will likely go back and rewrite large sections of it as I find better ways of doing things, hopefully to make this airtight for a proper release. I will however be happy to supply a beta version sometime soon for people to mess around with (meaning not really properly server-safe, just for people to play around with quest creation on private servers or w/e). It'd be nice to get feedback from people who are actually trying the real thing out.


    This plugin is a dynamically linked event chain quest creator - based in custom-written yml quest files. It's as functional as the kind you find in MineQuest (with tons of possible trigger/events). Hopefully, not too hard to get the hang of either.

    Example Quest Video (Early Dev Test):
    Here is a short video of a quest I made for testing purposes. Remember, everything in the vid is subject to change farther down the line. Hopefully this gives you a basic idea of how the quests can work, though. This took maybe five-ten minutes to write. The most annoying part of the quest creation process is getting the coordinates for PLAYER_MOVE and BLOCK_SET kind of events. See below in to-do for a proposed solution to this annoyance.​

    Plugin Core:
    Custom quest files are stored as .yml's. Basically, the quest files are structured into a list of Triggers. Each trigger has a number, and the following properties:
    - Type: Type of this trigger, and its parameters.
    - Settriggers: When this trigger is called, enable these triggers
    - Clrtriggers: When this trigger is called, clear these triggers
    - Actions: List of actions to do when the trigger is called.

    Each player has a list of available quests, which can be obtained in a couple ways: playing other quests, getting them from admins, clicking signs...

    Available Quests are started by /qstart <name>. This command simply enables the #0 trigger. The parameters of this zero trigger therefore become the quest start conditions : If you want the quest to only start when a player moves somewhere, for example, you just have your #0 trigger be a player_move. Then when the player starts the quest with /qstart, events will only truly begin when they get to that area. /qstart is more of a "enable this quest to happen".

    The above format allows a huge variety of linking possibilities. You can have one trigger enable four possible triggers, all of which branch off into their own direction. You can have looping triggers, where the trigger is always active until you trigger something else. You can loop entire sections of the quest if you want - go back to the beginning! Move from branch to branch! Obviously getting to those levels of complexity gets tricky in writing (keeping track of all your trigger numbers). That's inevitable. However, smaller quests are extremely manageable to write. There are some checking features included in the plugin which will cancel the quest on severe problems (and tell you what they are) - such as the quest not having any current triggers, or there not being a start trigger... etc. I hope to contain people's questions on why their quest isn't working to looking at the console. (For both of our sakes, haha)

    Here is an example quest (One of the ones I have been using for testing). Note that it makes no sense - its just random events. Also note that this is not the final format by far. There will be a bunch more options to mess with. This is just to give you a basic idea of how the quests are written.

    name: Example Quest
    description: This quest is just random events for testing, really.
        remove: true
        remove: true
        remove: false
        save: true
            type: PLAYER_DROP_ITEM,32
            settrigger: '1'
            - player_teleport,Palace,167,84,-17
            - block_set,Palace,167,85,-15,43
            - player_messaget,BLAHBLAHBLAH
            type: PLAYER_PICKUP_ITEM,32
            settrigger: '2,4'
            clrtrigger: '0,1'
            - block_set,Palace,167,85,-16,54
            - block_fill,Palace,167,85,-16,54,6
            - player_message,A Mysterious Chest!
            type: PLAYER_BED_ENTER
            settrigger: '3'
            clrtrigger: all
            - player_give,42,20
            - player_message,Enjoy your iron!
            type: PLAYER_ITEM_HELD,42,10
            - player_heal,20
            - player_message,WELL DONE! QUEST FINISHED!
            - quest_complete
            - quest_enable,holygrail
            type: PLAYER_MOVE,Palace,170,80,-17,172,85,-12,TRUE
            - player_damage,4
            - create_lightning,Palace,167,85,-16
            - player_message,YOU FAILED. Totally.
            - quest_fail
    So basically, the quest plays out like this: You start the quest at trigger zero. This is an item drop trigger - it has one parameter, the itemId to drop. Once we drop a 32, the trigger plays out. It ENABLES trigger 1. Then it CLEARS nothing (this means trigger 0 is still enabled!). Then it plays out everything in actions: We see that that includes teleporting a player to the location 167,84,-17 in the world "Palace", changing a block in "Palace" and finally sending the player who triggered the event a pointless annoying message.

    Now the quest has triggers 0 and 1 enabled (1 was enabled, 0 wasn't disabled). So we can endlessly play out the first trigger by continuously dropping more 32's! Or, we can play out trigger 1 by meeting it's PICKUP_ITEM trigger. Again, the parameter is 32 - so once we go and clean up our messy 32's everywhere, this trigger is enabled. This trigger clears trigger 0 and 1 so we cant do anymore pickup/dropping. And it sets 2 and 4. Now we have two possible branches to go to. (also, it creates and fills a chest in Palace, then sends a message).
    If we trigger the player move (which has the parameter of two cuboid vertices, and a true/false which determines if you enter or exit the area) we trigger lightning and a quest_fail! This will fail the quest for you. If we entered a bed for 2, instead we are on a new branch which eventually leads to a quest_succeed!

    Note that if you get sick of the quest you can /qcancel at any time. There is an oncancel: node in the yml quest file that determines whether your place in the quest is saved for later on cancel or not.

    CURRENT STATE (Updated 8/18/11):
    • Sequenced-Trigger based Quest Creation:
      • Quests are dynamically linked by a list of triggers, each of which enable/disable other triggers upon activation : enabling looping triggers, branching quests, looping quest sequences..
    • Trigger Conditions: [new]
      • Just added optional trigger conditions. Want a particular trigger to only play if you are carrying a sword? Or carrying something in your virtual quest inventory? Or are currently sneaking? Or all three at the same time? Trigger conditions are written in the same format as actions are, in a simple list with parameters separated by commas. NOTE: example quest file not updated to this new format, will be soon.
    • Chained Quests:
      • The main method of obtaining available quests: You can enable a new quest as an Action in another quest. Enable different quests depending on how you play out a previous one! Chain-link quests into one enormous epic!
    • Huge List of possible Actions:
      • Currently, there is a library of actions to play out basically anything in minecraft. Give players items, take items, send messages, strike lightning, do damage, heal players, create/destroy blocks, fill chests, empty chests, set players on fire... Everything! I'll keep adding things as I come up with them. If you have suggestions, please give them!
      • Code:
    • Huge List of possible Triggers:
      • Basically, anything that a player can do in minecraft is a possible trigger for this plugin. Breaking/creating blocks, pouring/filling buckets, entering/leaving beds, saying messages, typing commands, clicking on blocks, etc.
    • Quest Statistics: [new]
      • Each player has a quest book accessible by /qbook. This lists the player's current quest, currently available quests, completed quests, and failed quests. Players can check out other player's quest history (current, completed, failed). Players can also check out the top questers, based on the completed/failed ratios.
    • iConomy Support [new]
      • Just added in iConomy support. Edit your player's money using quest actions!
    • Virtual Quest Inventories [new]
      • Players get a "virtual inventory" wherein quest items are stored. For example, an action will give you the virtual item "The Holy Grail". Use quest items to give players retrieve tasks, or virtual "books" and "scrolls" that contain special clues!
      • Quest Permission Nodes [new]
      • Option of placing a permission node restriction on your quest! Assign your quest to only particular groups. The same node can be used for more then one quest.

    • Quest Saves [0% done]
      • Choose whether a player's quest is saved on /qcancel or on player quit for each quest! Return to your position in quests later, if you get tired of them. Automatically save a players position in a quest when they get to it!
    • Create a Party System [0% done]
      • I'd like to get a party system in place eventually. Self-explanatory.
    • Create Unique Triggers
      • There are some unique triggers that need developing: for example, a timer trigger: associated with a timer Action. Basically, you set the timer in the action and enable the new timer trigger during the same Trigger. If you don't play out triggers in time to disable the timer trigger, then the timer trigger activates! Do race-against-the-clock style situations in your quests.
    • Interface with other plugins
      • In the end, I hope to have this plugin play nice with many of the popular ones out there. You'll have to give me an idea of what kind of plugins would work well with it. mcMMO (party/experience rewards) and Citizens (NPC triggers) both come to mind.
    • Helpful Quest-Building Tools Built-In [25% done]
      • I will make a few handy tools to make building quests as painless as possible : for example, getting all the coordinates for actions like changing blocks or teleporting players gets annoying fast - so I will make a in-game admin tool where you can click blocks in-game and it will spit out the coordinates (under a given tag) into a temporary list on the quest file you are working on. Additionally, I will make a command to write new quest file templates into the quest directory, to save some copy-pasting.
    Anyways, I hope you guys find some of this interesting! I'd love to have feedback - in any category. Please, let me know what you think!

    NOTE: I HATE this forum's list creation XD
    undeadmach1ne likes this.
  2. Offline


    I had a similar idea, but for tutorials... I like it :)
  3. Offline


    Cool. :)
  4. Offline


    I don't mean to burst your bubble or anything, but what about EpicQuest? It seems simpler for the common user and further along in production.
  5. Offline


    I mentioned the reasons for making this despite EpicQuest. My issue with EpicQuest is that it can't do complex quest sequences, and has a very limited amount of possible situations and experiences. What i'm trying to do is make a quest plugin where you can truly make an 'Epic' - a kind of quest that can have multiple paths to succeed/fail on, how you complete one quest influences other quests - a Minecraft build-your-own-adventure kind of story. A plugin that lends itself to simple questing situations like gathering wood and giving it to a NPC but equally well to something like "journey to the castle, talk to the guard, obtain dungeon key, enter dungeon, search for the holy grail" - all the while springing traps/side-quests on the player. I wanted to allow the user to do just about anything they can possibly imagine.

    My target audience for this plugin is less common user, and more people who don't mind doing a little work to bring what's in their mind into their server. At the same time, i'm trying to make it so the "common user" can set up simplistic quests and get them working correctly without too much trouble. I'm hoping to do some streamlining towards the end of development to further simplify the config syntax. And as I mentioned, I will be putting in a lot of error checking into the plugin to aid quest writers in figuring out what they did wrong.
  6. Offline


    Can you put NPCs up after Quest Conditions? :p

    I'm hoping I could do a whole adventure quest with talking to NPCs, finding items, and going through dungeons with this plugin. Then create "side quests" that players can talk to NPCs and help them. :)
  7. Offline


    ^ That's exactly what this plugin will do, in the end :)

    NPC's are definitely going in eventually, whether by being part of the plugin or linking with something like Citizens. They will be a big part of it.
  8. Offline


    Awesome! A quest plugin like this is exactly what I need to complete my server! I'm so excited!

    Can you add ability so new players who joined the server automatically start a quest?
  9. Offline


    Cool idea, lots of work :) Hope you have the endurance and lots of coffe :) I'll surely use this once you released it!
  10. Offline


    Sure, that'll be a useful one. I'll put an option for it in the main config. Also, i'll put an option for list of quests that automatically become available to new players.

    Lots of work for sure! But it's fine, since I am learning java on the way it is enjoyable at times and isn't just hashing out code.

    Finished a preliminary condition system, working well. Still need to build up a library of conditions to use.
  11. Offline


    To give you ideas, I'll paste the things I wanted to add to Tutorials, once I get my list off my other computer.
  12. Offline


    That'd be appreciated! :)

    Put up a quick quest video so far, a barebones demo quest I wrote in like 10 minutes.
  13. Offline


    Here goes (it was just the result of being bored on an airplane so it's probably not all that good, and comes with no code or anything):
    #default config
    tutorials: #list of tutorials
     The Basics: #tutorial name
      description: Getting Started #take a guess
      permission: none #default, don't need any perms
      cost: #cost to start the tutorial, this is default:
       money: 0 #uses Register
       items: #list of items to take from inventory
      reward: #reward for completing tutorial, same defaults as cost
       money: 50
       items: #use item:amount:data (can use black wool:10 or wool:10:15 or 26:15:15 or whatever)
        - 271
        - arrows:64
      list: #choices: all, permissions, none, defaults to all for both, steps can be none, done, todo, or all, defaults all (all choices include current one)
       todo: all #everyone can see in their tutorials todo list
       done: none #noone can see in their finished tutorials list
       steps: all #show all steps to finish tutorial
      repeat: 1 #default 0, number of times you can do the tutorial (0 = infinite) - will leave todo list after first completion and show in done list with the number of uses left, following the listability rules except if it shouldn't show in done list
      time: 10 #0 for infinite, in minutes, 0 is default, will cancel the tutorial
      cancellable: true #default, if false cannot cancel (kicks after time limit instead, with explanatory reason)
      alone: true #default false, cannot start other tutorials if this is true and this is running, cannot start this if this is true and others are running
      messages: #all defaults are "none" or no message
       confirmation: none #if not "none" will display message and ask if you want to continue when you type /tutorial start <name>
       start: Welcome to the server!
       help: Let's go through some basics...
       end: Well done! Go ahead and play!
      steps: #list of steps in this tutorial
       Reading the rules: #name of step
        permission: none #if you don't have it you skip the step (shows in list though, following listability rules), overrides skippable
        messages: #start and help are shown at beginning, help when you ask for help, hint when you ask for hint, answer when you ask for solution, end when you finish - default is "none" or no message, hint defaults to help, answer defaults to hint
         start: First off, we have to read the rules.
         help: Type /rules for the rulebook.
         hint: Type /rules to continue.
         answer: JUST TYPE /rules!!!
         end: Good job! Moving on..
        cost: #you know what this does
        reward: #this too
        skippable: false #default
        action: #command, area, chat, break, place, or any combination (when all are met (not necessarily simultaneously or in correct order), step is over)
         command: /rules #finish step when you type /rules
        time: 1 #minute, 0 = infinite = default, skips step after runs out, if skippable = false it cancels the tutorial, if cancellable = false it kicks with explanatory message
       Introducing yourself:
         start: Let's let everyone know who you are.
         help: Introduce yourself!
         hint: Say "Hi!" and "My name is..."
         end: Awesome :) Nice to meet you.
        time: 2
         chat: #not case sensitive, /.../ denotes case-sensitive regex
          - Hi!
          - My name is /\S+/
    That was as far as I got.
    Oh, and where's the video?
  14. Offline


    Hey thanks, that gave me some ideas. Notably permission group-sensitive quests - that's a great one.

    The vid was not very prominent in my wall of text post! I put it in a more blatantly obvious section.

    • Went back and rewrote 1/3rd of the code to make it much more programming friendly, it was getting a little messy.
    • Added in the previously suggested available-Quests-on-first-login mechanics, as well as an option to have a particular quest auto-start then as well.
    • Added some block based events.
  15. Offline


    sounds awesome!
  16. Offline


    I'm going to ask for your help, everyone: Tauryuu, your input would be much appreciated on this one.

    If anyone has checked out this plugin so far and thought "Oh, I know exactly what I want to do with this when it comes out" - Please tell me! I want to hear your ideas for how you want to make your quests, in as much detail as possible. Don't leave out anything because you think "It's too absurd!". I want ideas on what kind of options would best suit this plugin. I'll try my best at making exactly what you want possible be possible in this plugin.

  17. Offline


    well from what i have read, you have all the bases covered to let us do pretty much anything we could imagine. i would love to use this to create a huge quest like the main story quest from a game like morrowind, surrounded by separate sidequests that are optional. some things that are popping into my head right now:

    -the ability to execute /commands with triggers so we could do things like starting a zombie apocalypse from zombiecraft (/zc start) and then the players have to find a way to stop it (/zc stop), possibly using a bunch of other triggers in between like talking to npcs for hints on what to do or where to go etc.

    -the ability for questbook to form parties for quests. it would be cool if it 'knew' the players were already in a party from other plugins like mcmmo or some of the new standalone party plugins, but that would get ugly for you trying to support tons of other plugins i imagine. maybe an easier way would be if questbook had its own quest party system where you could invite or ask players in the vicinity of a quest getting received if they want to be in the group and share the rewards. also, multi-person triggers...like a room with multiple switches that have to be activated at the same time...stuff like this might already be possible with your current setup though...

    -maybe integration with bookworm so that questbook can see/use specific books written in bookworm for triggers.

    thats all i can think of for now but im sure ill think of more :p
  18. Offline


    Already in place, in its simplest form - you reminded me to go ahead and add in <player> support to the commands, so they can be executed on the quester! Done!

    Also, I will add a separate action with permission bypass.

    Party/coop systems in some form are definitely in my plans - this is probably one of the more difficult aspects of writing this plugin. I still have alot of thought to put into this section : coming up with mechanics that won't make things too complex.

    I'd really prefer writing my own party system in the plugin - it would be such a core part of it in the end, and I don't want that delegated to another plugin. It does conflict with mcMMO (well, it annoyingly duplicates), which is a shame since I plan on adding support for that (mainly in regards to rewarding XP)

    Hmm, like you said too much plugin integration gets painful. I will update the virtual inventory system to better support lengthy books, however. I wanted to be able to have written letters/books/scrolls included for quest clues and general world-building purposes.

    Thanks a lot for the input!
  19. Offline


    nice :)

    maybe just an additional hook or check to say 'all these guys are in an mcmmo party together, lets ask them if they all want in on this quest'? other than that i think a questbook 'quest party' or something similar would be better than trying to duplicate or replace that function...all it does in mcmmo is turn of pvp for the players and allow them to use party chat...

    yeah i agree...the only reason i thought of bookworm is because afaik its the only way to actually write in a book...which would be very cool for things like finding an ancient tome/journal for clues. it also allows you to put books in bookshelves and then take copies or simply read them by clicking the shelf. something like that would open a world of possibilities for narrative/lore to build an adventure on...i already plan to use it like an oldschool dungeon master from paper&dice rpgs on my server as a way to teach the players new things (like instructions on using creativegates plugin and things like that) as rewards/loot by hiding them in libraries and dungeons...i guess on that note, even if you dont support them directly i can still use them to augment questbook by planting clues in them.

    thanks for considering my input :) i have a feeling ill be one of your biggest fans lol :p
  20. Offline


    no way im her biggest fan!
  21. Offline


    Is this plugin still alive?
Thread Status:
Not open for further replies.

Share This Page