Live data from Hacker News

LLM based agents as Dungeon Masters

studenttheses.uu.nl

51–60 of 144 posts

Re: LLM based agents as Dungeon Masters

#51

Last year, I built a DM for myself using the OpenAI api and an elevenLabs voice generator. I asked it set my character in Baldur's Gate, so it could pull upon the huge amount of DnD source material it had been trained on. A few takeaways: 1. An LLM based DM can give the player essentially infinite richness and description on anything they ask for. 2. There is difficulty in setting the rules for the LLM to follow that…

> My conversation quickly began to approach the context window for the LLM and some RAG engineering is very necessary to keep the LLM informed about the key parts of your history

Assuming we're talking about GPT-4o, that 128k context window theoretically corresponds to somewhere around 73,000 words. People talk at around 100 words per minute in conversation, so that would be about 730 minutes of context, or about 12 hours. The Gemini models can do up to 2 million tokens of context... which we could extrapolate to 11,400 minutes of context (190 hours), which might be enough?

I would say GPT-4o was only good up to about 64k tokens the last time I really tested large context stuff, so let's call that 6 hours of context. In my experience, Gemini's massive context windows are actually able to retain a lot of information... it's not like there's only 64k usable or something. Google has some kind of secret sauce there.

One could imagine architecting the app to use Gemini's Context Caching[0] to keep response times low, since it wouldn't need to re-process the entire session for every response. The application would just spin up a new context cache in the background every 10 minutes or so and delete the old one, reducing the amount of recent conversation that would have to be re-processed each time to generate a response.

I've just never seen RAG work particularly well... and fitting everything into the context is very nice by comparison.

But, one alternative to RAG would be a form of context compression... you could give the LLM several tools/functions for managing the context. The LLM would be instructed to use these tools to record (and update) the names and information of different characters, places, and items that the players encounter, important events that have occurred during the game, as well as information about who the current players are and what items and abilities those players have, and then the LLM would be provided with this "memory" in the context in place of a complete conversational record. The LLM would then just receive (for example) the most recent 15 or 30 minutes of conversation, in addition to that memory.

> I found the LLM to be too pliable as a DM.

I haven't tried using an LLM as a DM, but in my experience, GPT-4o is happy to hold its ground on things. This isn't like the GPT-3.5 days where it was a total pushover for anything and everything. I believe the big Gemini models are also stronger than the old models used to be in this regard. Maybe you just need a stricter prompt for the LLM that tells it how to behave?

I also think the new trend of "reasoning" models could be very interesting for use cases like this. The model could try to (privately) develop a more cohesive picture of the situation before responding to new developments. You could already do this to some extent by making multiple calls to the LLM, one for the LLM to "think", and then another for the LLM to provide a response that would actually go to the players.

One could also imagine giving the LLM access to other functions that it could call, such as the ability to play music and sound effects from a pre-defined library of sounds, or to roll the dice using an external random number generator.

> 4. Most importantly, I found that I most enjoy the human connection that I get through DnD and an LLM with a voice doesn't really satisfy that.

Sure, maybe it's not something people actually want... who knows. But, I think it looks pretty fun.[1]

One of the harder things with this would be helping the LLM learn when to speak and when to just let the players talk amongst themselves. A simple solution could just be to have a button that the players can press when they want, which will then trigger the LLM to respond to what's been recently said, but it would be cool to just have a natural flow.

[0]: https://ai.google.dev/gemini-api/docs/caching

[1]: https://www.youtube.com/watch?v=9oBdLUEayGI

Re: LLM based agents as Dungeon Masters

#52
I've made several DMs for a variety of entertainments. It's as much fun to create them as it is to play a scenario with them. I've experimented with a few methods, such as providing them with an ASCII map that looks like a hack/rogue map, giving them a famous book as the scenario, giving them multiple books and or famous fictional characters and then just letting them loose in a DM/AI guided narrative the user is making decisions.

Of course, I have a "classic" DM that happens to be visiting here on vacation from the dungeons & dragon's multiverse, where his real job is being a DM for visiting tourists. There's a "Shaggy" and his talking dog one can take LSD with when going to Woodstock in '68. There's a StarTrek strategic tactical simulations instructor. I quite like a Underground railroad "conductor" that guides escaped slaves to freedom before the US Civil War.

I think these DM / interactive narrative applications have a huge future in education and training.

Re: LLM based agents as Dungeon Masters

#55

This is so interesting that people want this. This is beyond the guy saying “people don’t like making music so we made ai so it’s easier and faster to just prompt it to make music” . Like in my experience the best part of d&d is the dungeon master who knows their friends making a story and details specifically for fun and the fun of the group. And the interactions between players and the dm is where I derived the mos…

Preparing a campaign is an awful lot of work, which at least in my case is why my friend group almost never plays.

Re: LLM based agents as Dungeon Masters

#56

This is so interesting that people want this. This is beyond the guy saying “people don’t like making music so we made ai so it’s easier and faster to just prompt it to make music” . Like in my experience the best part of d&d is the dungeon master who knows their friends making a story and details specifically for fun and the fun of the group. And the interactions between players and the dm is where I derived the mos…

Two reasons:

1) "LLM DM" isn't merely mean substituting for human DM in a D&D session. The same capability can be used as a component in a video game, to breathe life into the game world, have it interactively react and evolve along with the player.

