← All Workshops

MudEngine Part 9: The Twin Guardians

Step 3 / 11

Add Quest Data and the Vault to game.toml

We need changes to game.toml:

  1. Update Town Square — add King Aldric to room 4's description
  2. A new room (id 9) — the Ancient Vault, initially unreachable via normal exits
  3. A [quest] section — defines guardian pedestals, the retrieval item, and the reward passage

Update room 4 (Town Square)

Add King Aldric to the existing room 4's description so players know who to report to:

mud-engine/game.toml
[[rooms]]
id = 4
name = "Town Square"
description = "A bustling town square with a fountain at its center. Cobblestones gleam from the morning rain. King Aldric stands by the fountain, watching the crowd with a hopeful gaze."
exits = [
    { direction = "north", destination = 1 },
    { direction = "south", destination = 7 },
    { direction = "west", destination = 3 },
    { direction = "east", destination = 5 },
]
items = ["loaf of bread"]
mud-engine/game.toml
# ── Hidden room: Ancient Vault ──
# No exits — only accessible via quest portal

[[rooms]]
id = 9
name = "Ancient Vault"
description = "A shimmering cavern filled with ancient relics. The air hums with dormant magic. A stone pedestal at the center holds the legendary Star Fragment."
exits = []
items = ["star fragment", "ancient crown"]

# ── Twin Guardians Quest ──

[quest]
name = "Twin Guardians"
retrieval_item = "star fragment"
completion_room = 4

[[quest.guardians]]
name = "sun"
room_id = 5
label = "Sun Pedestal (Temple Courtyard)"

[[quest.guardians]]
name = "moon"
room_id = 3
label = "Moon Pedestal (Dark Forest)"

[quest.reward]
source_room_id = 4
target_room_id = 9
direction = "down"
target_name = "Ancient Vault"
target_description = "A shimmering portal descends into the Ancient Vault."
🎯 Quest config fields explained
FieldPurpose
retrieval_item = "star fragment"The item that triggers quest completion when it arrives in the completion room
completion_room = 4Town Square — where the King waits. When the star fragment enters this room (inventory or floor), the quest is won

The Ancient Vault has exits = [] — it's only reachable through the dynamic exit added by the server when both pedestals are active. The vault stays unreachable through normal movement. This is the same pattern from earlier: static data in TOML, dynamic state in memory.

King Aldric is represented by room 4's updated description. In a future workshop you could add full NPC dialog trees, but for now the King's reaction is driven by quest events and the description text.

Step 3 / 11