Skip to main content
GameDev.net gamedev.net
🔒 Locked

Question about RPG quest/story structure

Started by Tesseract Jul 28, 2009 at 3:29 PM 6 replies 3.8k views
Original Post
Tesseract
Tesseract
So I am working on an adventure/RPG, and it is quickly becoming apparent to me that the story/quest structure will be the most intricate and difficult part of the game. Here is a snippet from the (rough) design document I have put together to help me think these things through. It shows the different parts of a quest, as far as I have been able to figure them out.

id    -    "farmerBobApples"
title    -    "Buy Apples for Farmer Bob"
prerequisites - quests.killedThreeRats.isComplete=true&quests.farmerBobApples.isInitialized=false&quests.farmerBobApples.isComplete=false&player.level<5
intro_text    -    "Oh, deary me! The cows ate all the apples from my tree, and the Missus will have a fit if I don't get her the fillings for her pie! Can you help an old farmer out?"
prompt_accept_text    -    "Sure! I'd be happy to help!"
on_accept_text    -    "Oh thank you so much! Half a dozen apples should be enough."
on_accept_state    -    quests.farmerBobApples.isInitialized=true
interim_query_text    -    "Time's a' wastin', youngster! The missus will be home any minute!"
on_complete_criteria    -    quests.farmerBobApples.isInitialized=true&player.inventory.apples>=6
on_complete_text    -    "Oh, thank you so much! For your kindness you can have this pair of boots. They don't fit me any more."
on_complete_reward    -    player.inventory.apples-6&player.inventory.clothing.boots+1
on_complete_state    -    quests.farmerBobApples.isComplete=true
prompt_decline_text    -    "No! I hate apples, and you should too!"
on_decline_text    -    "Well, the world is an imperfect place. If you change your mind, and the missus doesn't throw me out, I'll be here."
on_decline_state    -    quests.farmerBobApples.isInitialized=false
on_decline_reward    -    player.statistics.reputation-1

id is the unique identifier of the quest prerequisites is various criteria for the quest to be triggered the _text variables are the various dialogues involved in this quest on_complete_criteria specifies the criteria for completing this quest on_accept_state,on_complete_state, and on_decline_state modify the state of the game, based on player actions on_complete_reward and on_decline_reward modify the player based on player actions. prerequisites allow for previous quests to be complete in order for new quests to be triggered, in effect allowing for the nesting of quests to create larger narratives. on_complete_criteria can take any number of events, allowing for the creation of extremely complex quests. Effective use of prerequisites and on_complete_criteria can allow for this structure to be turned into a complete story engine for a fairly complex game. So: Am I missing anything critical? Thanks for your input!
doomhascome
doomhascome
Doesn't look like theres anything missing, at least as far as I can see. However, this presumes a very WoW-like quest structure. Also, can you manage multiple conditions to complete quest (such as: give me 10 of item A, 2 of item B, and a stew from person C)
Nick_N
Nick_N
Add more depth into the quests. For example, let players have other options rather than "Yes" or "No".

For example, maybe a option to say "Hmm...I am interested" and then the quest giver will give you more details of the quest. And then maybe another option of "Who are you", this one is very popular, and this will introduce the quest-giver. This option gives the quest giver more depth and adds more of a story line in the game.
kamokow
kamokow
It looks pretty good to me, it follows the same basic structure that you see in a lot of games, but not in a way that is necessarily bad. I dont see anything missing, however I agree with the idea of adding a bit more variety to the options, "Who are you?" etc.

All in all though, it looks setup very well, and I wish you luck with your game <(^^,)>
---Signature---When life gives you lemons, clone those lemons, and make super lemons.
Tesseract
Tesseract
Ah! Good suggestions! I like the idea of quests doubling as ways to open up more detail about the story/world in that way. An arbitrary number of inquiries...hmmm...

@doomhascome - the on_complete_criteria can have an arbitrary number of criteria associated with it, e.g. player.level>5&player.inventory.gold>1000&player.inventory.goblin_ears>=3&...etc.
TechnoGoth
TechnoGoth
Looks fine, although you'll get a more power, flexibilty, and ease of use out of the systen if you use XML to define your quest structure.

You might also want to think of using a finite state machine for your questing engine. That way it maintains its own state and moves to the various states of the quest.

If you build it right then adding, and changing quests is a simple as maintaining a series of xml files and their are plenty of apps out there for that.
Tesseract
Tesseract
Ultimately this will all be handled by XML files, both internally and externally. Right now I am just trying to figure out what the data structures will be.

A finite state machine. Hmm... I have never built one of those - web development so seldom calls for something like that. Well, no time like the present!
Edtharan
Edtharan
Finite state machines are fairly easy to implement. The real difficulty lies in not designing them to enter a locked state (going round and round a few - or even just one - states).

The best idea is to draw them out on paper or a vector drawing program. You don't have to be too neat, just neat enough for you (and anyone else that needs to) can read it.

In code, they can easily be handeled by a Switch/Case statemnt like this:

Main Loop{   Switch      Case: State=1      {         Do Stuff for state 1 here.         Set new state if needed.      }      Case: State=2      {         Do Stuff for state 1 here.         Set new state if needed.      }      Case: State=n...      {         Do Stuff for state 1 here.         Set new state if needed.      }   end Switch}End Main Loop


All in all pretty simple to implement.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.