Procedural quest generation

In the other thread, a judgment system gives characters:

  • An importance value for each Motivation (Security, Pleasure)

  • Affinity values (like/dislike) toward other characters.

Characters also have other data that I’ll describe by way of an example quest:

Farmer Fred offers the player 50 gold to kill 5 wolves in his field.

  • World State Observers: Information the NPC is interested in tracking (e.g., the number of hostiles in the farmer’s field). World State Observers are semi-hardcoded right now. This is a weak point in the system.
  • Quest Assets: Prefabs the NPC can spawn when creating quests (e.g., a wolf spawner). They have motivation values, and some other attributes to help choose appropriate assets.
  • Rewards: Things the NPC can offer the player to take the quest, such as currency.
  • Dialect: A lookup table of phrases. The “Hello” lookup for a knight could be “Salutations, good sir,” while for a pirate it could be “Ahoy, matey!”

The system (not individual NPCs) also has a library of Quest Templates and Conversation Templates.

A Quest Template defines a generic quest structure. For example:

Quest Template: KillTargets

  • Conversation: KillTargetsConversation (one or more quest conversations; see below)
  • Description: “[giver] has offered you [reward] to [kill] [count] [targets].”

A Quest Conversation defines a generic conversation that can be used by quest templates.

Quest Conversation: KillTargetsConversation

  • Giver: (new) “[Hello] If you [kill] [count] [targets], I’ll give you [reward].”

  • Player: Okay.

  • Giver: (active) “Have you killed [count] [targets] yet?”

  • Player: No.

  • Player: Yes.

  • Giver: “[Thanks] Here’s [reward].”

  • Giver: (done) “Thanks for completing the quest!”

So for the farmer’s quest: He has positive affinity for the player, so he’ll offer a quest. His field is empty, but he has a wolf spawner in his assets. The KillTargets quest, combined with the wolf spawner, meets his primary motivation, which is Security. His resources include 50 gold, so he offers a 20 gold reward, which is equivalent to the difficulty value of the wolf spawner. The generated quest looks like this:

Description: “Farmer Fred has offered you 20 gold to exterminate 5 wolves.”

  • Farmer Fred: (new) “Greetin’s! If you exterminate 5 wolves, I’ll give you 20 gold.”

  • Player: Okay.

  • Farmer Fred: (active) “Have you killed 5 wolves yet?”

  • Player: No.

  • Player: Yes.

  • Giver: “My thanks to ye! Here’s 20 gold.”

  • Farmer Fred: (done) “Thanks for completing the quest!”

In practice, the quest templates and especially quest conversations are more elaborate. But, even so, my test scenes have just felt very artificial and meaningless. Perhaps I haven’t leveraged affinities enough. But I’m afraid that if all of the quests involve asking the player to act against other NPCs that the quest giver dislikes, everyone will end up dead. What am I missing?

Is this an extension you’re trying to make? A game?

For a long while I’ve been thinking about a relatively similar concept I would like to try for an asset store pack but it would be pretty huge and I’ve got other project(s) I’m busy with so it would be a while before I could announce anything.

I wonder if it is right to have the quest itself spawn the wolf spawner. I know the quest system is not the farmer, but it still feels like the farmer is creating his own troubles just so the player can solve them. Perhaps that’s why the quests feel meaningless?

An alternative (though perhaps harder?) approach would be to write some evil-god code that goes around causing trouble for the poor NPCs… and then have those NPCs offer quests to sort it out. So this would mean, whether you’ve talked to the farmer or not, he’s got wolves in his fields and is unhappy about it. Now you (as the player) aren’t causing problems just by talking to people; the problems are there, whether you choose to ignore them or not.

Though on a functional level, maybe this is no different, except that you spawn the quests right away instead of when an NPC talks to a player (which maybe you’re doing already, I don’t know). Hmm.

Another thought is: this quest is considered complete after killing X number of wolves… but the poor farmer still has a wolf spawner in his field. It’d feel much more satisfying for me if I could remove the source of the problem. So, instead of adding a spawner, maybe you should just create N wolves, tied down to a certain point and radius, so that after they’ve been killed then the farmer is truly safe.

I think you’re right that you can’t just have the player be everybody’s hit-man, killing other NPCs. You could randomly generate fetch-quests and collection-quests instead… but how do you make those actually interesting? I don’t know. Even when they’re hand-written, they’re usually not terribly interesting to me.

5 Likes

Do all the quests have to involve killing? :slight_smile: How about giving the developer the ability to plug in their own dialogue. Plenty of games have generated quests and some of them are really boring and hated by hard core gamers. On the other hand, they are great for newbie players and a fantastic way to help crafters to gain experience and up their skills without grinding away for hours and tossing silly newbie crafted items. Could work for resource gatherers as well.

