Coté

Coté

Bootstrapping ChatGPT 3.5 and ChatGPT 4 to be a Dungeon Master for solo play in Dungeons & Dragons

I’ve been experimenting/playing a lot with ChatGPT as a Dungeon Master. I like to call this “ChatDM.” That is, I’m a player, and it DMs for me. It’s not, like, great, but it is good enough if you want to co-imagine with it. Overtime, it is a great world building co-author with you. The current problem with using ChatGPT as a Dungeon Master is that it doesn’t have a long enough memory. I haven’t gone and checked the actual token limits and stuff, but it very quickly forgets things that happened long ago and will “hallucinate” past events, NPCs, etc. It does a good job, though! But it’s not accurate.

For example, through several playing sessions and then some text tuning with the ChatDM, I developed the idea and write-up of The Lost Tribe of Elderwood. I did this through a combination of me just making the stuff up, but also I had a few game sessions where the author of the text (Rye Leafoot) traveled to meet with The Lost Tribe to study them. Actually, I did it through another NPC, Sam the Tinker. I had ChatGPT play Sam and I “DM’ed” this. It was great, because the simplistic naïveté of ChatGPT worked to ask all the “dumb questions” that you need to go through to explore and brain storm for world building. And, it was super-fun! I started playing Sam walking into Aural’s Reach, meeting some lumberjacks, getting to know Rye Leafoot (the one who writes the monographs about Elderwood), and then played out traveling to meet The Lost Tribe and talking with them.

That memory problem is a…problem, though. If you can imagine doing this for, like four or five hours over several days, the short-term memory of the ChatDM is a problem. Until this problem is solved, the real problem that it’s not creative/imaginative enough can’t even be addressed.

What I’ve been doing to get over that problem is figuring out how to pass context back and forth between ChatGPT sessions. (The other issue is that you only get 50 interactions with ChatGPT 4 per three hours, so you’ll have to wait or shift-down to ChatGPT 3.5 which is much worse for ChatDM’ing.)

There’s two “context” passings that I do. First, I’ve typed up my own very briefing prompts to give a new ChatGPT session. I might should ask ChatGPT to fix these up, but I haven’t! To fit into the memory constraints, I’ve written several chunks that go from world, to city, to character, and then some other ones I’ll use as needed.

So, when I open a ChatGPT session to play Dungeons & Dragons, I give it this prompt to convert it to a ChatDM:

I want you to play a D&D 5e dungeon master. I will give you some brief explanations (“DM reports”) of the campaign setting. As we progress I will give you more DM Reports as needed. You will be inventive and creative in creating NPC interactions, encounters, adventures. You will control all NPCs and monsters and interact with me. Always ask me (the player) what to do next and never take actions on my behalf. Award XP when appropriate. If you have doubts about what to do, ask me how to decide.

I’ve seen a lot more detailed prompts that get detailed about combat mechanics and stuff. Many of those might be ChatGPT 3.5, but ChatGPT 4 is pretty good with the above.

Combat is still weird - sometimes I’ve fight a goblin (that typically has 7 hit points) and I have to ask how many hit points it actually has after doing 40 points of damage. Also, the ChatDM isn’t good at using monster tactics, like the goblins' strategy of making ranged attacks with a bow and then using other goblins to make hit and run attacks with nimble escape.

Then, I give it this prompt for my campaign setting, Elderwood:

This is the campaign setting: Elderwood is a dense forest of oak and pine. North is a steep long mountain range, The Elves’ Wall. West is a steep cliff drop-off to coastal planes like California coast, called The Royal Coast, runs along Sea of Passage. South of Eldergrove same drop off and stone forest. East more forest. The River runs diagonal through Elderwood, curvy and wide. In middle on north of The River is Aurel’s Reach. City of 15,000. Primary industry is lumber, artisanal crafts, supporting, guilds, trade bound west and east along The River. Farms across river support Aurel’s Reach. Govt is council of 7 elected. City is: old city in core that is pristine and well planned, ancient elven and human made. City expands from there in chaotic, haphazard walls built over 800 years woven in with forest buildings in trees, free standing, Spaghetti bowl of streets. Open air markets. Parchment row: book sellers row. The Whispering Willow tavern right on north most wall in town built half/half in giant redwood tree. Marna human owner, Bardin dwarf barman, Maria gnome waitress. The city is lively mix of all D&D creatures and races, coming and going, most people chaotic good or good of some type. Part of forest that surrounds Aurel’s Reach is Eldergrove. Rest of Elderwood is a typical D&D forest with magical glades, unexplained ancient ruins, dark parts of forest. Lumber camps and creeks and small villages throughout. Use forest encounter tables.

Since The Whispering Willow Tavern is so key to the campaign and adventures I do, I detail it a lot.

Then, I tell it about the character I play, Rye Leafoot:

