Dashboard to See Dice Stats from Roll20
Unsurprisingly, I am a member of a DnD (Pathfinder actually) group. During the pandemic we switch to playing online with a service called Roll20. We would often joke about the software using weighted dice, so I had the idea to analyze the data and see who’s the unluckiest.
Getting the Roll Data
Roll20 sort of makes it easy to see the entire history of rolls. Every roll is added to the chat log, and you can access the chat archive from a link on the front page of the campaign.
This brings you to an archive page where you can click a “Show on One Page” button to get the entire history loaded.
I created a Jupyter notebook https://github.com/axlan/roll20-chatlog-stats/blob/main/parsing_notebook.ipynb to go through the parsing process, since it speeds up trial and error by letting you easily cache the slow processing steps and iterate quickly.
I used BeautifulSoup to parse the HTML, and getting the basic fields was pretty straight forward.
I already knew I wanted to make a dashboard, so I decided to take some extra steps to classify the data. This would it would make it easier to create the fields for filtering and grouping the data:
- The message archive had a lot of results that weren’t rolls, so I filtered down to just the messages with rolls
- To make comparison easier, I further filtered down to just rolls of 20 sided dice
- I took all the different types of rolls (attacks, skills, spells, etc.), and simplified them down into a small set of types
- I grouped the rolls into the game sessions we played
With all this done, I stored the results as a CSV to be loaded by the dashboard.
Creating the Dashboard
Fun With the Data
Unsurprisingly, the full data set looks fairly random.
One thing I wanted to look at was how the types of rolls we made changed session to session. My hypothesis was that the more skill checks we did versus attacks (“strikes”), the more we tried to solve the challenges non-violently. The data seemed to back this up based on my memory.
While the overall data is fairly random, you can definitely see how unlucky some people can be for a single session. By sorting the data by “Average Roll” here we can see that Milos had a fairly rough night.