Source-linked AI summary
Dungeons & Dragons Encounter Analysis with Semi-Random Simulation in Foundry VTT
ravyn Hardcastle, Matthew Guzdial
TL;DR
Existing D&D difficulty metrics omit factors such as terrain, enemy positions, ability synergies, and party composition. Mage-Hand semi-randomly simulates encounters in Foundry VTT; its simulated results strongly correlate with human-authored difficulty ratings and in some cases align more closely with player expectations.
Problem
Published D&D difficulty systems sum predefined monster XP values but omit terrain, enemy positions, ability synergies, and party composition beyond size and level.
Source: §1 · p. 1Method
Mage-Hand simulates D&D encounters semi-randomly in Foundry VTT, taking possible actions while masking obviously bad ones and biasing movement toward opponents.
Source: §1 · p. 1, Mage-Hand · p. 3Results
Mage-Hand’s results strongly correlate with human-authored difficulty ratings in Lost Mines of Phandelver, and some deviations may better align with player expectations.
Source: §7 · p. 7Takeaways & Limitations
The authors conclude that Mage-Hand demonstrates the value of semi-random TTRPG simulators and the possibility of integrating them into existing tools such as Foundry VTT.
Source: §8 · p. 8Mage-Hand does not support every encounter out of the box, and simulating many D&D actions requires manual programming work.
Source: Limitations · p. 8
Abstract
from arXiv · showhide
Dungeons & Dragons (D&D) is a tabletop roleplaying game (TTRPG) in which a group of players, guided by a Game Master, roleplay a fantasy adventure with simulated combat and improvisational narrative. In D&D, an encounter is a single instance of simulated combat, where the players must use their characters to attempt to defeat a selection of enemy characters that the GM controls. D&D has multiple systems that approximate encounter difficulty by summing individual difficulty values that designers predefine for each enemy. However, since players and enemies can have a wide variety of capabilities, encounter difficulty depends on more than just the estimated difficulty of each monster. For example, these metrics do not account for positioning and dungeon layout, the synergies between monster abilities, and player party composition. We have created a tool, Mage-Hand, that can simulate D&D encounters semi-randomly using Foundry Virtual Tabletop, a virtual tabletop (VTT) system. In this paper, we show that our tool's simulated winrates have a strong correlation with D&D's published difficulty evaluation metrics, while also better aligning with some players' reported experiences.
1 Introduction
D&D encounter outcomes are difficult to predict because characters have diverse actions and abilities, while existing difficulty systems omit important encounter and party factors. Mage-Hand semi-randomly simulates encounters within Foundry VTT and shows strong correlation with human-authored difficulty ratings.
1 Introduction
- D&D characters have complex, evolving abilities, producing diverse possible actions that make encounter outcomes difficult to predict.Encounter designers may benefit from knowing how difficult their encounters are in practice, as in related video-game work (Roohi et al. 2020).Source: §1 · p. 1
- Existing difficulty budgets sum monsters’ predefined XP values but omit terrain, enemy positions, ability synergies, and party composition beyond size and level.Other popular tools relying on those formulas share these flaws; D&D Beyond adds generic warnings but still omits terrain and enemy positions.Source: §1 · p. 1
- Mage-Hand semi-randomly simulates D&D encounters inside Foundry VTT, drawing on its modeled action sets and filtering out impossible or obviously harmful actions.The authors report strong correlation between simulated results and human-authored difficulty ratings.Source: §1 · p. 1
- Prior D&D combat simulators either omit physical space or cover only level-1 encounters, and did not evaluate accuracy against human-authored difficulty metrics on human-authored encounters.This paper evaluates a simulator rather than presenting an encounter-design tool.Source: §1 · pp. 1–2
- Mage-Hand’s contributions include analyzing enemy-level patterns and integrating simulation into a VTT already used by players and GMs.The authors say this integration could support future automated tools and lower the implementation burden of encounter simulation.Source: §1 · p. 2
2 Related Work
Prior game-difficulty work uses search and simulation approaches, but D&D’s complex, encounter-specific strategies make some approaches difficult to apply. Mage-Hand differs from prior D&D simulators by analyzing difficulty against expert-authored estimates and integrating with an existing VTT.
Simulation for General Difficulty Analysis
- MCTS has been used for strategy and difficulty analysis, while Mage-Hand begins with a simpler approach and identifies MCTS as a possible future playstyle model.Survival Analysis uses random distributions based on a known optimal strategy, which is harder to identify for D&D’s complex, encounter-specific strategies; Mage-Hand instead uses many semi-random playthroughs.Source: Simulation for General Difficulty… · p. 2
- A* playability checks have limited efficacy for D&D’s large search space; this study instead analyzes existing encounters with known playability and expected difficulty.The comparison is against existing expert-authored difficulty estimates.Source: Simulation for General Difficulty… · p. 2, Tabletop Game Simulation · p. 2
Tabletop Game Simulation
- D&D research has also addressed narrative play and LLM assistance, while Mage-Hand focuses on combat difficulty analysis.Tabletop simulation has also been used for procedural content generation and difficulty analysis.Source: Tabletop Game Simulation · p. 2
- Prior tabletop D&D simulators generated encounters or covered combat only up to level 1; Mage-Hand evaluates difficulty across a broader range of levels.Unlike prior work that treated simulated outcomes as ground truth for generation, this work compares simulations with expert-authored difficulty estimates and integrates into an existing VTT.Source: Tabletop Game Simulation · p. 2
3 System Overview
Mage-Hand uses Foundry VTT to simulate encounters and turn playthrough logs into measures of encounter difficulty and character impact.
3 System Overview
- Figure 1 traces Foundry VTT encounters through automated combat, then logs playthroughs for winrates, character damage, and enemies first reduced to zero HP.Source: §3 · p. 2, Figure 1 · p. 3
Foundry VTT
- Mage-Hand fully supports fighters, rogues, wizards, and clerics at levels 1–4, while other actions can require added modules or custom tracking.Foundry VTT provides encounter and character controls; some actions, including effects that humans track trivially, need additional authoring.Source: Foundry VTT · p. 3
Mage-Hand
- Rollouts run until the round cap or one side's HP is depleted; semi-random actions exclude obvious blunders and bias movement toward the nearest opponent 50% of the time.At the round cap, the side with the higher remaining HP percentage wins.Source: Mage-Hand · p. 3
- 37 seconds was the mean wall-clock time per rollout (standard deviation 35 seconds), with rare pathfinding outliers and a longest run of 5 minutes 35 seconds.Source: Mage-Hand · p. 4
Analysis
- Simplified logs record winners alongside SRD XP difficulty values and support analyses of character HP, damage, and weapon or spell effectiveness.Source: Analysis · p. 4
4 Case Study: Old Owl Well
Mage-Hand’s 100 simulated Old Owl Well playthroughs characterized a difficult encounter and exposed how enemy-health trajectories differ between wins and losses. The case also illustrates a scope boundary: the encounter is intended to be resolved nonviolently, which Mage-Hand cannot currently simulate.
4 Case Study: Old Owl Well
- The case used 100 rollouts of a complex encounter with walls, multiple enemies, and spellcasting, features XP-based difficulty tracking cannot account for.Figure 2 shows the starting point, with four players along the bottom.Source: §4 · p. 4, Figure 2 · p. 5
- Old Owl Well was highly difficult in Mage-Hand’s logs, but its intended nonviolent resolution is outside the simulator’s current capabilities.Fan analysis also corroborates the encounter’s difficulty.Source: §4 · p. 4
- The Foundry implementation names the difficult enemy Hummot Carst, while the printed book calls him Hamun Kost.The passage notes that the names differ between the implementation and printed book.Source: §4 · p. 4
- Winning rollouts brought down Hummot Carst early, while losing rollouts often ended with the boss still at high health.Zombie-health separation between outcomes was smaller than the boss-health disparity.Source: §4 · pp. 4–5
5 Evaluation
The evaluation tests Mage-Hand on pre-existing Lost Mines of Phandelver encounters and compares simulated winrates with two D&D difficulty systems. It uses rank correlation because the hypothesized relationship is monotonic and negative, while winrate ceilings violate Pearson’s linearity assumption.
5 Evaluation
- Mage-Hand was evaluated for its accuracy on pre-existing, well-understood encounters, with future human-subject testing proposed for encounter-design utility.The tool integrates within Foundry VTT and is intended to support analysis of virtual campaigns.Source: §5 · p. 5
Lost Mines of Phandelver
- The evaluation used 39 of 43 Lost Mines of Phandelver encounters, with 100 simulated rollouts each and four preset party characters leveled and equipped for levels 1–4.Four encounters were excluded because they were absent from the Foundry module or had mechanics difficult to implement.Source: Lost Mines of Phandelver · pp. 5–6
Human Difficulty Approximation Comparison
- Spearman’s ρ compared winrates with 2014 and 2024 D&D difficulty ratings because the expected relationship was negative and monotonic, and ceiling-bounded winrates violated Pearson’s linearity assumption.Significance was assessed using a two-tailed t-test with n − 2 degrees of freedom.Source: Human Difficulty Approximation… · p. 6
6 Results
Mage-Hand winrates were strongly negatively correlated with both published D&D difficulty ratings. The authors also compare cases where simulated difficulty appears to align with player reports, while noting that those reports do not establish ground truth.
6 Results
- Difficulty values were normalized against each printing’s highest-difficulty threshold, with 1 marking an encounter exactly on budget; the value does not map to the same difficulty bucket at every party level.The chart labels each encounter’s actual difficulty bucket.Source: §6 · p. 6
Mage-Hand-Difficulty Rating Misalignment Interpretation
- Player discussions describe Nezznar as underwhelming and Old Owl Well as brutal, but the authors present these reports as suggestive alignment rather than definitive ground truth.Old Owl Well accounts include advice to avoid the encounter and reports of characters going in and out of consciousness.Source: Mage-Hand-Difficulty Rating… · p. 6
6 Results
- 2014 difficulty ratings correlated with winrate at ρ = −0.82, p < 0.001, and 2024 ratings at ρ = −0.79, p < 0.001.The negative correlations indicate that higher estimated difficulty corresponded to lower winrate; Figure 5 compares winrates with normalized 2014 ratings.Source: §6 · p. 6, Figure 5 · p. 7
Mage-Hand-Difficulty Rating Misalignment Interpretation
- A later reprint increased the unchanged Old Owl Well enemy’s XP rating sixfold; with that rating, the encounter would rank second-hardest by both D&D systems, while Mage-Hand ranked it third-hardest.The passage describes those revised ratings as deadly in 2014 and high in 2024.Source: Mage-Hand-Difficulty Rating… · p. 7
7 Discussion
Mage-Hand’s simulated encounter difficulty ratings strongly correlate with human-authored ratings, while some deviations may better match player experience. Its results characterize combat difficulty rather than true winrates, with narrative play and incomplete encounter support limiting its scope.
7 Discussion
- Mage-Hand’s simulated difficulty ratings strongly correlate with human-authored ratings, and some deviations may better match player experience.Source: §7 · p. 7
- Mage-Hand does not estimate true encounter winrates because it does not model how any particular group’s players would play.Source: §7 · p. 7
- Integrated into Foundry VTT, Mage-Hand could help designers spot locations where simulated players get stuck, revealing spatial problems that winrate alone cannot show.Source: §7 · p. 7
Limitations
- Mage-Hand omits narrative components, so designers may need to account for narrative shortcuts by adjusting an encounter’s expected difficulty.Source: Limitations · pp. 7–8
- Mage-Hand does not support every encounter out of the box because many D&D actions require manual programming.Source: Limitations · p. 8
- More intelligent agents such as MCTS could risk less realistic behavior than random play and substantially increase experiment time.Source: Limitations · p. 8
8 Conclusion
Mage-Hand simulates levels 1–4 encounters in Lost Mines of Phandelver through Foundry VTT. Its ratings correlate with human expert ratings, while some deviations align with player expectations.
8 Conclusion
- Mage-Hand is embedded in Foundry VTT and simulates encounters from levels 1–4 in Lost Mines of Phandelver.Source: §8 · p. 8
- Mage-Hand’s simulated difficulty strongly correlates with expert ratings based on XP, while some deviations align with player expectations.Source: §8 · p. 8
- The paper argues that semi-random simulation and integration with existing tools such as Foundry VTT can support research use and ease engineering for hypothetical TTRPG digital tools.Source: §8 · p. 8