Several questions

Announcements, support questions, and discussion for Quest Machine.
Post Reply
CHOPJZL
Posts: 97
Joined: Wed Sep 02, 2020 10:05 pm

Several questions

Post by CHOPJZL »

Hello!
I am studying the demo and have several questions about Quest Machine.
1.
We can select the reward in "Pesky Rabbits", it is confirmed when click the reward button. I am thinking if I can just select only when click the reward button, and press an OK button to get the reward I selected. Futher more, I can select multiple rewards, the amount maybe based on a predefined number, or the sum value of the selection.
2.
There is a Passthrough quest node. What is the use case of it? Can you give some examples? And the Inactive state of quest node, too. I didn't think of a situation that it is not empty.
3
abcd.jpg
abcd.jpg (16.5 KiB) Viewed 998 times
This is a quest Hud of Marvel's Avengers. Basically I need to destroy ABCD 4 devices. The destroyed will become red on the hud. I think I can make this by adding 4 parallel condition node, but the ABCD icons in hud will be arranged vertically. How to do it to achieve the appearance like in the game.
4.
How to mark the quest target? Sometimes it is a target person, sometimes it is an area to explore. Usually it will be turned on when selected in the journal, Like the hud does. Does the quest asset stores those info?
User avatar
Tony Li
Posts: 21925
Joined: Thu Jul 18, 2013 1:27 pm

Re: Several questions

Post by Tony Li »

Hello,
CHOPJZL wrote: Wed Sep 02, 2020 10:59 pm1. We can select the reward in "Pesky Rabbits", it is confirmed when click the reward button. I am thinking if I can just select only when click the reward button, and press an OK button to get the reward I selected. Futher more, I can select multiple rewards, the amount maybe based on a predefined number, or the sum value of the selection.
When you add a Button to dialogue text, you can add Actions to the button:

questButtonActions.png
questButtonActions.png (22.28 KiB) Viewed 995 times

In the Pesky Rabbits quest, the '2 Carrots' button runs an action that gives the player 2 carrots. You can instead add a custom action that toggles the selection of a reward. You will need to write this action. To write a new type of action, duplicate the file Plugins / Pixel Crushers / Quest Machine / Templates / QuestActionTemplate.cs. Then rename your duplicate copy and fill in the code where the comments indicate.

If you want to change the behavior of the button itself -- for example, to toggle it on and off -- duplicate QuestContentTemplate.cs and fill in the code.

This way, you can add new functionality to Quest Machine without having to modify the original Quest Machine source code.
CHOPJZL wrote: Wed Sep 02, 2020 10:59 pm2. There is a Passthrough quest node. What is the use case of it? Can you give some examples? And the Inactive state of quest node, too. I didn't think of a situation that it is not empty.
A passthrough node lets you add content and actions without conditions. It's just a way to organize quest nodes. You don't have to use it. You can also use it to bring separate quest branches back together. In the example below, you can complete one branch (Battle Orcs) or the other (Use Tunnel). When you complete either branch, it ties everything back together to defeat the wizard.

passthrough.png
passthrough.png (35.21 KiB) Viewed 995 times
CHOPJZL wrote: Wed Sep 02, 2020 10:59 pm3. This is a quest Hud of Marvel's Avengers. Basically I need to destroy ABCD 4 devices. The destroyed will become red on the hud. I think I can make this by adding 4 parallel condition node, but the ABCD icons in hud will be arranged vertically. How to do it to achieve the appearance like in the game.
Make a new quest content type. (Make a copy of QuestContentTemplate.cs.)
CHOPJZL wrote: Wed Sep 02, 2020 10:59 pm4. How to mark the quest target? Sometimes it is a target person, sometimes it is an area to explore. Usually it will be turned on when selected in the journal, Like the hud does. Does the quest asset stores those info?
Make a new quest action type. Or, if you use Compass Navigator Pro or HUD Navigation System, Quest Machine has integration packages for those assets. You can use them to mark quest targets instead of writing your own quest action type.

