Quest Machine Tutorials: Dialogue System Integration, Procedural Quests

Announcements, support questions, and discussion for Quest Machine.
GorkaGames
Posts: 178
Joined: Fri Sep 21, 2018 8:38 pm

Re: Quest Machine Tutorials: Dialogue System Integration, Procedural Quests

Post by GorkaGames »

The script loads now fine, should be something regarding the 2018.3 installation. I restarted and fine. Sorry about that...

But..... I have the same issues than a few days ago:
If I select to show up to 2 missions and there are 3 entities on the domain, it launches 2 quests of 3 entities each, and only should launch one.

Here are the screenshots:
https://1drv.ms/u/s!AgOs7p5LnVflkKQsahMjSM43zwSNAw
https://1drv.ms/u/s!AgOs7p5LnVflkKQtbb7JWfbMEW99FQ

Also the UI from the quest Giver doesn't show up everytime it should.... (at least when there are more quest Givers with manual quests)....
User avatar
Tony Li
Posts: 21925
Joined: Thu Jul 18, 2013 1:27 pm

Re: Quest Machine Tutorials: Dialogue System Integration, Procedural Quests

Post by Tony Li »

GorkaGames wrote: Sat Nov 24, 2018 5:54 pmIf I select to show up to 2 missions and there are 3 entities on the domain, it launches 2 quests of 3 entities each, and only should launch one.

Here are the screenshots:
https://1drv.ms/u/s!AgOs7p5LnVflkKQsahMjSM43zwSNAw
https://1drv.ms/u/s!AgOs7p5LnVflkKQtbb7JWfbMEW99FQ
How are you telling Quest Machine to generate quests?

The quest generator will try to avoid generating a new quest about an entity that is already in the quest list. In other words, if the quest giver already has a Kill Goblins quest, then the generator will not generate another goblins quest.

However, quest generation runs in a background process. You may need to allow each process to finish before starting the next one. Otherwise, two processes could run in parallel and generate the same quest.

So instead of this: (example)

Code: Select all

var questGeneratorEntity = GetComponent<QuestGeneratorEntity>();
for (int i = 0; i < 2; i++)
{
    questGeneratorEntity.GenerateQuest();
}
Do this:

Code: Select all

int questsRemainingToGenerate = 2;
var questGeneratorEntity = GetComponent<QuestGeneratorEntity>();
questGeneratorEntity.generatedQuest = OnGeneratedQuest;
questGeneratorEntity.GenerateQuest();
...
void OnGeneratedQuest(Quest quest)
{
    questsRemainingToGenerate--;
    if (questsRemainingToGenerate > 0) questGeneratorEntity.GenerateQuest();
}

Code: Select all

Quest Machine: [Generator] Jane Pirate: Most urgent fact: 3 Goblin in Home Island
GorkaGames wrote: Sat Nov 24, 2018 5:54 pmAlso the UI from the quest Giver doesn't show up everytime it should.... (at least when there are more quest Givers with manual quests)....
Which UI? The dialogue UI or the overhead quest indicator?
GorkaGames
Posts: 178
Joined: Fri Sep 21, 2018 8:38 pm

Re: Quest Machine Tutorials: Dialogue System Integration, Procedural Quests

Post by GorkaGames »

I just only call once:
NPCGiver.GetComponent<QuestGeneratorEntity>().StartDialogue(miJournal);

as you mentioned in this threat. I call it once the player enters in NPC trigger. it should only fire 1 quest as I only have 3 entities on the domain.

the overhead quest indicator...
User avatar
Tony Li
Posts: 21925
Joined: Thu Jul 18, 2013 1:27 pm

Re: Quest Machine Tutorials: Dialogue System Integration, Procedural Quests

Post by Tony Li »

GorkaGames wrote: Sat Nov 24, 2018 7:45 pmI just only call once:
NPCGiver.GetComponent<QuestGeneratorEntity>().StartDialogue(miJournal);

as you mentioned in this threat. I call it once the player enters in NPC trigger. it should only fire 1 quest as I only have 3 entities on the domain.
I'm trying to figure out how to reproduce this. In the Demo scene, if I set the Knight to:
  • Generate Quest On Start: UNticked
  • Max Quests To Generate: 2
  • Start dialogue with QuestGeneratorEntity.StartDialogue(Player)
Then it only generates one quest (Kill n Orcs).

Can you provide any steps to reproduce the issue, or send me an example project?

On the Quest Machine GameObject, can please you tick Debug Settings > Debug Quest Generator and reproduce the problem? Then send me the Editor.log file.

EDIT: I wonder if maybe OnTriggerEnter is being called twice in the same frame -- for example if your player has two colliders (e.g., body and head) that enter the NPC's trigger collider. In this case, both OnTriggerEnter's will start the quest generation process.
GorkaGames wrote: Sat Nov 24, 2018 7:45 pmthe overhead quest indicator...
For NPCs that have only manual quests? Or a mix of manual quests and procedurally-generated quests?
User avatar
Tony Li
Posts: 21925
Joined: Thu Jul 18, 2013 1:27 pm

