How I play TTRPGs in Emacs

Howard Abrams - Website: - Mastodon:,

Format: 15-min talk; Q&A: BigBlueButton conference room
Status: Q&A to be extracted from the room recordings


00:00.000 Introduction 01:20.680 Solo RPGs 02:47.440 Demo 04:11.760 Randomization 05:31.960 Moves 06:03.640 Reference 06:34.680 Story arcs 07:48.680 Using different stats 09:02.960 Dice rolls 09:34.800 Dangers 10:19.680 A strong success 11:49.680 Other solo RPGs 13:04.720 Conclusion

Duration: 14:36 minutes


Listen to just the audio:
Duration: 19:20 minutes


As an eternal Dungeon Master, I have a long history of collecting my notes in Emacs. When my son was very young, I would export my Org files to an HTML page that would include some magic JavaScript, so that when displayed on my iPad, I could touch a table to have it randomly return a line, or touch a phrase like 3d6+1, to have the web page return a dice roll.

Lately I’ve been getting into Solo versions of tabletop role playing games (TTRPG), and have had a fun time writing Lisp to support this style of play, and thought I’d share my code and my fun.

I’d like to begin by showing my game play in action: I’m currently playing Ironsworn with the Mythic GM Emulator and various other tables and procedures to stike a balance between playing a game and writing a book. Next I would like to show the code that supports the interface, and perhaps dive a bit deeper into some of the underlying mechanisms and functions, especially that function that randomly chooses entries from Org tables. I’ll end with a plan for turning my code into a community project, if people are interested.

Format (10 minutes, 20 minutes, description of other format) and outline: 20 minutes, but I could do less if you have too many submissions.

About the speaker:

Howard often gives technical, work-related talks at EmacsConf, but here he is talking about playing games in Emacs.


