Skip to content

Quest Chains

Quest chains are sequences of quests that must be completed in order. Each quest in a chain can require completion of a previous quest before it becomes available to the player. This is controlled through the requiredQuestId field, which links quests together into a progression.

Quests link together through their IDs:

  • questId: Unique identifier for the quest
  • requiredQuestId: The quest that must be completed before this one unlocks

When a quest has a requiredQuestId, it remains hidden or unavailable until the player completes the prerequisite quest.

  1. Plan your sequence: Determine the order of quests and their narrative flow
  2. Assign sequential IDs: Use a consistent ID range for related quests (e.g., 90001, 90002, 90003)
  3. Set prerequisites: Each subsequent quest references the previous quest’s ID via requiredQuestId
  4. Define tasks: Specify what the player must do in each quest
  5. Add strings: Provide localized names and descriptions

Common task types for quest chains:

  • visit: Player must travel to a specific area
  • hunt: Player must defeat a number of enemies
  • collect: Player must gather items
  • deliver: Player must bring an item to an NPC

Each quest can have associated strings for localization:

  • name: The quest title shown in the quest log
  • description: Detailed instructions or narrative text

Strings are defined inline with the quest data and automatically generate the appropriate string sheet entries.

This example creates a simple quest chain: an introduction quest leads to a hunting quest, which leads to a reward quest.

spec:
version: "1.0"
quests:
upsert:
# Quest 1: Introduction
- questId: 90001
type: normal
startNpcId: 1001
completeNpcId: 1001
tasks:
- type: visit
areaNameId: 1
strings:
name: "Welcome to the Village"
description: "Speak with the village elder."
# Quest 2: The Hunt (requires Quest 1)
- questId: 90002
type: normal
requiredQuestId: 90001
tasks:
- type: hunt
npcId: 2001
amount: 10
strings:
name: "Clear the Fields"
description: "Defeat 10 wolves threatening the village."
# Quest 3: Reward (requires Quest 2)
- questId: 90003
type: normal
requiredQuestId: 90002
tasks:
- type: deliver
itemId: 3001
strings:
name: "Claim Your Reward"
description: "Return to the elder for your reward."

Using upsert ensures the operation is idempotent—running the same file multiple times will update existing quests rather than creating duplicates.