Advertisement

Quest Database Structure/Design

Started by October 11, 2006 07:55 PM
16 comments, last by Kylotan 18 years ago
Hello, I've been developing a web based game for a few years now. I have had the simple database structure (as you see below) implemented for the most part of the project, except for the 'Quest System' I've highlighted there. The database i am using is MySQL and PHP for the web side. I've recently added the quest design to the database, however it is not yet implemented into the game. I will go further into the table explainations later. For now, as many of you should see, the quest design will work if you can follow all the paths.
Database Design
"tblNPCConv:" It allows for a 'Keyword' to be said to an NPC, giving the NPC the ability to say a certain text whether it is 'Starting' a specific quest (startquesttest), 'Ending' a quest (endquesttext), or not yet finished a specific quest (convtext). A quest only gets created if the 'QuestDetailID' has an ID in it, otherwise it is just normal Character/NPC conversation and 'convtext' is used. "tblQuestDetail:" This stores the relevant quest data. At present, it only allows for a simple quest of killing a certain monster (monstID), # number of times (kcount). Through tblNPCConv, each QuestDetailID record can flow to the next via the 'QuestDetailID' and 'PreQuestDetailID' which stores any prerequisite ID's. "tblCharQuest:" This holds the links between the Character and the Quests, it stores whether the quest has been completed and also if the row exists, then the player 'has' started the quest. That should cover most of the tables that require explaination, the others are fairly straightforward but if you have any questions, please don't hesitate. So unless I have made some bad errors in this design, it should work in the system quite well. However it only allows for a 'keyword' based conversation system. Now why have I started this post? This system as I said is a 'keyword' based conversation system. I created it like this purely as a quick design to get the quest system started. However I don't want my game to be keyword orientated. I want it to be a multiple choice conversation system. e.g NPC: "Good evening Sir, may I help you anything?" Answer: A. "Good day, I'm looking for some swords, can you help me?" B. "Have you heard about the recent plagues in the area?" C. "No thank you, I'll be on my way." This is what alot of older Adventure type games have, they also most likely had fixed answer systems for certain conversations, being also that you could not have the same conversation twice and each answer depicted perhaps a branch in the quest tree. I know there would be some dynamic conversation systems like what I'm looking for, I'm just having a little trouble coming up with a multiple choice answer system in my database. So does anyone have a few ideas or hints for me? Perhaps you've come across the same problems in your games? If you wanna make any comments on the design too don't hesitate to give some improvements or whichever. Thanks alot.
\bump
Advertisement
I'm not quite sure I understand you. Perhaps you could ask in the AI forum? I'm sure they have more experience implementing NPC's than we have in the webdev forum. Let me know if you want me to move the thread to the AI forum.

<hr />
Sander Marechal<small>[Lone Wolves][Hearts for GNOME][E-mail][Forum FAQ]</small>

That would be good actually thanks alot :)
Moved to AI.

<hr />
Sander Marechal<small>[Lone Wolves][Hearts for GNOME][E-mail][Forum FAQ]</small>

Well I've been adding more and more things and I've got the Multiple Choice design in the database.
I left the keyword system there so that my 'multiple choice answers' actually hold a keyword that activates certain conversations branches etc.

I have new answers in the multiple choice table that become enabled once an NPC has said a specific word, then the player can start asking that NPC or other NPC's about the subject he's just learned about.

Each player has his own answer list that he 'knows' and, can say things from this list only..

The only problem I have is figuring out which answers should be displayed in the conversation menu..
A player may have 50 Answers in his file, 10 are for a specific NPC who he's talking to right now.. How can I limit those 10 down to 3 or 4? Note that any new Answers he 'learns' from the NPC he should beable to say straight away.

So either in the Code or in the database I need to beable to pick 3 Answers the player can say, that aren't just randomly picked from the database, and that are somewhat intelligent answers..

Can anyone help with this? I just don't know how the older games used Multiple Choice systems... any help at all would be much appreciated.


Advertisement
I think you're overcomplicating matters. To decide what needs to be shown, compare the player's allowed answer list with the NPCs available answer list and show the ones that match. Where's the problem? Is it because you want fewer answers? Is it because you are trying to shoehorn a wide variety of possible topics into arbitrary groupings of related responses? Don't twist the game to fit the system, twist the system to suit the game. There's no point using a multiple-choice system if your game doesn't actually have data that requires making such a choice.



Shouldnt the tblNPCConv be linked to the tblQuest data??
I would have thought that would be a very specific for a particular quest
template.

Maybe tblQuest and tblQuestDetail should be consolidated?????

If tblQuest is a superset for a multi-stage quest, then shouldnt the
tblCharQuest have a reference to it (and thus to the sub-stages) and then the one to the particular substage...

Of you are going to have scripting, you might want to have hooks to the
script DLL routines(pointer) or file or string.
"tbl" prefix?

You do realize I'm now going to have to come to your house and kill you, after which I'll use holy water to destroy your copy of Visual Basic 6 in order to prevent it from stealing yet another soul.

And yes, I normally use this space to deride people for using MySQL for anything outside of their useless "blog", but comparing MySQL to VB's object naming prefixes is like comparing Charles Manson to Hitler. My soul crushing needs priorities.
From what has been written, it appears that during a conversation with an NPC, branches in the topic appear based on what has been said... and the problem is that if you include all of the possible responses to all of these branches, there's too much for the player to consider in a single list. Is this correct?

If this is the problem, one simple way around this would be to alter the interface to limit the view to responses regarding a particular topic, as selected by the player. So, a popup menu listing the topics would allow the player to select a topic of converstation. Then, based on that selection, all appropriate responses are displayed. You could even permit the player to return to other topics once they've exhausted a particular thread, just by selecting another topic in the menu. If you want to prevent topics from being revisited, remove them from the menu.

I know this is moving away from the original design based on sentence content and keyword, but it addresses the problem of content management through the interface, which is where it belongs, rather than an ad hoc AI that decides on what to talk about.

Cheers,

Timkin

This topic is closed to new replies.

Advertisement