I am playing a 5th level druid (of the Circle of Land, forest) lightfoot halfling named Rye Leafoot. He is chaotic good, curious, and known by many about town and in the forest. With the sage background his passion is writing monographs about Elderwood and writing on topics like National Geographic magazine. He rarely passes on the opportunity to learn more, question people and creates, and document them in his notebooks for research. He is a gourmand and keeps the halfling meal schedule (Breakfast 7 am. 2nd Breakfast 9 am Elevenses 11 am Luncheon 1 pm. Afternoon Tea 3 pm. High Tea 6 p.m. Supper 9 p.m. Pudding & Cordials 11 p.m). He lodges at and is well known at The Whispering Willow tavern/inn, has his own reserved table in back corner nook that he uses as a study and personal library. He has established relationships with some city guards, merchants of fine food (Alden the wine merchant, Tormin halfling cobbler, Elera elven ranger of city guard, Thanlin the alchemist, more). He has a passive perception of 19, passive investigation of 17, passive insight of 14. Other than those, I will do all other checks and rolls for Rye and dictate all his actions.

I tuned this a little bit as I started using it. The hafling meal plan is one of the fun parts of role playing for me, so I wanted to make sure it was core to ChatDM’ing the character. And, you can see I fed it some NPC friends.

So far, I haven’t had success with ChatDM using things like passive perception in the background, but I keep feeding it those stats. When I know a DM should make those checks, I tend to prompt ChatDM to do so. (And, come on, people: how can you passive perception be higher than your active passive - I’ve read the explanations, but it seems silly - I like the idea of that being a floor).

These three prompts are pretty good.

Once feeding these prompts in, the ChatDM likes to start an ultra-cheesy adventure. It often starts with the stereotypical thing of starting the game in the tavern. And far, the adventure always starts with Elera coming into the tavern with some problem (bleeding trees, an ghost lumber camp, etc.) In those cases (and when it does something else I think is cheesy), I’ll just write: never mind that, let’s go back.

As an example of specific information that I don’t feed it initially, here’s an entry about the Elderwood lumberjacks:

The lumberjacks of Elderwood generally are harmonious with the forest. They understand that they must maintain balance with the forest and this is what the Elderwood is so expansive and vibrant. Not all lumberjacks behave kindly to the forest but most do. Mistakes are made as well. Luberjacks typically go on month long jobs into the forest in groups of three or 18. Some lumber camps are long established. They typically fell trees and take them to the river to float them down as lumber barges, returning to Aurel’s Reach on a barge when done. Luberjacks follow the trope of blue collar hard workers a small number follow druidic religious thinking, all are superstitious and some know about Sylvan creates and lore. Lumberjacks are of all humanoid races and there are some rare saytrs and other humanoid Sylvan lumberjacks.

When I had it DM a recent adventure, when I got to the lumberjack camp, I fed it this information and it did pretty well.

I haven’t done this yet, but I want to try re-feeding the ChatDM this info when it forgets. I’ll say something like, “as a reminder, here’s info about Rye,” etc.

In addition to the campaign setting, I wanted a way to keep the DM’s memory about small things going. To do that, I have the ChatDM write “DM reports” about what happened in an adventure. For example, Rye befriended a pack of dire wolves in a recent adventure and, you know, I’d certainly like to do more with that. ChatDM will forget this hours later. So, I wanted to be able to feed it a report to remind it. I asked to to “write a report about what just happened (the encounter with the dire wolves) in 300 words.” It outputting this:

DMReport: Encounter with The Moonclaw Dire Wolves Date: Early Autumn, exact date to be confirmed Location: Northwestern parts of Elderwood, en route to investigate lumber camp anomalies. Summary: Rye Leafoot, a 5th level Druid, encountered a pack of four dire wolves known as the Moonclaw while traveling with Elera, an Elven ranger. Utilizing the "Speak with Animals" spell, Rye engaged in diplomatic communication with the pack leader and was led to an injured young wolf. Actions Taken: - Offered dried pork sausage to the Moonclaw as a token of goodwill. - Healed the injured young wolf using "Cure Wounds" spell, restoring it to full health. Outcome: - Gained the respect and gratitude of the Moonclaw pack. - Was told the location of a dangerous trap near a large oak by a creek. - Granted the privilege to return and meet with the Moonclaw in the future. Notes: - The pack leader expressed interest in future meetings. - Made a mental note to disable the mentioned trap upon return.

I haven’t used this yet, but I will soon. My hope is that through a combination of my own role playing, using some as you know Bob’ing, and the report above I can more or less restore the ChatDM’s memory of Rye’s relationship with the dire wolves. I saw it use TV Tropes when I asked it to profile some NPCs awhile ago and I have in the back of my head to start using those as references for characters. It seems to know them well, so that would be a great way to get around this memory problem, e.g., “Meribella is a ‘Jerk with a Heart of Gold’ dwarf.”

One mechanic I’ve used for this also is to have the ChatDM write an entry for Rye’s notebooks, or his monograph. To do this, I’ve had it analyize Rye’s writing style and general characrer and will feed it that as “in the style of.” You can see the effect of that in most of the Elderwood Guidebook entries, like The Whispering Willow one. The style matching is kind of arch, but good enough, especially for me to go in and rework it with minimal effort, like The Lost Tribe entry.

I’ll see how this goes.

Oh, one more thing. To add to something I wrote about, another theory I have is that after doing an adventure, you can ask the ChatDM to write an outline for a module out of what happened. It’s short memory will be a problem here, but what I’m hoping for is that I can create an adventure by playing it out and then ask ChatDM to spit out the outline. Then I can use that to start fleshing the adventure out more.

@cote@hachyderm.io, @cote@cote.io, @cote, https://proven.lol/a60da7, @cote@social.lol