Page 1 of 1
Quest Generation
Posted: Tue Mar 09, 2021 4:08 am
by AArtlone
Hi!
We recently purchased the QuestMachine plugin and we are currently exploring its possibilities and ways of integrating it into our game.
We are experiencing a certain problem, which I will explain using the Demo example, this way we can understand each other more easily.
At the moment, in the demo scene, it is possible to talk to the Knight (QuestGeneratorEntity) who generates a quest to kill 3 Orcs in the Forest domain.
Now imagine that instead of 1 Forest domain you have two: North Forest, and South Forest.
So the question is how to set up the Quest Generation or which features of Quest Generation to use in order to achieve the following result??? :
- The QuestGeneratorEntity generates a quest to kill Orcs either in the North or South Forest domain
- If the quest specifies that the player has to kill Orcs in the North Forest domain, the kill counter increments only when the player kills the Orc from the corresponding domain
What I have tried so far to achieve this result:
- I thought that it would be possible to differentiate between the killed Orcs by using the {DOMAIN} tag when defining the Completion Condition of the Kill (Action) and then creating a unique domain for each forest
- I also looked at the source code of how the completion condition is set up and I did not see how using the Sender ID or Target ID would help this case either
Besides, I have some more questions/feedback on the QuestGeneration, but it would be nice to figure this out first. Thanks in advance for any help.
Re: Quest Generation
Posted: Tue Mar 09, 2021 8:58 am
by Tony Li
Hi,
Thanks for using Quest Machine!
Entity types support inheritance. For example, you can:
- Define a general purpose Monster entity type.
- Then define a child entity type for Orc.
- Then define different grandchild entity types for North and South Orcs. For example, maybe the Orcs in the North Forest are the Bloodfang Clan Orcs, and the Orcs in the South Forest are the Frostwolf Clan Orcs.
Then your quest giver can generate a quest to kill 3 Bloodfang Orcs or 3 Frostwolf Orcs depending on which domain the generator chooses. (Which is typically the domain with the most Orcs, since this would result in the highest urgency.)
Re: Quest Generation
Posted: Tue Mar 09, 2021 10:46 am
by AArtlone
Hi Tony!
Thanks for such a quick response!
I understand your point about using different orc entity types. But that is not something I am looking for.
The reason I was describing the example with two different forests and the same Orc, is because I am translating the problem that I have faced with the Quest Generation in our project into the QM Demo. And by finding the solution to this Orc problem I will be able to solve my problem.
Thus, I am specifically asking how would you tackle this example:
- You have the world that contains Orcs
- You have only one Orc type
- When the Orc is killed, it sends the message to the MessageSystem saying "Orc:Killed"
- You have the Kill Action that has the Completion Condition, that listens for message "Kill:{TARGETENTITY}". {TARGETENTITY} in this case will be Orc
- You have two Forests, Forest X and Forest Y. Also, the question here, are those two forests the same domain type(Forest), or do they have to be different (North Forest and South Forest)?
- The quest is generated and asks the player to go to Forest X and kill 3 orcs
How can we know, that the orc that died and sent a message to the MessageSystem, belongs to Forest X and not Forest Y?
Thanks for the help!
By the way, we got the plugin very recently, but our experience with it so far has been very pleasant!
Re: Quest Generation
Posted: Tue Mar 09, 2021 11:16 am
by Tony Li
Hi,
I'm glad to hear that your experience has been good so far!
AArtlone wrote: ↑Tue Mar 09, 2021 10:46 amHow can we know, that the orc that died and sent a message to the MessageSystem, belongs to Forest X and not Forest Y?
Somehow the system will have to distinguish between Forest X orcs and Forest Y orcs. Let's say you add a custom script to your orcs that, when killed, sends a message "Killed" + "{ENTITYTYPE} in {DOMAIN}" where {DOMAIN} is the domain containing the orc. Something like:
Code: Select all
void OnDeath()
{
MessageSystem.SendMessage(this, "Killed", $"{myEntityType.name} in {myDomain.name}");
}
Then import this patch, which updates the quest generator to handle the tag {DOMAIN}:
QM_QuestGeneratorPatch_2021-03-09.unitypackage
(This addition will also be in the next full release of Quest Machine.)
AArtlone wrote: ↑Tue Mar 09, 2021 10:46 amYou have two Forests, Forest X and Forest Y. Also, the question here, are those two forests the same domain type(Forest), or do they have to be different (North Forest and South Forest)?
Use different domain types for each domain. Otherwise, using the hypothetical example, the orcs in both forests will be grouped into the same fact in the quest giver's world model.
Re: Quest Generation
Posted: Wed Mar 10, 2021 5:02 am
by AArtlone
Hi Tony!
Perfect! That is exactly what we were looking for!
As a matter of fact, we thought about using the domain in the same way, but the {DOMAIN} tag was not supported haha, thanks for the patch.
I have another problem with the Quest Generation, but it is a different topic, therefore I will create a new post on the forum.
Thanks for the help!
Best wishes,
Artem
Re: Quest Generation
Posted: Wed Mar 10, 2021 6:00 am
by AArtlone
Actually, I have a follow-up question on the update patch you have shared.
In that patch, you have implemented the {DOMAIN} tag, but it is only implemented for the Counter Completion Mode.
What about the Message Mode? It would be nice to be able to use the {DOMAIN} tag there as well.
Re: Quest Generation
Posted: Wed Mar 10, 2021 8:01 am
by Tony Li
I'll add that in the next release!
Re: Quest Generation
Posted: Wed Mar 10, 2021 9:00 am
by AArtlone
Do you already know when the next release is coming out?
Can I ask you to share it with me as soon as you implement it also in a form of an update patch?
Re: Quest Generation
Posted: Wed Mar 10, 2021 9:38 am
by Tony Li
Sure! Here it is:
QM_QuestGeneratorPatch_2021-03-10.unitypackage
It also has the fix for the minimum requirements issue from your other thread.
Re: Quest Generation
Posted: Wed Mar 10, 2021 11:02 am
by AArtlone
Thanks a lot!