arXiv:2610.38975cs.AIOct 2026

Manuscript Offprint

arXiv:2610.38975

Dungeons & Dragons Encounter Analysis with Semi-Random Simulation in Foundry VTT

ravyn Hardcastle, Matthew Guzdial

Abstract

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

Dungeons and Dragons (D&D) is a tabletop roleplaying game (TTRPG) in which a Game Master (GM) guides a group of players, each of which control a single character, through a roleplaying adventure that includes improvisational narrative and combat simulation. An encounter in D&D is defined as a single instance of simulated turn-based combat where players control their characters as a collective party against a collection of enemy characters controlled by the GM. Generally, a party is a group of 4-5 players. Each character within a party has a complex set of actions and abilities which have evolved over time based on D&D's progression system. This leads to a diverse set of possible characters and therefore diverse actions that can occur in each encounter turn. These factors make it difficult to predict the outcome of a D&D encounter (Shyne and Cooper 2024). Encounter designers typically have some intended encounter difficulty (Shyne and Cooper 2024), and so we anticipate that they would benefit from some knowledge of how dif-

ficult their designed encounters are in practice, following from similar work in video games (Roohi et al. 2020).

Currently, D&D includes official guidelines for how to balance encounters with difficulty measuring systems. These systems budget encounters, summing the pre-authored difficulty (XP) of every monster. This method, however, does not account for all aspects of an encounter. This budget does not take into account the terrain of the encounter, the positions of the enemies, nor potential synergies the enemy abilities might contain. Finally, the largest flaw with this system conceptually is that it necessarily does not take into account the player party beyond size and level. D&D Beyond (Wizards of the Coast 2026) contains a tool that can import a group's party and give generic warnings for things like action economy or lack of synergy, but it still fails to account for the terrain and/or positions of enemies. Other popular encounter balancing tools (Toltz 2014; donjon 2009) rely on the existing D&D difficulty formulas, and so share the same flaws.

Foundry Virtual Tabletop (Foundry VTT) (Foundry Gaming, LLC 2019) is an open source virtual tabletop (VTT) system to play D&D, simulating traditional in-person over the table play. This system contains many existing implementations of D&D actions and abilities, primarily to speed up playing the game and to ease the cognitive load of players. It is also regularly used to play games of D&D by actual D&D groups (Foundry Gaming 2025), and therefore contains a friendly and familiar interface for these groups.

We have developed Mage-Hand¹, a tool that integrates into Foundry VTT and can play D&D automatically. Using Foundry VTT means we draw on the existing modelling for D&D action-sets. Our simulator can thus access anything that Foundry VTT can model. Mage-Hand plays the game automatically by simulating players in Foundry VTT, and taking semi-random actions; that is to say, taking actions largely randomly, but only selecting from actions that would actually have some impact to the game state (i.e. are possible actions to take and aren't obviously bad, such as attacking your teammates). We demonstrate that Mage-Hand shows a strong correlation with human-authored difficulty ratings of encounters, indicating that even a simple simulation can provide insight into the general difficulty of an encounter.

Existing D&D combat simulators lack features present in

Copyright © 2026, Association for the Advancement of Artificial Intelligence (www.aaai.org). All rights reserved.

¹https://github.com/ravynhardcastle/Mage-Hand

Mage-Hand. Many, particularly DnDSimulator (K 2023), do not simulate physical space. Shyne (2023)'s simulator only handles encounters at level 1 where there has been no progression and so much less variety in character actions. Moreover, neither of these simulators analyzed their accuracy compared to human-authored difficulty metrics over human-authored encounters. While this paper does not present a tool to design encounters, we do present a simulator that could be used in such a future tool, and, novelly, compare it to existing D&D standard difficulty ratings.

Our simulator showcases several contributions to the field. First, we demonstrate that semi-random virtual simulation can provide results that are strongly consistent with human assessments of difficulty. Our simulator also allows insight into particular patterns or trends within the simulation, such as the importance of individual enemies in encounters, potentially proving valuable insights to designers. Importantly, we also introduce a simulator that directly integrates into a web service that people already use to play TTRPGs. This opens up the potential for automated tools directly used by players, GMs, or tabletop game designers, and lowers the implementation burden for future encounter simulation.

References (30)