This is not over complicate things? I mean, I understand that greed for retrieving the chest would be enough to fire the quest. I don't understand why add the thread on "unhappiness".Tony Li wrote: ↑Wed Nov 21, 2018 6:17 pm Hi,
Procedural quests are a little complicated to get started with. I added an example to the tutorial assets:
QuestMachineTutorialAssets_WithProceduralChestQuest.unitypackage
To play it, you must also import some free assets from the Asset Store:
The files in are Quest Machine Tutorials / 05 Procedural Quest. The scene is Supplemental Chest Example.
- A Piece of Nature: https://assetstore.unity.com/packages/3 ... ture-40538
- Toon RTS Units - Demo: https://assetstore.unity.com/packages/3 ... demo-69687
- Toon RTS Units - Orcs Demo: https://assetstore.unity.com/packages/3 ... emo-101359
The quest giver will generate a quest to bring him the chest of gold from the mysterious circle.
It uses these assets:
The first step of procedural quest generation is to make a list of the entities that the NPC knows about. In this case, the NPC watches the Mysterious Circle domain, which contains a chest. So the NPC knows about the chest.
- DomainType_Circle: Represents the mysterious circle.
- EntityType_Chest: Represents a chest of gold.
- Faction_Chest: Represents the chest's faction.
- Action_Retrieve: The action to move the chest from its current domain to the player's inventory domain.
- EntityType_QuestGiver: Represents the quest giver.
- Greed: Drive type.
The second step is to run urgency functions on all of the entities. The NPC's faction relationship to the chest is -100. The chest has a Threat urgency function. You can think of it like this: The fact that the chest is out there in the world, and not in the NPC's possession, is a "threat" to the NPC's happiness. So the NPC will choose to make a quest about the chest.
The third step is to choose an action. The NPC will choose the Retrieve action, which removes the chest from the world -- that is, it removes the "threat" to his happiness.
Quest Machine doesn't have an inventory system, so the example action is simplified. In your game, you could define a new action to actually give the chest to the NPC. The action could listen for a message like "GaveToNPC"+"Chest".
The quest giver's Greed drive is +100. Action_Retrieve has a Motive whose Greed is +100. The quest giver will choose this motive because it's similar to his Greed drive.
The last step is to make the plan. The Retrieve action has no requirements, so the plan is only one step.
Once you get the basic quest working, you can make it more complicated. For example, maybe the Retrieve action only works if there is an open chest. To change from a closed chest to an open chest, the player must complete a "Cast Spell" action. To cast the spell, the player must first get the spell scroll. To get the spell scroll, the player must defeat a wizard. Then the plan might consist of these actions:
- Defeat: Wizard (Effect: adds scroll to world)
- Get: Scroll (Requirement: scroll is in world. Effect: adds scroll to player)
- Cast: Scroll (Requirement: player has scroll. Effect: remove closed chest; add open chest)
- Retrieve: Chest
I say because otherwise everytime to design a quest, you need like double study: Drives, threads....Is not possible to create the quest just with one of them?
Thanks,