Skip to content

Build a D&D 5e Gameplay Simulation, Part 2

Part 2: Mingling Lingo

This series of posts is dedicated to building tools that support a simulation of simplified D&D gameplay.  To implement the simulation I’ll be using Python, PostgreSQL, Elastic, and Docker. The idea behind these blog posts is to document my progress through this project and interesting bits I find along the way. In part 1, I talked about where this idea came from, and what I’d like to accomplish.  In this part I talk about some of the terminology I will be using in this project and define the rough scope of this project in those terms.

This would be a good spot to mention that the code and data that I use for the examples that follow will be from the Systems Reference Document (SRD).  It is free to use for folks wanting to code into the system.   That should be enough info to get the questions going for anyone interested in delving deeper.  Next step would be to purchase the products that would provide the extra content you’re looking for.  

The tools I’m going to demonstrate in this series will not take the place of anything that already exists.  It’s just my attempt at building a set of tools that will help in  finding answers to the questions I find interesting.

If you’re familiar with D&D, these will hopefully make sense.   There might be some spots where the terminology doesn’t quite map directly to the game. After all, we’re trying to approximate a role playing game.   There are three components to the game:  Exploration, Interaction, and Combat.  This simulation will be heavy on the Combat and pretty limited in the other two components. 

A Character is the object of testing.  In a table top role playing game (TTRPG) a character is a persona that a player assumes for the game.  We’ll get into the specifics when we talk about what it takes to create a character.  For right now, let’s just consider a character to be a Halfling Bard, or Dwarven Barbarian.

A Foe is a predefined being or object that can be used to challenge characters or other foes. In a TTRPG, the Dungeon Master (DM) would usually use these to square off against a character or party of characters.  In our simulation, these will have already generated stats and abilities.  They will be a lot like characters at a high level, so that should make them fairly easy for us to work with in the simulation.

A party is a group of one or more players that are either characters or foes.

An encounter is what we’ll use to describe when two parties meet. One party will always be the one being challenged (PBC). The end result of an encounter is that one of the parties defeats the other by way of melee, surrender, or some more diplomatic means (conversion, seduction, manipulation, etc). Hey, it’s possible that a lucky Bard, or Cleric finds a way to avoid battle all together. The encounter result (win or lose) will always be from the point of view of the PBC.

A Series is a set of encounters meant to test certain specific aspects of the game.   One example might be testing the different styles of rolling character ability stats to see the impact on the character.

Initiative or player Order is given when the parties start an encounter. It simply means that there is an order that each player gets to do stuff.

Each encounter is made up by multiple rounds. A round consists of each player in both parties getting a chance to take their turn. The number of rounds an encounter takes to complete will be used in part to calculate the effectiveness of the PBC.

A turn for each character will contain the actions allowed for them. What they do for a turn depends on the type of character they are.

To describe our project in these terms, we are going to create is a process to define series that automate the creation and execution of many encounters.  The effectiveness of a party will be measured by the outcome of the encounters and how many rounds it took to reach each outcome.

Now that I’ve defined the project a little better, it’s time that to figure out how to make that happen.   In the next part of this series, I’m going to talk about randomness and the roll that dice play in a TTRPG.  In the meantime, go find a group and play!

2 thoughts on “Build a D&D 5e Gameplay Simulation, Part 2”

    1. Thanks Tes! I hadn’t thought about that, but yeah! I should be talking a lot about the technical bits of the rules as these progress. Thanks for the comment.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.