Procedural quest help

Announcements, support questions, and discussion for Quest Machine.
Post Reply
Liam
Posts: 1
Joined: Fri Sep 14, 2018 1:33 pm

Procedural quest help

Post by Liam »

Hey all. Sorry the subject is a bit vague but I'm hoping to get a bit more educated on how generating procedural quests work.

I'm as far as setting up an entity type, a domain type and a faction for the NPC with the QuestGeneratorEntity component attached but when generating I get a failure in DetermineGoal - having to do with mostUrgentFact being null. That's all to say I'm afraid this is way too obtuse for my use case! :P

I see how this stuff would be helpful but for my project I if I need to create a faction, drives, entity types, domain types, I'd like to keep it as minimal as possible because my project doesn't need to consider any of that. I prefer handling the hows and whys of doling out the generated quests in my game code - what I need to know is how to get the simplest version of a generated quest working.

Quest generation doesn't seem to be covered in the demo video and simply trying to copy what I'm finding (with the Pirate NPC) doesn't yield the results I expect or make the system any less confusing.

I guess my question is, what's the best way to learn how I can use QuestGenerator?

Appreciate the effort so far! :D
User avatar
Tony Li
Posts: 20733
Joined: Thu Jul 18, 2013 1:27 pm

Re: Procedural quest help

Post by Tony Li »

Hi,

Page 54 of the manual has a section titled "Quest Generation Setup Example Step By Step" that will walk you through the steps of setting up procedural generation.

At a minimum, you need to create these assets: one domain type, one entity type, and one action. You'll probably also want to create a faction so you can use the "threat" urgency function; otherwise you can use the "literal value" urgency function.

In the scene, you'll need to add a domain, an entity in that domain, and a quest generator NPC.

When an NPC wants to generate a quest, it identifies all entities in the domains that it watches. Then it runs each entity's urgency functions to get an urgency value for each entity. Then it chooses the entity with the highest urgency value. Urgency functions are the key to letting the NPC know which entity is currently the most important to generate a quest about.

You could be getting stuck in one of two places:

1. Does the NPC observe any domains? If so, is there an entity in the domain? The Domain component uses trigger collision, so the entity and the domain need to be set up to register OnTriggerEnter/OnTriggerExit or their 2D equivalents. If you don't want to use collisions, let me know; you can register a C# function to manually tell the NPC which entities it should know about.

2. If the NPC is noticing entities in domains, then it's possible the entities don't have any urgency functions. Without urgency functions, they won't have urgency values. Without urgency values, the NPC won't consider the entity urgent enough to generate a quest about.

Once you get past that point, and the NPC has chosen an entity to generate a quest about, it will figure out a set of actions that, when accomplished, result in a future world state whose entities have a lower total sum of urgency values. The key to that stage is to add actions to each entity type (for example, the "Kill" action to "Orc" entities).
Post Reply