Re: Quest Machine Tutorials: Dialogue System Integration, Procedural Quests

Post by Tony Li »

In case the issue is that you're calling QuestGeneratorEntity.StartDialogue() more than once in the same frame, this patch will make sure only one runs in the frame:

QM_Patch_2018-11-24.unitypackage
GorkaGames
Posts: 178
Joined: Fri Sep 21, 2018 8:38 pm

Re: Quest Machine Tutorials: Dialogue System Integration, Procedural Quests

Post by GorkaGames »

OK, now the call on the same frame is solved and the quest only shows up once. Great.

Now the problem about don't showing up the UI HUD Quest Indicator keeps the same..
I have 2 NPCs at the same time (One manual and one procedural). The the procedural doesn't show the HUD.
If I remove the manual one, then the procedural works and shows the HUD.

It's something like only 1 at each time can be active or something similar, or that the manual ones have got preference...

Tested several times.

EDIT:
Tested with no manual and 2 procedural, same result.
Once you talk to one of them then you have the HUD active for the rest of the gameplay.
I think on the procedural ones the HUD doesn't work till you talk to one of then and then refresh them all.
If you don't select "Generate quest on start".

IF YOU SELECT "Generate quest on start" then it works, but if not, it doesn't generate the quest till yo approach them.
I thought the quest givers were checking this every frame, I don't understand therefore the options for optimization on every frame on the settings.
User avatar
Tony Li
Posts: 21925
Joined: Thu Jul 18, 2013 1:27 pm

Re: Quest Machine Tutorials: Dialogue System Integration, Procedural Quests

Post by Tony Li »

Hi,

The quest indicator should appear when the NPC generates a quest and adds it to her list.

The Quest Giver component's Cooldown Check Frequency checks whether repeatable quests are offerable again. For example, the Harvest Carrots quest is repeatable. If you take this quest, you can take it again after 60 seconds. The Villager NPC checks every 5 seconds to see if 60 seconds have passed.

The Quest Generator Component doesn't check anything every frame. Do you want it to check if there is a generated quest, and automatically generate one if there is no quest?

For efficiency, I had expected designers to handle this on their own. For example, you could define a larger trigger collider around the NPC. When the player enters this collider, use a Trigger Event component to call QuestGeneratorEntity.GenerateQuest(). This way it doesn't need to constantly poll the quest list. It only generates a quest when the player gets near.
GorkaGames
Posts: 178
Joined: Fri Sep 21, 2018 8:38 pm

Re: Quest Machine Tutorials: Dialogue System Integration, Procedural Quests

Post by GorkaGames »

ok, done. Now works fine. Calling to QuestGeneratorEntity.GenerateQuest() before approaching.

One more thing: Even when I select "Requiere return to complete", the quest changes to state complete when I kill the last entity on the quest, shouldn't be when I reach the NPC Quest Giver again? (The alert shows return to NPC but the state is already completed)
Also would be great if the HUB quest indicator activates again so the player knows the way back to the Quest Giver.
User avatar
Tony Li
Posts: 21925
Joined: Thu Jul 18, 2013 1:27 pm

Re: Quest Machine Tutorials: Dialogue System Integration, Procedural Quests

Post by Tony Li »

GorkaGames wrote: Sun Nov 25, 2018 1:52 pmOne more thing: Even when I select "Requiere return to complete", the quest changes to state complete when I kill the last entity on the quest, shouldn't be when I reach the NPC Quest Giver again? (The alert shows return to NPC but the state is already completed)
Can you compare your quest to the demo? When I pick up a generated quest from the Knight, it looks like this:

Image

After I kill 3 Orcs, the "Kill 3 Orcs" node is True, and the "Talk to Knight" node is Active:

Image

The condition on "Talk to Knight" waits for a "Discussed Quest" message:

Image

The NPC sends this message when the player talks to him.
GorkaGames wrote: Sun Nov 25, 2018 1:52 pmAlso would be great if the HUB quest indicator activates again so the player knows the way back to the Quest Giver.
It should already work like that. This is the indicator before I accept the quest:

Image

After I accept the quest, the indicator goes away.

The generator automatically adds a "Set Indicator" action to the "Talk to Knight" node. When "Talk to Knight" becomes Active, the indicator changes to this:

Image
GorkaGames
Posts: 178
Joined: Fri Sep 21, 2018 8:38 pm

Re: Quest Machine Tutorials: Dialogue System Integration, Procedural Quests

Post by GorkaGames »

Okkkkk, I see on the graph's node what you mean, great, but....the hud it doesn't work for me, I've checked out the states of the hud in the scene on the NPC and doesn't change to talk. I think is because for same reason the Entity ID that generates the Quest is different than the one in the Entity.

For instance the entity id on the scene is "HomeIslandGiver1" and on the quest generated on the journal appears "Pirate" (that is the entity type and not the Id)
Post Reply