{nearestDungeon}
Substitutes a dungeon's name into your prose - flavor text only, it doesn't open anything. Supports filtering by dungeon type and difficulty to match your quest narrative.
{nearestDungeon}/{randomDungeon} just drop
a name into read-aloud text - there's no map, no rooms, nothing to
explore. If you want a dungeon the DM can actually open and run
(fog-of-war room reveal, monsters, an initiative tracker hookup),
author it in your campaign's own dungeons[] array and
reference it with {dungeon:your-dungeon-id} instead -
see Campaign Structure. This
page is only about the flavor-text version.
Dungeon flavor-text entries come from an optional, hand-authored
data/maps/locations.json file - unlike towns
({nearestBurg}), Campaign
Cookbook doesn't generate these automatically. If that file doesn't
exist, or nothing in it matches your filters, this resolves to generic
text ("a nearby dungeon") instead of a literal {nearestDungeon}.
Basic Usage
Example
Result: "The captives are being held in The Dark Caves." (closest dungeon to starting location)
Parameters
Use parameters to filter dungeons by type and difficulty to match your story needs.
-
type
string
Filters dungeons by type. Only searches for dungeons matching this type.{nearestDungeon:type=Cave}
Valid Types:
Cave- Natural cave systemsUnderground-Ruins- Buried temples and ruinsSewer- Urban sewer systemsAncient-Crypt- Crypts and burial sitesMonster-Lair- Lairs of monsters and beastsRuin- Crumbling surface ruins
-
difficulty
string
Filters dungeons by difficulty level. Use this to match party level.{nearestDungeon:difficulty=hard}
Valid Difficulties:
easy- Suitable for low-level partiesmedium- Balanced challengehard- Difficult encountersdeadly- Extremely dangerous
Combined Parameters
Combine type and difficulty to find exactly the right dungeon. No spaces allowed.
Example: Nearest Hard Cave
Result: Finds the nearest cave-type dungeon with hard difficulty.
Example: Nearest Easy Crypt
Result: Finds the nearest ancient crypt with easy difficulty.
Dungeon Types Explained
Cave
Natural cave systems. Good for goblin hideouts, bear lairs, or natural exploration.
Underground-Ruins
Buried temples, forgotten halls, and underground ruins. Perfect for treasure hunting or ancient secrets.
Sewer
Urban sewer systems beneath cities. Great for urban adventures, thieves' guilds, or monster infestations.
Ancient-Crypt
Crypts, tombs, and burial sites. Ideal for undead encounters, curses, or necromancer quests.
Monster-Lair
Lairs of monsters and dangerous beasts. Perfect for hunting quests or eliminating threats.
Ruin
Crumbling surface ruins of old castles or temples. Good for exploration and historical quests.
About "Nearest"
locations.json format (pixel x/y
positions) doesn't supply to the resolver. In practice,
{nearestDungeon} resolves to the first dungeon in your
locations.json that matches your type/
difficulty filters, not a geographically nearest one.
Use the filters to narrow down to the right dungeon rather than
relying on "nearest" to mean anything geographic.
Consistency & Caching
Caching Example
Scene 2: {nearestDungeon:type=Cave} → "The Dark Caves"
Scene 7: {nearestDungeon:type=Cave} → "The Dark Caves" (cached)
Scene 9: {nearestDungeon:type=Ancient-Crypt} → "Tomb of the Lost King" (different parameters)
Fallback Behavior
If no dungeons match your criteria, the placeholder will resolve to generic fallback text:
Complete Example
Best Practices
Match Type to Story
Choose dungeon types that fit your narrative:
{nearestDungeon:type=Cave} ✓ Good for bandit/monster hideouts
{nearestDungeon:type=Sewer} ✓ Good for urban adventures
Match Difficulty to Party Level
Use difficulty filters to ensure appropriate challenges:
{nearestDungeon:difficulty=medium} ✓ Good for level 4-7 parties
{nearestDungeon:difficulty=hard} ✓ Good for level 8-12 parties
{nearestDungeon:difficulty=deadly} ✓ Good for level 13+ parties
Combine for Precision
Use both parameters for exact dungeon selection:
This finds a hard-difficulty crypt perfect for a high-level undead quest.
See Also
- {randomDungeon} {dungeon:id} - Random dungeon instead of nearest
- {nearestBurg} - Nearest settlement reference
- Parameter Syntax - Complete guide to parameter formatting