Way back in the text game days, I remember doing delivery tasks. Boring yeah, but I learned my way around the city. I could imagine such simple quests generated and used to teach players about their world or for training missions. Players earn a little coin so they can buy tools they need to start crafting or buy a sword to start swinging. :slight_smile:

In a role play type environment, little quests like the farmer’s wolves might be perfect. How often does the farmer’s daughter get kidnapped leading to some deep meaningful quest? Not often. But for a trainee swordsman, killing rats and eventually wolves would seem to be a commonplace career for a lad in a medieval city. Repeating these quests would not seem out of place, especially if there were more than one farmer. :slight_smile:

2 Likes

No, they are not, but they do serve a purpose in an open world. I remember doing many boring tasks in games to earn a few coin to get trained for my skills. I didn’t mind it that much because it helped my character to grow. It wasn’t as boring as killing worms or rabbits over and over again. At least I was able to visit new places.

True enough.

What would make them even more engaging for me, though, is if I felt I were really making a difference in the world. I want to see that farmer cowering, so terrorized by wolves he’s afraid to come out, and then I go in and fix the problem, and from then on he strolls cheerfully about his fields, always with a smile and a cool drink for me when I happen by.

You sometimes see this sort of effect in games, but too often the motivations for the quests are subtle at best, and having done them, I don’t feel like I’ve really changed the world much — at best, I ran an errand for somebody who was apparently to busy to do it themselves.

Infamous did a somewhat better job at this; the quests you choose to complete affect your reputation, which in turn strongly affects how random citizens react to you. But you still don’t affect the world that much, except through the advancement of the linear plot. I’d love an RPG where I can choose to go around solving problems, like the farmer’s wolves, or creating more problems, and over time the whole character of the area changes accordingly — right down to crops in the fields, fresh baked pies on the windowsills, etc.

2 Likes

I think you could make the farmer cower at the wolf. You might even be able to use Tony’s judgement system if he includes animals as NPCs. :slight_smile: The wolf attacks the farmer or his sheep and he has a negative affinity to the farmer. The farmer is afraid of him and therefore, the cower animation is triggered if the wolf is near.

You go in, clear out the wolves and farmer is happy and has a positive affinity to you and cheers you, giving you a pie off the windowsill. :slight_smile:

1 Like

Yes, you can define your own quest templates. So far, I’ve made templates for kill quests, gather quests, use quests, talk to NPC quests, give item to NPC quests, etc.

And perhaps the wolf spawner was a bad choice of example. Existing wolves, or orcs, or whatever, can also be quest assets. Say the player scares all the orcs away from their cave. The orcs end up wandering the farmer’s field. They show up as quest assets, so the farmer to create a kill quest for them instead of using a spawner. In this case, the player does have more of an ability to affect the world.

Similarly, if the farmer has a very negative affinity to the tax collector, he might offer a kill quest against the tax collector. You could even participate in escalating the negative affinity that villagers have for the tax collector.

I like @JoeStrout 's idea about a meddling power that causes situations that can result in quests. Also, quest assets can be abstract ideas, such as becoming the mayor of a village. The system currently uses a simple back-chaining planner to cobble together quest assets to make quests. Most quests are just one-step plans, though.

But, no, they’re not all kill quests. It’s just an easy template to use for examples.

And there’s my dilemma. Coming from games like Mass Effect, where everything is lovingly hand-written (at least in principle), all quests are deep and meaningful.

There’s the other side of that coin. There’s also something meaningful about having a real impact in the sandbox world, not just locked into the author’s writing.

BTW, it’s so coincidental that you mentioned pie off the windowsill. In my test scene, the farmer has 50 gold and a pie (!) to offer as rewards for quests. :slight_smile:

1 Like

It’s an extension. It’s written. It just needs to go through that refinement period to make it actually seem (hopefully) useful. :slight_smile:

1 Like

It’s hard to find quest generators that aren’t just doing mad libs with game entities for basic tasks. Quests these days are rarely more than mindless activities anyway.

Since talking about quest in general is a good idea…

One of the things I would be more inclined to do is not have simple quests. If there is a problem with orcs, the NPC’s would take care of it themselves. They might pad their ranks with some adventurers, but for the most part they would be fine on their own. It would be a much different affair if players are actually being conscripted into service.

2 Likes

I’m not sure what’s missing. It sounds like a decent starting point for a framework for repeatable quests.

As for the fun … generally, the quest giving is relatively straightforward. In my experience, many players don’t even read the bulk of the text, they just skip to the end to see what the objectives and rewards are. That’s because the players are on their own quest, which is typically to find the easiest path to the rewards they’re seeking.

