About Store Forum Documentation Contact



Post Reply 
quest Editor
Author Message
yvanvds Offline
Member

Post: #1
quest Editor
Hello again.

I've made a small quest Editor and I thought it might be useful for other projects also. It's intended to be used from within my game, but I made a standalone version first for easier testing.

It might be handy if the people who are writing quests in your game are not programmers. The download includes a compiled version which serves as a demo, and also has all the source code because you will have to adapt it to what you want to do.

The interesting things that are implemented are:
* Drag and drop objects to construct a quest: start, talk, question, random, goal and reward.
* Objects can have properties that you can change from a dialog box.
* With a simple outlet/inlet system you can create lines between quest objects, so to form the quest logic.
* There is a test function which performs a check of your current quest, highlighting the parts that were ok and the ones that were not.
* Quests are loaded and saved in XML format. (I have included one example quest)

Things you have to work out yourself:
* adapt quest requirements, goals and rewards to your own game.
* add 'deploy' functionality to send the quest to the server or something. This is game dependant so I have not included it.
* add auto-complete and other functions for finding other quests' names, npc names and such. This also depends on how your game works.
* it's not an actual quest system. You still have to write server and client code to use the generated information.

So it's not usable out of the box, but it will save you a few days of work if you'd like a similar system. And in any case it contains some useful code for if you want to do custom gui stuff.

the code can be found here: http://www.attr-x.net/downloads/questEditor.7z

cheers!

yvan
01-30-2012 06:21 PM
Find all posts by this user Quote this message in a reply
dragonfly3 Offline
Member

Post: #2
RE: quest Editor
Awesome! Thanks for the share! I'm sure this will prove very useful for our game so I grabbed it. smile
01-30-2012 06:44 PM
Visit this user's website Find all posts by this user Quote this message in a reply
runewake2 Offline
Member

Post: #3
RE: quest Editor
This looks awesome, I'll look into this further when my game gets further along.
01-30-2012 10:19 PM
Find all posts by this user Quote this message in a reply
dylantan Offline
Member

Post: #4
RE: quest Editor
This is good stuff. Thank you very much yvanvds. The timing couldn't be better as we are looking to implement our quest system and your apps could really help reducing the work load! THANKS!
01-31-2012 05:27 AM
Visit this user's website Find all posts by this user Quote this message in a reply
yvanvds Offline
Member

Post: #5
RE: quest Editor
Thanks people, I'm glad you like it.

I'm starting to work on the actual quest implementation now. I'll post the code when it's ready, although I'm not sure how usefull it will be. My game doesn't have XP/levels or monsters to kill, so it might be a bit different from what you all need.
01-31-2012 10:42 AM
Find all posts by this user Quote this message in a reply
Barthap Offline
Member

Post: #6
RE: quest Editor
Awesome! Really good and simple editor. And big plus for nice GUI. wink

P.S. Sample quest-game wrapping code would be good grin
01-31-2012 12:10 PM
Find all posts by this user Quote this message in a reply
Dynad Offline
Member

Post: #7
RE: quest Editor
Just took a peak, it's very handle for people writing quests indeed.. =)

There is always evil somewhere, you just have to look for it properly.
01-31-2012 12:18 PM
Visit this user's website Find all posts by this user Quote this message in a reply
yvanvds Offline
Member

Post: #8
RE: quest Editor
It's been a while, but I just remembered I promised to post some more code here.

My quest system is finally done, but evolved more or less into a story-telling system. Therefore I doubt much of the more recent code is very useful for anyone else. And since i would have to rewrite lots of it to make it understandable without seeing the whole picture, I'm not going to post it.

Still, I did promise I would. So if someone has specific questions about integrating quests or something alike, I am happy to help out if I can.
05-01-2012 09:51 PM
Find all posts by this user Quote this message in a reply
Magnets Offline
Member

Post: #9
RE: quest Editor
I'd like some tips on how to create a 'complex'-ish quest system, if you don't mind. One that has, for example, multiple ways to end it? Or different dialogue paths that can be taken.

Would this be possible to create using a typical "quest system" or would I need to code them all into the editor myself?

I hope that's a question I could ask, haha.
(This post was last modified: 05-02-2012 02:40 AM by Magnets.)
05-02-2012 02:38 AM
Find all posts by this user Quote this message in a reply
yvanvds Offline
Member

Post: #10
RE: quest Editor
Constructing complex quests is demonstrated in the code i posted before. Getting it to work is another thing. I'll give you a few hints.

Storing your quests
One way or another, you will have to save your quests to a database. Since the quest can contain an unlimited amount of steps, you can't create a table with one field for each step. You could link to another table which would contain all steps from all quests, but that is an enormous overload.

I just create a file and have all steps save themselves in that file. The file is added to the quest table as a binary field. On starting the server, you create all quests in memory, and unpack the binary field. This way the server stays responsive.

Of course you could also have a folder with an xml file for each quest and load these on server start, instead of a binary database field. I prefered to have the info together with everything else in the database, but there's no real need for that since you will load everything at start time anyway.

If you do not have an editor for your quests, you might prefer the xml way because it's easier to maintain.

lists
You need several quest lists in memory:
  • One with the full quests and an ID.
  • for faster lookups, i made a list of npc's that contains the ID of quests that start at that npc. The list is made at server start but not saved. This way it's easy to send available quests to a player once an npc comes within range. You will still have to check the quest's requisites, but you don't have to go through the whole database. Another approach would be to have lists for each zone, but i prefered npc's.
  • each player needs a list of eligible quests. When an npc comes within range or goes out of range, you can add or remove quests to this list. Changes to the list are sent to the client. (The whole action with npc's coming within range can be triggered from the client, by overriding the enable and disable function in Game::Chr.)
  • depending on requisites you have for quests, you also need to create other triggers for checking the eligible quests again. For example when the player gains a level. This also means you have to maintain a list of which npc's are currently in range. It's only those quests you have to check again. Other quests are checked when an npc comes in range.
  • you also need a list for each player with the ID's of active quests and the current step the player is on. This should be save in the database, with the player. Since you don't know how many active quests there are, I think it's most easy to save ID and current step to a file and put that in a binary field.
  • another list has to contain the ID's of finished quests. You need that for questlines and such. This should also saved with the player, just like active quests.

Logic
When a player starts a quest, just send him what he needs to know for the first step. This could be a dialog text, or a question with possible answers. The bottom line in this is, just send the information the client needs right now. The client must ask for the next step, providing information like an answer if needed.
On the server you have one function that takes the current step (and possibly an answer) and decide what the next step should be. Steps could be new dialogs, questions, activities (extra code is needed to know when they are completed), rewards and eventually a quest end, at which point you delete the quest in the active quest list and add it to the finished ones.

That's it. You're done grin
05-02-2012 02:41 PM
Find all posts by this user Quote this message in a reply
Post Reply