Questions and answers

  • Q: Where can I get this?
  • Q: How well would this suppliment freefoxm writing. short novels or novels?
    • A: I think it would be a good start. It is just an org file, so you can go as far as you'd like with the writing.
  • Q: Does the current version also have some utilities for doing multiplayer? (either physically or digitally) (since you mentioned, you previously did multiplayer sessions as well..)
    • A: Nope, it is just Solo, but that does sound like a fun idea.
  • Q: This game + CRDT (collabrative editing should be great for non-solo playing?
    • A: Perhaps, I'd like to try it out.
  • Q: How does one become super awesome like Howard Abrams??
    • A: "There's no secrets! Just follow your passions!"
      • Seriously inspiring.
  • Q: Please talk a little about how you produced such a slick presentation video!  Everything looked completely professional!
  • Q: Does table data allow for recursion?  I have a table that when I roll on it, a result comes up that references another table (e.g. result that returns "There are [random monster] haunting the cavern entrance" and we'd roll on [random monster] and inject them into the result.)
    • A: Yes.
  • Q: With your toolkit a list of good books would be nice to be included. example d&d, space, steampunk, cyberpunk settings
  • Q:  Hi Howard and Thanks for an outstanding presentation!!! What did you use to create the graphics in your presentation?
    • A: I don't really know. I will have to ask my son, as he did the editing and directing.
  • Q: Any plans to borrow tables from Dungeon World, or Ironsworn:Starforged and publish in the toolkit repository?  (
    • A: That does sound like fun.
  • Q: How has this impacted your imagination on the scenes?  (e.g. constraints by algorithms)
    • A: Yes, writing creatively can be very helpful in many other aspects of your life.
  • Q: Your essay/video "Literate DevOps" I consider a classic, and it's really opened my eyes on org-babel and what you could do. Do you still use those techniques at work? Have you come up with any improvements or changes to your workflow?
    • Yup. Still do.


  • Ironsworn Emacs project code:
  • Note that this code depends on my earlier project:
  • The alpha version of a RPG Toolkit code:
  • Really cool project! - Also the enthusiasm for the topic is really contagious!
  • "Every time Howard publishes a talk, I end up doing one more thing in a new radical or literate way inside Emacs - currently looking into how to go about literate snow shoveling for the winter ahead."
  • I can see this one is going to be a classic
  • the camera and lighting already has me sold
  • Such a vibe!
  • can I just (require 'howardism) and be done with it all?
  • i love this so hard
  • "Howard's talk is published on the site now" "I'll be in my bunk"
  • Holy CRAP Howardism WINNING EmacsConf2023
  • Could we add this to emacs beside dunnet?
  • Howard's stuff is always great. this particular thing is totally unchained. :D
  • "Howard approaches your table in the tavern. Do you (1) buy him a tanker of mead (2) kill him and eat his brain"
  • "Not showing-off," he said.
  • That was epic
  • Happy Hacking!
  • What's the emoji for a crowd picking Howard up on our shoulders and carrying him around
  • there's a peaceful aspect of having non web based stuff to play
    • Non-web, and not-networked!
  • the web is horrible. lisp machines are the future.
  • Imagine playing D&D with colab (from the previous talk)!


[00:00:00.000] Introduction

Hi there, I'm Howard Abrams. You may remember me from past conference talks as "Literate DevOps and the Temple of Doom" and "Using Eshell for Fun and Profit". I'm here to talk to you about my latest Emacs project: playing games, solo role-playing games. I started playing RPGs when I got my first copy of Dungeons & Dragons when I was 12. Yes, my original copy burned in the Great Satanic Panic of the 1980s, but that's another story. I started playing other RPGs like GURPS. These are some of my notes. Back then, I was typing them in Emacs, but I formatted them with LaTeX. Later, when I was introducing my kids to role-playing games, I actually typed them up still in Emacs, but now formatted them for a tablet. I wrote a little JavaScript code that allowed me to click on it, and it would roll dice, generate random events, keep track of turn order, you know, everything, so I didn't have to slow down the action of the game. Well, when my kids got older, I still managed to sneak in a game of D&D once a week at lunch. This pastime came to a screeching halt with the pandemic.

[00:01:20.680] Solo RPGs

I turned to playing role-playing games by myself to get my fix. Playing these silly elf games in solo mode has been part of the game for many years, but with so many of us stuck at home, solo role-playing games really expanded, creative people releasing some amazing ideas. What's a solo RPG like? Well, it's somewhere in the middle of writing your own story, where anything's possible, but you've got to do all the imaginative work; or reading a choose-your-own-adventure book, where the text is given to you, and you have free, a few predetermined paths; and tactical battle games, where dice determines everything. It kind of fits in the sweet spot between those. While I started removing the Game Master using the Mythic GM Emulator, Ironsworn really captivated me. I began with dice, pencils, notebooks, you know, just like when I was a kid. But taking notes on paper? Yeah, you know me. That's not my jam. Org mode is. And, you know, notes have to be in Org, well, why not write a little dice roller in Lisp? Well, when Shawn Tomkin released his Ironsworn under the Creative Commons, well, I could just download the entire text. I figured I could just render the entire game in Emacs.

[00:02:47.440] Demo

All right, enough talk. Let's get some Emacs action here, while I show you a bit of my game. When playing a solo RPG, I jot down the story notes in an Org file. I mean, did you expect anything less from me? I alternate between lengthy prose and short notes. As I'm both the writer and the audience, the goal is just enjoyment. So, this document is both a record log of my game sessions, as well as my character's character sheet. In most RPGs, a player's focus is a character sheet that lists all the attributes, the stats, equipment, powers, you know, that sort of thing. For my game, I wanted the focus to be the prose, or at least the notes. So, I put down all the stats as Org mode properties. Now, I can collapse a property drawer and have functions that just grab values from these properties. All right, let's play. While not important to my talk, I'm in the middle of a game. My character, Tegan, promised to help a village by tracking down the son of a village chief. A less-than-stellar roll meant I didn't catch him before he entered the mysterious underground structure of a relic of an ancient people. I just finished playing out the journey, and he's about to enter into the Catacombs of Svala's Blood.

[00:04:11.760] Randomization

Why that name? Well, that was actually what came up from an extensive random number generator that I wrote. As I wrote more and more functions to help me play this game, and since I don't play all the time, I created hydra. I can roll dice, I can roll dice challenges against the character stats, I can adjust stats. Lots of random generators come from this oracle section. For instance, are footprints going through the door? I press c, and I'm prompted with how likely. Since the villagers gave Tegan vague directions, and he didn't see any signs the contrary, I chose "likely". And, well, it originally said yes, and that's why I jotted this information down. Now, this is different than my character's ability to notice the prints. This is about generating the story, something that the game master would do in a typical role-playing game. Now, if I wanted to name something, or even the current weather, I have random tables with the C keystroke. Hmm, weather. Oh, it's summer, so hey, it's nice and clear. All right, let's play.

[00:05:31.960] Moves

The action in Ironsworn, like other Powered by the Apocalypse games, is driven by moves. So, I hit the m key, and all the moves show up. Now, I don't think I need to espouse the virtues of completing-read enhancements like Ivy. Here, I'm using orderless with vertico to help me find my choices. Since I've discovered a site, let's play that move.

[00:06:03.640] Reference

I seldom remember the details for the moves, so I figured, why not put the text of the book in an Org file and show it in a side window? The prompt at the bottom, asking for a name, is driven by the content in the displayed Org file. This allows me to enhance my game without changing the original code. So, let's call this story arc, Exploring the Catacombs of Svala's Blood. Ooh, sounds epic.

[00:06:34.680] Story arcs

Ironsworn tracks the beats of a narrative, so major plot points take up more room in the fiction than minor plot points. Similar games like Blades in the Dark use numbers to track these, so you can say something like, we're three quarters of the way through this story arc. Ironsworn just uses labels, and while I want this particular story arc to be significant, I really just want to get in, find this person, and get out. So, I'm going to call this "short". Next, it's asking about an Org mode header placement. While I originally wanted my Org files to be completely flexible, one thing I noticed in playing is that a pattern always emerged. The story became a tree. You see, story arcs were just a series of montages or scenes, and each of those were made of a series of events and challenges to overcome. So, each Org mode header has a track, which often becomes the number of subheadings. At any point, I can see how much track is being made. So, for instance, this one seems to be about a third of the way through.

[00:07:48.680] Using different stats

So, let's dive into this ancient place. Since I've been walking through a misty forest, I can imagine vines hiding an immense door and a humid, earthy smell as I peer inside. But I don't have to write that stuff down, or if I want to practice my writing, I can. I can imagine the place is dark, so Tegan lights a torch before peering into this obscure world. As this move mentions, the next move to make is called Delve the Depths. As soon as I select this move, it shows up on the side window, and explains that, depending on how you're moving through this ancient catacombs, is what kind of stat I roll against, and those stats show up at the bottom. You know, if I'm sneaking around, you roll against "shadow". If you're trying to go as fast as you can, it's "edge". But I kind of imagine that he's thinking through, being very careful about it. So, I'm going to select "wits". And I don't have any modifiers. Just about every one of my stats prompts me if I want to add or subtract any values.

[00:09:02.960] Dice rolls

A miss. I should explain how the dice roll in this game. The downside to Ironsworn is that the dice mechanics are more cumbersome than other games. You roll a 6-sided die, add to it your relevant stat, plus any modifiers. Next, you roll two 10-sided die and see how it compares. Of course, I programmed this in Lisp, but when I displayed it, I wanted to see all the dice. And I also just wanted to see the end results.

[00:09:34.800] Dangers

So I colored it. I rolled a miss, which means I need to reveal a danger. Sure, I could imagine all sorts of dangers, but this is a game. I've already made a random generator for dangers. In fact, I've made a random generator for dangers in an ancient underkeep. Discovery undermines or complicates the quest. Hmm, a complication for finding the chief's son? What about a labyrinth full of hallways and levels with lots of choices and almost no way of finding them? Yeah, that sounds like it fits pretty well.

[00:10:19.680] A strong success

Time for another move. This time, we're going to gather information, see if we can figure out which way to go. A strong hit. Excellent. I imagine Tegan noticing footprints in the dust and knowing where to go. The game suggests that when you get a strong success, you can increase your momentum. These game mechanics come into play later, but this function here allows me to adjust that stat +2. I don't even have to scroll to the top of the buffer and edit that value in my properties. At any point, I can take a look at those stats and see how they measure up. Again, I don't have to scroll up and take a look at my properties at the top of the Org mode file. That's how I play the game. It's just a recursive loop of playing a move, rolling some dice to see how it works, trying to answer the question based on your own imagination or random tables, which the game calls oracles, and play creatively until you decide to take a break and pick it up another time. I think you get the gist of how I play this dice and pencil game in Org Mode.

[00:11:49.680] Other solo RPGs

However, I found more solo RPGs to play. And of course, I want to render them in Emacs too. This code for Ironsworn was a bit too specific, so I decided to create a role-playing game toolkit. This project is still in the early stages, but I've created some functions for mimicking rolling dice, including a mini-DSL for making dice mechanics typical of many role-playing game systems. I've also ported over the random table system. A text file can just list entries to be displayed at random. I love that I can put dice expression and word choices in the entries. One type of random table allows you to essentially copy and paste a table from a published game into a text file. A frequency table is what I'm calling a list of random entries where some entries show up more often than others. I'm working on generalizing the character sheet attributes as Org properties, so if you're interested, check out the project at Codeberg.

[00:13:04.720] Conclusion

The point of my presentation is not to show off Ironsworn, how I programmed it, or even this new toolkit. You see, most engineers, when they get an idea for a game like mine, would make a web app. Nothing wrong with it. More people can play it, but web apps suffer from text entry. And don't tell me you prefer the keyboard interface to Google Docs. Oh, and the JavaScript framework du jour? Oh, I mean, that's a huge barrier of entry when all you want to do is have a bit of fun prototyping a game. What I'd like to impress upon you is that hacking Emacs to make personal games is a trip. Learning Lisp is, it's easy. And more, Emacs Lisp has some, well sure, it has some cruft. But really, some of those features that I would hate at a distributed system at work, like global variables, makes hacking easier when you just want to have some fun in your own system. So, grab your laptop, sink into your comfy chair, pour yourself a glass of scotch, and craft yourself an enjoyable evening. Happy hacking, my friends.

Captioner: sachac

Q&A transcript (unedited)

We are now live. Hi Howard, how are you doing? Great. Lovely to hear. As usual, it's always a pleasure to see your presentation and the amount of time and energy you put into it. Slightly sorry about the shoppiness of the broadcast. Do not worry, the talk will be in its full 30 fps quality on the website after the conference. Actually, right now. It's available right now. As usual, feel free to ask your questions in the in the pad. We've linked it both on the talk page and on IRC. I think I am on the right 1, right? This is a solo. Guys, questions, where are they? Oh, we do have questions, it's just that they're not in the right part. Okay, so I'm going to start, I'm going to read the questions to Howard and Howard will be answering them. And if you are interested in asking questions directly to Howard, I see a lot of people have joined us on BBB, so we'll first go through the questions on the pad and then we'll move on to the people on BBB. So Howard, starting with the first question, does table data allow for recursion, e.g. The result that returns they are random monster haunting the cavern entrance and we roll on random monster and inject them, inject into the result? Sorry a little bit of a complicated question. Do you want me to read it again, perhaps? Yeah, I think so. I didn't quite catch that. Okay, so does the table data allow for recursion? So I think... No, it does. I put a little, you know, there's some code that could, so you could, yeah, you get a random value that gets inserted and that random value could refer to another table and it can keep on going. I have not pushed that that hard because obviously it's, it might be a little on the heavyweight side. I can't imagine it to go too deep, though. you go a little too deep. We have something as Mike's list recursion, and stuff like this. So don't worry. Go willy nilly with your recursions. We've got comments about the fact that it's a really cool project and I feel like everyone watching would be agreeing. You've got a question about where you can get this. Do you have a github repository with all of this? presentation I kind of display that and I think I put it at the top of the the pad needs to be reformatted. This is all Aflacode, so obviously it's a personal hack. So people should just steal the code as opposed to looking at a real project to use. be great for non-solid plays. Are you familiar with CRDT? time and after seeing the previous talk on CRDT it's like, oh, I like that, and yes, I think that would be a fun idea. more humble than you did. I did a little bit, a little package in Org Mode for rolling dice and you had like a little formula like you could write 60 20 and it would throw 6 dice with 20 faces, 60 sorry, 6 die, Frenchmen here in the room, 20 faces and it would average them out or provide you any kind of stats needed. And this type of stuff works really well over CRDT because it's 1 edit inside of a file. If you start making edits in different parts of your file, it starts becoming a little more complicated because CRDT struggles when you're making many discrete changes inside of the same file. Does that make sense? Okay, yeah, no, I have not played with it yet. got any kind of... If it works, it works and it's amazing, but if it doesn't, feel free to send us messages because Shantan, who's the maintainer of CRDT, we've been looking into options to make it a little more resilient and work elsewhere for securely. Excellent. All right, Great. I'm going back to the previous question. So does the current version also have some utilities for doing multiplayer, like either physically or digitally, like we've done with CRUT? The question is because you mentioned you previously did multiplayer session as well? the random table at a random entry kind of thing. I was using that at my table. So, I'm an eternal DM. So I would always use that. Like somebody says, what's the name of that shopkeep? And I could just hit a key, and it'd come up with the name, and I'd just read it off. But it was still me generating it. So it wasn't something that people would see necessarily, but I would keep notes in it and then publish those notes. But yes, I don't know. This sounds all kind of, this sounds all intriguing. I think this would be fun. I think I need to get a group of like-minded Emacs people who want to play online. watching but also here in BBB. So we only have about 14 minutes until we go to the next talk and it might be a little short for a campaign, but we might just... Moving on to the next question, how does 1 become super awesome like Howard Abrams? And I very much agree. Just follow your passions. All right, moving on to the next question. Please talk a little about how you produced such a slick presentation video. Everything looked completely professional, and I'd agree. So tell us more. presentations, It's all just Emacs screen. I just felt like, oh, what I really want to talk about is how much fun I'm having and the little introduction. So my son actually is a YouTuber. So I asked him, and it's like, oh, I'll take care of your dad. And so he's the 1 that kind of prompted me. So I had a director. Don't know if that translates, You know, very over the top. I've never done something like this before. but it fits you so well. I think this over the top-ness combined with the editing, it just... fun. It was fun to do. meet for following Emax. moving on to the next question. Does table data, no sorry that's the 1 we did on recursion and we're not going to struggle through the reading of it again. Alright so with your toolkits, a list of good books would be nice to be included, example D&D, space, steampunk, cyberpunk settings. Do you have such a plan? bibliography of things I'm using and reading, But I don't know if I'd be writing anything. You've already proven you were amazing in very different, very varied topics. I'm sure you should give it 1 more try. up. I'm toying with writing something, but I don't know if it'd ever leave the Emacs buffer. Next question. Hi Howard and thanks for an outstanding presentation. What did you use to create the graphics in your presentation? Didn't we cover this 1 already? I can't remember. No, that was kind of hacked together. But then I just gave them to my son. And it's like, can you put the graphic right here and he goes no problem there it is like paying your son get yourself a YouTuber who knows how to use all the tools. I think he was using DaVinci, but he's got quite a few going. question. Any plans to borrow tables from Dungeon World or Iron Sword Starforge and publish in a TK repository? Not sure what TK is. so that would be fun and I'd love that. And I was just reading a way to render PDFs that you might own into Markdown format. And if it's in Markdown, it'd be easy to pull into Org Mode. So all of the Iron Sworn, that role-playing game, Since it's all under the Creative License, I think even the Star Forge is. So I think I could grab the Star Forge 1. I don't know about Dungeon World and their tables. But yeah, a lot of people are starting to publish those kind of tables. So yeah, that'd be fun. I'd like to render all those in text files that I could pull up like that. we had in the pad. We still have 9 minutes. I see plenty of people have joined us, including 1 person with a microphone on BBB. PlasmaStrike, do you have a question? And would you like to unmute yourself and ask it? I'm also going to check the chat. 1 that's got some great tables in it. Sorry, I'm just looking at the questions that are popping up here, too. themselves. I see people typing away questions. By the way, if you're going to type questions, perhaps do not put them on BBB, put them in the pad. It's a little easier for us to archive them afterwards. I'm going to give a little bit of time. I feel bad about going on break when I have you available and ready to answer more questions. Oh, you're too kind. how's your visualization of the books, or of your games at all? I didn't catch the first part. like, your imagination on the scenes and stuff like that because it's partly open and closed because you had that chart where you had that where you put it in the center of constrained by algorithms to enhance your creativity, you write it but it's not all freeform to where you have writer's block as much. That's exactly it. That's why I've been doing this. Creativity is a hard thing to foster. And having little prompts that you have to kind of work together, like twisty language, what does that mean? Oh, you have to kind of work with that. So yeah, that's 1 of the reasons why I got into doing the solo version of it, just because you kind of, it does really foster the creativity. Did that answer the question? time though of using it like While I'm still not ready to publish my files at all, but the first ones were much worse. like 2 months or something like that, like, could you close your eyes and see the rooms a lot better versus... And, you know, there's 1 solo game called A Thousand-Year-Old Vampire. I don't know if you've seen that 1 or not, but it's quite creative. It's very interesting. It's got a great setup to use. And When I was looking through it, it's like, I'm thinking of a typical vampire and this sort of thing. But then there's this YouTuber named Seth Skalkarski, if I can pronounce his name right. He was describing it. And he came up with a completely different vampire scene. And it's like, oh, I could see how people can kind of start working on these things and really see things differently. And the creativity and all that sort of stuff just really blossoms. how has the stories changed after using this toolkit or the solo games for 2 months? Like the scenes, like how you, like the stories that you'd start generating? I mean, a lot depends on just how much you're willing to put into it. But yeah, I've definitely had a lot of fun. And it's just been a lot more enjoyable and just more interesting. the stories changed a lot? Or more than that? is if somebody else is doing the evaluation and I'm not letting that out But I think so, but I think so so but I think your mileage may vary. So yeah, try it out Because it's supposed to be a video game that's in a similar spirit to that, where it helps you generate stories. Dwarf Fortress, RimWorld, Kenshi is another 1. but I haven't played it. But that 1 seems a little bit more structured, but still could be a lot of fun too. And then others, it's like, how far do you want to take it? Like I just picked up this 1 called Broken Cask. There it is, where you generate a little bar tavern, and then you start rolling events. Now, it gives a lot more stuff coming out of it. It's like, oh, this person's showing up and this is what's happening, but you can elaborate on it as much as you want. And that's what I'm thinking I might do. Hi, Mike, you got a question? I'm a big fan of your work on literate DevOps and your essay and video on that topic. I'm just wondering if you still use that workflow at work and have you changed how that process works or has it evolved over time since that video and essay were written? Yes, I still do it. It varies depending on the project and whatnot. But I still am using it. Yeah, yeah. In fact, I'm doing it with a lot of other things. Like all my configuration files are all in a literate style for Emacs. And even all the code that's in Ironsworn, the repo, if you go to the repo, it's the readme file. And yeah, that's just being rendered out to the Emacs file. So it is still all literate. Some things are just a little too complicated to just type up. news, but we have only about 3 more minutes of lifetime. By the way, feel free to stay and discuss any of the topic of today's session after we go off air and we'll be able to keep all of the nice discussion and put them on the talks page afterwards. Great. Howard, I would like to ask you if you have any last words regarding the presentation or the questions you've had. Well, the last question we had, actually, we had Mike come and ask it live. But do you have any parting words before we leave you? Okay. something. I mean, this Lisp stuff is a lot of fun. And I hope that came across. It's like, the project I made is just a personal thing and it was fun for me to make, but everybody's probably got some fun thing they could make as well. And just, I don't know, hack it yourself because all the, you know, think about adding multi-threading to Emacs. Maybe we don't want that, because that'll just complicate things. This is your own personal hacking sandbox, so go have fun. talking about Dwarf Fortress. In Dwarf Fortress, it's a very CPU intensive game because it needs to compute every single thing in the world and there's such a thing as the CPU death of the world where basically you've got too many cats that are just breeding constantly with 1 another and it creates so many entities that it just crashes, and the time it takes for the day to finish it, it just never finish. So I was going to say maybe multi-threading might be useful in this case for Emacs. So, wanting to foray into the future. Howard, and thank you Plasma Strike for your question, as well as Mike, who joined us. We're going to go live with the next talk in about 1 minute, and until then, well, I'm not going to put music, You can wait 50 seconds without music, you Zoomers. We'll be back in a bit. we are off. Thank you so much, Howard. I need to dash. And oh, I think he's already gone. So Bye everyone, I'll see you later.

Questions or comments? Please e-mail