The quest will not save the target marker. The target marker should save its own state in saved games. For example, if you activate a navigation point in Compass Navigator Pro, the integration will save the state of the navigation point (visible or not visible).
CHOPJZL
Posts: 97
Joined: Wed Sep 02, 2020 10:05 pm

Re: Several questions

Post by CHOPJZL »

Sorry for my late reply. Thanks for the answer.
I got some other questions.
1.
About the Quest Generation, For example, the Kill Action in the demo. When I set the Required Value to 1 in Completion Conditions, the quest that generated is Kill 3 Orcs, Kill 2 Wolves. What are the factors and rules that affects the count?
2.
How does the Generator knows Polymorph Action need a FindWand Action before it? What should I do if I want to generate a qurest that, has a quest node with several parent node, or a quest node with several child node
3.
I am thinking about a situation that there are several player in the game, maybe a local multiplayer game or a turn based game. Each of them can take the same quest(Kill 3 Orcs for example), maintain their own quest status, and success independently. Can I do that with Quest Mchine?
User avatar
Tony Li
Posts: 21925
Joined: Thu Jul 18, 2013 1:27 pm

Re: Several questions

Post by Tony Li »

Hi,
CHOPJZL wrote: Tue Sep 08, 2020 3:32 am1. About the Quest Generation, For example, the Kill Action in the demo. When I set the Required Value to 1 in Completion Conditions, the quest that generated is Kill 3 Orcs, Kill 2 Wolves. What are the factors and rules that affects the count?
Each action has a minimum and maximum number. (For example, Kill 1-10 entities.)

Each entity has a Max Count In Action curve. This curve specifies how many to include in a quest. For example:
  • 1 Orc = Include 1 in quest
  • 2 Orcs = Include 2 in quest
  • 3 Orcs = Include 2 in quest
  • 4 Orcs = Include 3 in quest
  • ...100 Orcs = Include 20 in quest
So if the quest giver wants to make a quest to Kill Orcs, and it sees 100 Orcs, then the entity definition will limit the quest to 20 Orcs. But the Kill action's maximum is 10, so the quest will use a maximum of 10 Orcs.
CHOPJZL wrote: Tue Sep 08, 2020 3:32 am2. How does the Generator knows Polymorph Action need a FindWand Action before it? What should I do if I want to generate a quest that, has a quest node with several parent node, or a quest node with several child node
That's the power of Quest Machine's planning system AI.

The Polymorph action has a requirement: The player must have a wand.

The planner looks for something to do in the scene that can give the player a wand. The Barrel has a FindWand action that gives the player a wand. So the planner chooses FindWand --> Polymorph target.

To keep the Demo simple, it only does this one extra level of planning.

In a more complex example, the Barrel could have an action "break" that drops a wand into the world. The wand could have an action "pick up" that moves the wand from the world into the player's inventory. In this case, the planner would generate a plan like this:

Break Barrel --> Pick Up Wand --> Polymorph target.

Maybe the barrel can only be broken with an axe. The axe is in a chest. The chest has an "open" action that puts the axe into the world. The axe has a "pick up" action. Then the planner would generate a plan like this:

Open Chest --> Pick Up Axe --> Break Barrel --> Pick Up Wand --> Polymorph target.
CHOPJZL wrote: Tue Sep 08, 2020 3:32 am3. I am thinking about a situation that there are several player in the game, maybe a local multiplayer game or a turn based game. Each of them can take the same quest(Kill 3 Orcs for example), maintain their own quest status, and success independently. Can I do that with Quest Machine?
Yes. One of the video tutorials does this with multiple AI-controlled questers. But you can do the same thing with player-controlled questers. Give each player their own Quest Journal component, and set their ID values differently (e.g., "Player1", "Player2", etc.).
CHOPJZL
Posts: 97
Joined: Wed Sep 02, 2020 10:05 pm

Re: Several questions

Post by CHOPJZL »

1.
In the demo there are 3 orcs and 3 wolves, and I think their Max Count In Action curve is same. But the generated quest are Kill 3 Orcs, Kill 2 Wolves. Why are they different?
---------------------------------------------
For friends who may have the same question, I noticed that only 2 wolves are in the watched domain.