And the story the players remember generally isn’t the one the quest giver delivers … it’s the one they experience as they try to complete the quest. In a hunt, it’s expected that two primary complications will be 1) finding the targets and 2) defeating them. But there can be other complications. Perhaps the targets form in bunches that are too large to engage at once, and the player has to discover some sort of method to separate them. Or maybe the targets can become aware they are being hunted, and so after being attacked they are harder to find and more prone to flee. Or maybe there is a third party that becomes involved … like a druid who seeks to protect the wolves.

I think the main thing to avoid in quest giving is making the player feel like the servant of everyone who has a quest. Try to anticipate the desires of the players and write the quests in that vein.

5 Likes

Good point! I’m really glad I brought up this topic. I’m beginning to think that complex quests are best hand-written, while procedural quests should be very simple so they can focus on reacting to the current state of the game world rather than focusing on complex quest structures. No wolf spawners, either. Just use the wolves that are already in the game, or perhaps spawned by a complicating entity outside of the context of the quest. I think the challenge is going to be designing a sufficiently diverse environment with enough stuff to feed all the interactions…

(BTW, total aside, I did Richard Bartle a disservice by not crediting his series of articles on procedural quest generation in MUDs. They’re the original inspiration for this project. If you’re interested in this topic, you’ll enjoy reading his articles.)

3 Likes

My mantra is to try to show story as much as possible, and tell it as little as I can get away with. So little to no exposition for me, if I can manage it. Instead, things are literally revealed.

My experience is that few players want to stop and read text. They want to play. So if they’re going to learn something in the game, it’s best if they see it and preferably interact with it.

And while receiving a story is ideally one of the rewards of story-based game play, generally speaking there should be other rewards in there too, preferably ones that are keyed to the story.

3 Likes

Oh, a great link! Thanks, Tony. I love reading Richard’s stuff. I worked on MUD’s way back in the old days. :slight_smile:

Also, love reading what everyone has to say about games and stories. You guys are great! I want to play your games.

Do you have any suggestions for how the quest generator can show more and tell less?

Currently, it uses “Mad Libs” style conversation templates. The generated conversations have some variety because they pull words from different dialect databases (e.g., “Greetings, good sir.” versus “Ahoy, matey!”) but the structure of the conversation is always the same.

Maybe this isn’t so bad if there are a lot of conversation templates to choose from. But a human author has to write each template, so it’s time-consuming.

Like you said, many people skip the text entirely. It sounds like they wouldn’t mind if all kill quests were formatted exactly like this:

  • Quest Giver: Farmer
  • Kill: Wolf
  • Amount: 5
  • Reward: 20 gold
  • Accept? (yes/no)

But other people (myself included) like to hang on the nuance of every word in a well-written quest.

Thoughts, anyone?

Also, what is everyone’s opinion on quest logs? I like them because (1) they remind me what I need to do, and (2) I get a sense of accomplishment by ticking off items. However, I also see @JoeStrout 's point about pointlessly ticking off items on someone else’s laundry list, and it does feel like that sometimes. And my most memorable “quests” have been goals that I’ve set for myself outside what the author wanted me to do – for example, “I wonder if I can ramp this car onto that helicopter…” or “I wonder if I can train those orcs into the village and cause mischief.” Quest logs are a huge design consideration for the quest generator. Currently it uses quest logs, but I’m not sure if this is the right approach.

I like quest logs too, especially if I am distracted by something outside the game while in the middle of a quest and need to come back to it later. :slight_smile: I would forget it existed otherwise. So I think they do have a place.

Maybe they could be displayed more like a journal or a “memory” tucked inside the character’s head. Not sure how to do that, but it could be interesting. Although, in real life, I keep a list when I need to remember something, written on a scrap of paper that often gets lost.

As for self-setting goals in a game, creative players will probably do that regardless of whether you have quests or not. I am the type of player who does not do a lot of quests if I am not required to do so. I prefer to set my own goals, such as starting a business entirely outside of the game mechanics, but not everyone likes to do that. Some people are more rigid and more logical in the way they play a game and prefer being told what they should do. Self-directed “quests” only require a content rich environment and a little imagination.

1 Like

It sounds like an interesting idea and I would like to give some feedback:

I don’t know if this will be an custimizable package or for a specific game, but I would like to give some feedback from an realistic perspective:

“Greetin’s!(positive thing) If you exterminate(negative thing) 5 wolves, I’ll give you 20 gold.” - I think there is a hugh discrepancy in bevielability, because the farmer acts if it is nothing to kill some wolves. Imagine two wolves meet and talking about killing 5 humans. Pretty morbid. That is one reason why the quest emerges like a meaningless one.

