{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.

This is not the same as a real, playable dungeon. {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

{nearestDungeon}

Example

{ "readAloud": "<div class='read-aloud'><p>The captives are being held in {nearestDungeon}.</p></div>" }

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.

Combined Parameters

Combine type and difficulty to find exactly the right dungeon. No spaces allowed.

Example: Nearest Hard Cave

{nearestDungeon:type=Cave,difficulty=hard}

Result: Finds the nearest cave-type dungeon with hard difficulty.

Example: Nearest Easy Crypt

{nearestDungeon:type=Ancient-Crypt,difficulty=easy}

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.

{nearestDungeon:type=Cave}

Underground-Ruins

Buried temples, forgotten halls, and underground ruins. Perfect for treasure hunting or ancient secrets.

{nearestDungeon:type=Underground-Ruins}

Sewer

Urban sewer systems beneath cities. Great for urban adventures, thieves' guilds, or monster infestations.

{nearestDungeon:type=Sewer}

Ancient-Crypt

Crypts, tombs, and burial sites. Ideal for undead encounters, curses, or necromancer quests.

{nearestDungeon:type=Ancient-Crypt}

Monster-Lair

Lairs of monsters and dangerous beasts. Perfect for hunting quests or eliminating threats.

{nearestDungeon:type=Monster-Lair}

Ruin

Crumbling surface ruins of old castles or temples. Good for exploration and historical quests.

{nearestDungeon:type=Ruin}

About "Nearest"

Honestly: "nearest" is currently nominal. Distance would need real coordinate/adjacency data connecting your starting town to each dungeon, which the hand-authored 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

Important: Each unique placeholder + parameters combination is cached per campaign. Once resolved, it will always return the same dungeon.

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:

"a nearby dungeon"
Tip: If you're getting fallback text, try removing the difficulty filter or using a different dungeon type.

Complete Example

{ "sceneId": "ep1-scene6", "title": "The Rescue", "readAloud": "<div class='read-aloud'><p>Following the tracks, you discover the bandits have taken the captives to {nearestDungeon:type=Cave,difficulty=medium}. The entrance looms before you, dark and foreboding.</p></div>", "choices": [ { "text": "Enter the dungeon and attempt the rescue", "nextScene": "ep1-scene7-dungeon" }, { "text": "Scout the area first (DC 15 Stealth)", "nextScene": "ep1-scene7-scout" } ] }

Best Practices

Match Type to Story

Choose dungeon types that fit your narrative:

{nearestDungeon:type=Ancient-Crypt} ✓ Good for undead/necromancer quests
{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=easy} ✓ Good for level 1-3 parties
{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:

{nearestDungeon:type=Ancient-Crypt,difficulty=hard}

This finds a hard-difficulty crypt perfect for a high-level undead quest.

See Also