2.
Can I generate some more complex quest that like the handwritten ones? For example:
________--->Pick Up Wand ------------------------------>
Open Chest --> Pick Up Axe --> Break Barrel --> Pick Up Wand --> Polymorph target.

3.
I tried to duplicate Player in demo to simulate. They can successfully accept quest, but there are some problems:
3.1
I can't add journalUI or HUD to the Quest Journal component.
3.2
In the tutorial project the 2 knights can accept same quest that ignore the Cooldown Seconds, but in my simulation the Player2 have to wait to accept same quest. I tried to set Cooldown Check Frequency to 0 but seems not working.
3.3
Although the Max Times of a quest can be set very large, Can it be set to infinite?
User avatar
Tony Li
Posts: 21925
Joined: Thu Jul 18, 2013 1:27 pm

Re: Several questions

Post by Tony Li »

CHOPJZL wrote: Wed Sep 09, 2020 12:53 am1. In the demo there are 3 orcs and 3 wolves, and I think their Max Count In Action curve is same. But the generated quest are Kill 3 Orcs, Kill 2 Wolves. Why are they different?
---------------------------------------------
For friends who may have the same question, I noticed that only 2 wolves are in the watched domain.
Thanks. I forgot to mention that. Quests will of course also be limited to the number of entities actually seen in the domain. If you want to generate a quest with more entities than are in the domain, you can hook into the QuestGeneratorEntity.updateWorldModel C# event and add more entities to the NPC's world model. The world model is the abstract representation of what the NPC knows about.
CHOPJZL wrote: Wed Sep 09, 2020 12:53 am2. Can I generate some more complex quest that like the handwritten ones? For example:
________--->Pick Up Wand ------------------------------>
Open Chest --> Pick Up Axe --> Break Barrel --> Pick Up Wand --> Polymorph target.
Procedurally-generated quests do not branch. They choose one path of actions. Different generated quests, however, could choose different paths. For example, the Knight and Pirate both want to rid the forest of enemies. But the Knight usually generates a quest to kill the enemies. The Pirate usually generates a quest to turn them into rabbits.
CHOPJZL wrote: Wed Sep 09, 2020 12:53 am3. I tried to duplicate Player in demo to simulate. They can successfully accept quest, but there are some problems:
3.1. I can't add journalUI or HUD to the Quest Journal component.
3.2. In the tutorial project the 2 knights can accept same quest that ignore the Cooldown Seconds, but in my simulation the Player2 have to wait to accept same quest. I tried to set Cooldown Check Frequency to 0 but seems not working.
3.3. Although the Max Times of a quest can be set very large, Can it be set to infinite?
I decided that you could just set Max Times to a very large number (e.g., 2,147,483,647 if you want), and this way the quest would not have to store an additional variable for infinite.

Please examine the video tutorial on multiple AI questers. It shows how to set up an additional HUD for the second quester.
CHOPJZL
Posts: 97
Joined: Wed Sep 02, 2020 10:05 pm

Re: Several questions

Post by CHOPJZL »

I watched the video tutorial before I ask the question. The problem is that I can't drag the journalUI or HUD to the Quest Journal component. It is the same in the tutorial asset, too. If I drag the "Quest HUD 2" to the Quest Journal component of Knight2, it can't be set. I am using unity 2019.4.2f1.
User avatar
Tony Li
Posts: 21925
Joined: Thu Jul 18, 2013 1:27 pm

Re: Several questions

Post by Tony Li »

Hi,

Please see page 46 of the manual. There's a special process to drag the UIs. (Open a second inspector on the UI. Drag the UI's component heading into the UI field.)
CHOPJZL
Posts: 97
Joined: Wed Sep 02, 2020 10:05 pm

Re: Several questions

Post by CHOPJZL »

Now it works. Thanks for the support:)
User avatar
Tony Li
Posts: 21925
Joined: Thu Jul 18, 2013 1:27 pm

Re: Several questions

Post by Tony Li »

Happy to help!
Post Reply