Like Athena, this project emerged fully formed from my head

At least, from this historical record as preserved by git, it is.
In reality, this project represents a year of off-and-on development
in another git repository, and has been converted and reformatted
for (potentially) public consumption.

Particularly lacking is the Tables and other charts that make this
useful, but I need to make sure I don't violate any copyright laws, as
many of my tables were copy/pasted from digital books I own.
This commit is contained in:
Howard Abrams 2021-12-30 08:26:42 -08:00
parent 1602a9b01d
commit 5455785b08
18 changed files with 1915 additions and 29 deletions

View file

@ -1,13 +1,16 @@
#+TITLE: Dungeon Master Support in Emacs
#+AUTHOR: Howard X. Abrams
#+EMAIL: howard.abrams@workday.com
#+DATE: 2021-01-27 January
#+TAGS: rpg
The overlap between Emacs and running a Dungeons and Dragon campaign is... expected? Jotting notes and plans in an org-mode file has been great, but what if, during a game session, my notes became /more interactive/? I started creating some helper functions, which has now become a minor mode I use as a sort of layer on top of Org.
The overlap between Emacs and running a Dungeons & Dragons campaign is... expected? Jotting notes and plans in an org-mode file has been great, but what if, during a game session, my notes became /more interactive/? I started creating some helper functions, which has now become a minor mode I use as a sort of layer on top of Org. Let's blame this insanity on the pandemic, but it has been fun.
The primary interface is =f13= which calls up a /sticky/ Hydra to call my functions, but still allowing full cursor movement (but without changing the code):
[[file:README-hydra.png]]
The primary interface is =f12= which calls up a /sticky/ Hydra to call my functions, but still allowing full cursor movement (mostly):
#+attr_html: :width 800px
[[file:images/screenshot-of-hydra.png]]
*Note:* The screenshot isn't accurate, as I will change the code more often than updating this image.
* Themes
What emerged from some late night hacking is more than just a dice roller, but I may have to explain my rationale.
** Yes/No Complications
@ -26,16 +29,23 @@ I love this idea, and thought that I could extend it to d20 skill check rolls. P
According to [[https://www.hipstersanddragons.com/difficulty-classes-for-ability-checks-5e/][this essay]], the standard DC 15 skill check is actually /too hard/ for most situations, however, I don't trust my bias when choosing a value for a difficulty check. For the life of me, I can't find where I saw this idea, but you could choose a number of d6s for the challenge (1 is easy, 2 is moderate, etc.) and then add 7. That sounds pretty good, so after calling for a check, I can enter it, and Emacs confirm the results.
I want to be able to wrap both of these ideas into a single interface.
** Oracle
The [[https://cursenightgames.itch.io/victors-gm-less-oracle][Victor's GM-less Oracle]] game, has an interesting way to make decisions that I thought I would code. Essentially, you can have a good, middle and bad situation (that you pre-determine), and the oracle roll tells you which it is. While the idea is to generate a bell curve, it attempts to heighten the tension with some rolls adding a /cumulative modifier/.
I'm not sure if I will use this in-place (or in addition) to the previous luck-with-complication idea.
** Random Items
As a DM, we often have to invent unplanned details to our story...especially names, but even the trinkets in the goblin's pocket. Most DMs make lists of things, and some even pin some of these to their DM Screen, so they can look a player in the eye, and say, "My name is Samuel Gustgiver, I work at the bakery, but my friends just call me Sam."
I wanted to create a directory full of files containing tabular goodness, and have a function that would read all the files, and then allow me to choose a random item from anything on the list, for instance:
[[file:README-choose-table.png]]
#+attr_html: :width 576px
[[file:images/screenshot-choose-table.png]]
And then having the results show up easily:
[[file:README-results.png]]
#+attr_html: :width 682px
[[file:images/screenshot-results.png]]
Oh, and when the players ask what the name of that strange NPC was, I made a function to display the last randomly displayed message.
@ -68,16 +78,15 @@ So /often/ is four times likelier than /rarely/. I also have this list:
- 1 -- =legendary=
Where /common/ is ten times more likelier than /legendary/. Actually, after all the work in getting this working, I'm not sure how often, in an epic fantasy game, where rare should be commonplace for the player.
The best part of this project is my collection of tables, however, I'm not sure what content falls under fair use and what is proprietary, so at the moment, create a =tables= directory when you clone this project, and start adding your own files.
** DM Screen and Roll from my Notes
Finally, I wanted to quickly bring up a collection of rules and tables along with my session notes, a bit of a DM Screen for my screen.
Two things I noticed about org files, is that I could initially hide unnecessary meta information and focus on just the contents of the file's table or list by prepending this blurb:
#+begin_example
# Local Variables:
# eval: (narrow-to-region 121 633)
# End:
#+end_example
#+attr_html: :width 576px
[[file:images/screenshot-emacs-variables.png]]
Keep in mind, that this is only good for more /static/ files that don't change, as I have to figure out the range.
@ -90,7 +99,7 @@ The second thing I realized is that Org's links can call Emacs functions. This a
My initial ideas for listing a bunch of random NPC names and having a link that displayed one of them, got supplanted for the ideas I described above.
* Code
What do I have here:
- [[file:rpgdm.el][rpgdm.el]] :: Primary interface offering:
- [[file:rpgdm.el][rpgdm]] :: Primary interface offering:
- =rpgdm-mode=, plus a Hydra interface for easily calling the rest of these functions.
- =rpgdm-yes-and-50/50=, flip a coin and make a give a result with or without complications or bonuses.
- =rpgdm-skill-check=, given a target and a d20 dice result, returns yes/no, but possibly with complications or bonuses, depending on how well the result is.
@ -108,3 +117,14 @@ What do I have here:
- =rpgdm-tables-choose= and choose from one of the tables dynamically, and a result is displayed.
- [[file:rpgdm-screen.el][rpgdm-screen]] :: Still working on this one
- =rpgdm-screen= :: to display some tables in buffer windows on the right side of the screen.
Complicated details of the code is stored as literate files in the [[file:docs/][docs]] directory, specifically:
- [[file:docs/rpgdm-tables-freq.org][rpgdm-tables-freq]] :: Parsing /frequency/ tables, entries with labels for stating how often the occur.
- [[file:docs/rpgdm-tables-dice.org][rpgdm-tables-dice]] :: Parsing standard tables with dice ranges, so copy/pasting from rule books /just work/.
I'm also intrigued with rulesets that are unique, for instance:
- [[file:docs/fate-rpg.org][FATE]] :: Easy character creation and a nice bell-curve dice roll, but it requires [[https://fudgerpg.com/products/fudge-dice.html][special Fudge dice]], that are easy enough to recreate in Emacs. See [[https://fate-srd.com/][fate-srd.com]] for details about this game.
- [[file:docs/mythic-rpg.org][Mythic RPG]] :: A nice RPG for solo play as it has a GM-less option that I wanted to capture, see [[https://www.wordmillgames.com/mythic-rpg.html][Wordmill Games]] for details.
- [[file:docs/ironsworn-rpg.org][Ironsworn]] :: Another good solo RPG, I wanted to capture its quick check resolution. See [[https://www.ironswornrpg.com/][ironswornrpg.com]] for the free rules.