You said you like to read every word in a quest, then I think you should let the player interact more with the quest giver. I know this would mean more data to provide, but I like to give an example:

  • Farmer: “mubles…Oh hello there…hmm…you look like a [player’s class] and that you could defend yourself.”
    -----Player: “Yes, indeed.”
    -----------Farmer: "Would you mind helping me out? I have some problems with [targets] "
    -----------------Player: “How many are there?”
    -------------------------Farmer:“I’m not sure, I have spotted [targetNumber + Random.Range(-1,2)], could be more.”
    -----------------Player: “Where are they?”
    --------------------------Farmer:“They are currently rampanging at [targetLocation]”
    -----------------Player: “What do I gain in return?”
    -------------------------Farmer:“I grant you my best handshake of manliness +1[reward]”
    -----------------Player: “Where is the hunter of this village”(optional questions)
    -----------------Player: “Leave it to me.”
    -----------------Player: “I’m sorry, I have my own problems.”
    -----Player: “No not at all, I’m just cosplaying.”
    ---------Farmer:“Oh I see…”
    --------------Player:“Who are you?”
    --------------Player:“You look like you have an problem”
    -------------------Jump To Farmer:“Woud you mind helping me out?..”
    --------------Player:“Where is the inn?”

I hope you understand my dialog flow. You let the player choose several options how the dialog should go.

Again I don’t know what kind of game you would like to do, but I thing this would be more meaningful. The player needs now to interact with the npc to get proper information for the quest and it isn’t delivered anymore on a silver platter. Besides I don’t know if the players would like this, or the simplified approuch.

Also I know that this would mean you have to write more but maybe you can stick some sentences randomized together.

For example: greeting.sentence1a + greeting sentence2c
instead of mumbles sighs,
Oh… hello there…, welcome stranger…
etc.

P.S.: I just noted that I didn’t overlap with your new/active/done state for a quest, but I think you get the general idea I mean.

1 Like

Nice!

However, I think farmers would talk about killing wolves as if were nothing. :slight_smile: Even farmers today kill wolves, even when it is against the law. The see wolves as a threat to their livelihood.

But I like the additional dialogue. Looks more natural.

Agreed, if you’re going to have quests at all, a quest log is pretty much essential.

I inserted “not do” where a double-space appeared in your original text because I think that’s what you were trying to say — apologies if I got that wrong.

If I didn’t get it wrong, then I entirely agree. I think back to my DikuMUD days in particular (of all the MUD engines I played — or wrote — DikuMUD was the most like modern RPGs, with extensive leveling, classes, lots of areas to explore, and yes, some quests). Quests were a pretty new and experimental concept at the time. We found them interesting, but they weren’t essential, and many of us didn’t bother with them most of the time — there was plenty to do in setting our own goals, which usually revolved around exploring new areas. Because of the sorting algorithm of evil, these areas got tougher and tougher the further away you got from the starter town. And because the game was huge, there were always more areas to explore, including entire cities you probably couldn’t get to until you were at least so-tall. So the cycle of: explore, gain XP and better loot, now able to explore harder areas, was very rewarding in itself. Occasionally we had to grind, but not very often. Usually we were pursuing some self-selected goal.

That reminds me of a story… (geez, I sound like an old coot, don’t I?). There was a creature called “Blob” that appeared in the center of town now and then. It was not aggressive, but it was very, very tough. Anyone foolish enough to attack the blob would be smashed into a thin paste very quickly. Even a higher-level character couldn’t take it alone. So it became a delightful game for us: a group of higher-level characters would get together now and then and agree to hunt the Blob. We would put on all our best gear, buff up with every potion we had, make sure we were all rested and stocked up on mana, and then go for it. Epic battle ensued.

I realize such raids happen all the time in modern MMORPGs. I bring it up just to illustrate that a self-selected goal can be more fun than a quest.

However, I don’t think we should dispense with quests entirely. They can be fun too, and they’re a great way to advance the plot (for games that have one — though I’m not entirely certain plots are necessary, either). And I think all players are different — as several here have said, some players prefer to have more concrete objectives handed to them, and there’s nothing wrong with that.

1 Like

As an old MUD builder, I can relate. :slight_smile: Quests were not important and not even sure we thought in “quest” mode back then. But just exploring a new area of the game was a quest to some extent, although not so structured.

You got it right. I corrected the grammar and accidentally left out words. LOL So I just corrected it again, thank you.

I think quests could be a lot more useful and integrated into the story if one tried. Even the generated quests could work well if they offered jobs to the players. While it would be nice if a player farmer (in a multiplayer game) was the one offering money to the other player to kill wolves on his property, players are notoriously undependable for things like that so the generated quests could fill in the holes and provide jobs for players who are on late at night or in a different time zone.