EDIT: Take a game like Rimworld, that relies on a scripted RNG dubbed a "storyteller", to decide what random events to hit you with and how hard. It's fun early on, but if you're into role-playing, you'll quickly realize there's no evolving story behind it, just stateless RNG. An LLM DM is exactly what could add that story, make overcoming challenges feel meaningful and allow for player decisions to actually impact the world deeply.

2) There are people like me, who would love to participate in an RPG session, but for various reasons never got invited to those when at school, and now, due to demands of parenthood, can't exactly make time to coordinate with the few people around who are still playing.

There are more, but those are the two that are apparent to me.

Re: LLM based agents as Dungeon Masters

#57

This is so interesting that people want this. This is beyond the guy saying “people don’t like making music so we made ai so it’s easier and faster to just prompt it to make music” . Like in my experience the best part of d&d is the dungeon master who knows their friends making a story and details specifically for fun and the fun of the group. And the interactions between players and the dm is where I derived the mos…

> This is so interesting that people want this I love being a DM but it is no mystery to me. Being a DM is a lot of work. And occasionally, a lot of annoyance. You not only have to facilitate (and sometimes create from scratch) an engaging story that keeps people coming back, you have to wrangle busy schedules and personalities that is often annoying. Lots of times you'll have a bunch of people willing to play, but n…

i mean this is on point regarding the effort needed to run a game, but also llms don't really solve any of the problems you listed, so while people want _something_ it doesn't seem like they're crying out for this. also, would love an example of the suggestible ai DM if you have one handy lol

Re: LLM based agents as Dungeon Masters

#58

This is so interesting that people want this. This is beyond the guy saying “people don’t like making music so we made ai so it’s easier and faster to just prompt it to make music” . Like in my experience the best part of d&d is the dungeon master who knows their friends making a story and details specifically for fun and the fun of the group. And the interactions between players and the dm is where I derived the mos…

I can totally see the appeal of using LLMs to _help_ the DM. Not to replace it.

I DM a few games of The Expanse, and using LLMs to plan ahead was a godsend. No, I didn't utilise it to write the story for me - instead I used it to test my planned story and see which way my players might strafe off the road, so I can plan for those. Basically simulated a game using an LLM that acted in place of multiple characters, allowed those to run free (within certain limits, obviously you can't have the LLM players do a dozen actions without the DM having a say), and essentially mapped the potential "off branches", story pathways I didn't plan for initially. This has allowed me to be prepared for the usual dumbass things players might do, such as heading for a strip club in the middle of a total disaster where they (figuratively) have dozens of arrows pointing to the goal of the chapter.

Another interesting aspect of using AI for TTRPGs is to create atmospherics. For Expanse based games, I've bought a number of tile packs and such, to appreciate the artists who put work into it, but I simply don't have the funds to commission a few dozen acrylic matte style scenery images (which I usually put up on my projector, combined with some Hue lights to create the visual atmosphere). With AI, I can even generate them on the fly, should my little gremlins stray off the path. Same for music - AI can incredibly easily generate an atmospheric soundtrack that fits the current scenery, with just a few words, while I can still pay attention to the players.

But fully replacing the DM? That's silly.

Re: LLM based agents as Dungeon Masters

#59

This is so interesting that people want this. This is beyond the guy saying “people don’t like making music so we made ai so it’s easier and faster to just prompt it to make music” . Like in my experience the best part of d&d is the dungeon master who knows their friends making a story and details specifically for fun and the fun of the group. And the interactions between players and the dm is where I derived the mos…

Consider video game RPGs. They're largely based upon D&D, yet they remove the dungeon master entirely. They are enormously more popular than D&D itself.

Now imagine something in between, where you have a video game, but the NPCs and parts of the story are controlled by an LLM. You can give the players much more freedom, and the creators don't have to write thousands of lines of dialog to account for every possible choice a player can make. The game doesn't have to be "on rails" so much, the LLM can help speed the story along when the player gets confused, and you can have NPCs with much more depth than just several lines of static dialog.

How well this will work in practice remains to be seen. In my experience, ChatGPT itself is a painfully generic DM that relies upon repetitive fantasy tropes. You still need an actual human being to create an interesting story and add depth to the world.

Re: LLM based agents as Dungeon Masters

#60

This is so interesting that people want this. This is beyond the guy saying “people don’t like making music so we made ai so it’s easier and faster to just prompt it to make music” . Like in my experience the best part of d&d is the dungeon master who knows their friends making a story and details specifically for fun and the fun of the group. And the interactions between players and the dm is where I derived the mos…

> This is so interesting that people want this I love being a DM but it is no mystery to me. Being a DM is a lot of work. And occasionally, a lot of annoyance. You not only have to facilitate (and sometimes create from scratch) an engaging story that keeps people coming back, you have to wrangle busy schedules and personalities that is often annoying. Lots of times you'll have a bunch of people willing to play, but n…

I think the previous posters point was that an LLM DM is boring due to it's generality and lacks the specific quirks of having a human DM with their own viewpoint and understanding of the players, which I agree with. I did some experiments with earlier ChatGPT models for world building and DMing and found it to be so boring, getting it to do anything interesting or giving any kind of push back was so hard. Since they are an averaging of all knowledge / previous creativity you end up with a smooth surface, but part of what makes stories interesting are the rough edges.

However I also agree with you that being a DM is a prohibitive amount of work for someone, say, with kids and a job. It would be awesome to have an LLM as an assistant, maybe feeding in parts of the story and querying it for ideas when you're in a bind. But having it run as a full DM, at least right now, will likely lead to a boring experience.

Post reply on HN