Dungeons & Dragons Online

One-shot with custom-made AI chatbots for NPCs – Glinidril’s Secret Lab

To see how artificial-intelligence-based chatbots work out in an RPG, I've created a D&D one-shot where two encounters consist of an NPC played by AI. Since publicly-available general-purpose chatbots tend to go off-the-tangent too quickly or are unable to play out specific situations, I've built a custom made one. Since it took a lot of effort to make things work, I wanted to share it publicly, hopefully letting others benefit from it, too.

The formatted one-shot pdf is available here and takes approximately 3 hours for a party of level 3 characters. The party is sent by the king to look up on the local loner witch only to find out that she seems to have disappeared. They find out that two local greedy knights are trying to get hold of powerful artefacts she may have left behind. Can the party sneak in through the secret backdoor entrance and find the valuables before the knights and their armies? In the adventure, they will have to convince the chatbot-played animated armor to let them pass through (or fight it) with the climax of the adventure being a three-way battle between the party, the knights, and the chatbot-played witch who has to be convinced to side with the players and not the knights.

The unique gimmick: chatbot-played NPCs. The code and all instructions on downloading and running the chatbots can be found here and are meant to be used by the DM in the background. (I made sure with the mods that this doesn't break rule 2.) All the code is open-source to guarantee that it isn't doing anything harmful in the background.A couple of animations and screenshots of it: conversation with animated armor (gif), part of the final battle (gif), Another snippet from the final battle (png)

How well does the chatbot really work? Good enough that my players didn't figure out that I was using a chatbot in the background. If you play around with the program, you will, however, quickly find that it's not particularly bright and sometimes behaves in very irrational or repetitive ways. But that's fine – that's part of the gimmick.

Glinidril's Secret Lab

This is a one-shot for 4 lvl 3 players and takes approximately 3 hours of play and can be easily integrated into a larger campaign. It was created to try out a gimmick of using AI chatbots to play 2 NPCs in the adventure. Note that this can make a part of this adventure somewhat unpredictable. To get the AI chatbot built specifically for this adventure up and running, find the program at https://github.com/vid-koci/rpg_chatbot.

Background Story

The party is on a mission by the king to visit a small town Greenfield, where a powerful witch Glinidril resides. She has always been a loner and avoided working with anybody, but always in good relations with the local authorities. She has not responded to the king's invitation to an important event and he is worried that something may be wrong. Glinidril's fort likely contains powerful magical artefacts and it would not be good if they fell into evil hands. The party has received have an official letter from the king, certifying their intent. The party arrives to the village at the time of sunset.

What the party does not know is that Glinidril has been dead for the last two weeks. Well, at least her body, that is. In a desperate attempt to live forever, she stored her mind into a valuable crystal and send a message to the king with a plead for help. Unfortunately, the message was intercepted by two greedy local knights, Aymer and Ancelm, who have been trying to find an entrance to the witch's laboratory for the past two weeks. A magical barrier has been preventing them from breaking in so far, but for how long will it last? Can the party safely retrieve this crystal before the two greedy knights?


Greenfield is a small village with fewer than 100 inhabitants, mostly peasants, a small tavern and a temple. However, the players can quickly notice that the village is suspiciously busy — around it are set up camps of soldiers who outnumber the local population. On the opposite side of the village is a small hill, where a tower should stand at least according to the information that the party got. However, the tower lies in ruins and is surrounded by freshly dug-out holes and trenches, dug out by the soldiers.

As the party arrives to Greenfield, they encounter two knights (Monster Manual p. 347), one in grey and one in white armor. They stand by a priest (called Callus) and threaten him, trying to get information about the entrance to Glinidril's tower. If confronted about it, they do not fight. Instead, they flee, promising to come back with their guards. Callus is a local priest who runs the temple and the only person in the village that Glinidril trusted.

If the party does not intervene, the two knights beat up Callus and leave him wounded in the middle of the street. Callus does not give them any information about the tower, despite the threats of more violence.

If the party saves Callus, he asks the party to follow him through back alleys to avoid any guards sent by the two knights. He explains how these two knights are local nobles who hope to grab power by ransacking Glinidril's tower. He believes that she is gone but does not know what happened to her.

The knights have already ruined Glinidril's tower but could not enter the cellar where Glinidril's lab is, likely because of the magically protected entrance. However, even that magic will not protect it for long. Callus has already sent a letter to the king to ask for help, but the village guards could not risk an open conflict with the knights' soldiers.

If the party gains Callus' trust, e.g. by showing him the letter, he asks them to help him. He is worried that the knights will get to the witch's lab before his message reaches the royal palace. He can show them a secret entrance to the tower (the one that he was interrogated about) and asks the party to reach the lab first and make sure to remove any dangerous artefacts. They can sleep in his barn or in a local tavern. Callus offers to meet them before sunrise to show them the way.

The Witch's Tower

The tower is completely in ruin and around it are dug-out trenches and battering rams. In a desperate attempt to find a way into the lab, the nobles' armies dig night and day. In the forest, maybe 300 yards below the ruins, Callus can show the party a rock that can be moved to uncover the entrance under the roots of a large oak. The tunnel is dark and leads directly below the ruins. Callus prefers not to go in but promises to close the entrance behind them. The rock is easily removed from the inside. According to Callus, this was supposed to be an emergency exit rather than a way in. If asked, he does not know anything beyond this entrance as Glinidril never let anybody inside. The tunnel is dark, narrow, and evidently not used often. After approximately 300 yards, it leads into a magically lit room.

The Guard Room

This 30x20ft room contains a couple of benches, a carpet (rug of smothering, Monster Manual p. 20) and a narrow passage behind the small corner at the opposite end of the room. The passage is narrow enough that it can only be entered by one medium-sized creature at the time and starts with a left turn so that it is impossible to see what lies beyond without entering it.

A player that enters said passage on the opposite side of the room will immediately encounter (and be noticed by) an animated armour (Monster Manual p. 19) with two swords (animated swords, Monster Manual p. 19). The armour guards the entrance against anyone who isn’t Glinidril or her trusted ally.

Interacting with the animated armor

Animated armor can be played by the AI chatbot, available at the link at the start of this document. Please refer to that page for the technical details of running the chatbot. This block will describe the encounter instead.

The armor is not particularly bright, but it is somewhat aggressive. It will speak up immediately when it notices any character, demanding to know whether they are a friend of Glinidril the witch.

The conversation ends when the armor lets the players through (usually by saying "Be my guests" or something similar) or when somebody initiates an attack (either the characters or the armor hits somebody). In the case of a battle, the armor stops talking and fights until dead. In the case of a battle, the rug of smothering and the two flying swords come alive and join the battle on their own initiatives. The swords fly out of armor's hands and act on their own, while the animated armor fights with fists.

If the party is successful in convincing the armor, it moves aside and stops talking or responding to any questions.

The Magical Barrier

The passage behind the animated armor continues in the same general direction and ends with a door in 60 feet. The characters can easily notice that the doors are part of a larger magical barrier. On the door contains a sign in common: "What has 4 letters, sometimes 9 letters, and never 5 letters!"

The magical barrier prevents intruders from entering and the door is the only way to get through safely. The door is actually not trapped and can be easily opened. The sign on the door is not a riddle, but just a simple joke that Glinidril found amusing.

Living Room

The room and entire space behind the barrier feel much more comfortable. The ceiling is high, the place is kept warm and lighted by magic. On the character's right is a small room with a comfortable chair and a nice wooden table. On the top of the table are an open book and a teapot. The book is a diary that the characters can read. The players know that the last date was about a fortnight ago.

Lab Diary

12th of Tarsakh, 1389I have gotten old, and I have changed, not entirely for the better. My days are counted unless I can sustain my weak body. My knowledge of necromancy is weak, yet I do not thrive for it. Too many powerful wizards have hoped that they can control the dark arts to make themselves immortal, only to become mindless undead or forces of evil. I will dedicate my coming days to try and find a way to keep my mind alive after my body fails. A way that does not involve a pact with the dark powers.

16th of Mirtul, 1389 There may be a way to separate my mind from my body. An incredibly rare type of crystal from the Underdark, called “ærþengem” can store the mind of an individual. I may be able to buy one from one of my old friends. So far, these crystals have mostly been used to capture the minds of prisoners or enemies. Still, I hope to find a way to communicate and do basic deeds while trapped inside.

8th of Eleint, 1389 After months of waiting, I finally got a crystal of ærþengem. To try it out, I captured the mind of some lost homeless traveller who no one will miss. At the moment, I am unable to communicate with the captured mind.

18th of Eleint, 1389 Combining a couple of other magical tools in my shed, I was able to make it possible for the soul to speak and listen. The captured mind seems to be somewhat blurry and does not communicate or act reasonably. The captured mind itself seems untouched, but not able to function to its full capability while in the crystal. It has a very short attention span, sometimes talks gibberish, and sometimes spews claims with no common sense.

22nd of Eleint, 1389 My body is getting ill and weak. I am afraid that I will not be able to finish my experiments properly. I will use my remaining strengths to secure my laboratory against intruders. I will then use all of my remaining magical and powerful items to channel my mind into the gem. Within the gem, I should be capable of basic communication and defence, at least while the gem stands on the pedestal. I can only hope that the gem is discovered by somebody who can continue my research and restore my mind fully. I have sent a messenger to the king with the explanation. I really hope that my message isn’t intercepted by a couple of greedy bandits or local nobles.

The Laboratory

20 feet beyond the living room lies the laboratory. Just before the party enters it, they can hear an audible crash coming from the opposite side of the room. The two knights, Aymer and Ancelm have finally managed to break through the magical barrier and are now looking for the valuable gem. They are coming in alone, not trusting their soldiers to bring them the valuables, however, they will call for help if they get in serious trouble.

The laboratory is a 40×80 ft room with tall walls made of stone. This large room contains several large tables that make the room harder to navigate, lab items, and a colorful gem that casts light. The players enter the room at the southeast corner of the room, with the two knights entering at the same time from the southwest corner. The gem stands on a pedestal on the north side of the room. The two knights immediately recognize the characters.

While on the pedestal, Glinidril (or rather, the gem) can speak and cast magic missile, see the "Running the final encounter" block for details. It detects the presence of visitors immediately and speaks up. It is very protective of its gem.

Running the Final Encounter

The witch/gem should be played by the AI chatbot, available at the link at the start of this document.Please refer to that page for the technical details of running the chatbot. This block will describe the encounter instead.

The nature of this encounter and the use of the AI chatbot can make this encounter very chaotic due to the number of characters involved. To make it manageable, you should run it in the initiative from the point of entering the room on.This serves two issues. First, it makes this three-way encounter between the party, Glinidril, and the two knights, easier to follow (and for you to transcribe it into your computer).Second, it limits the players' and knights' statements to short statements (i.e. interaction phase) which should be understandable by the chatbot.

Glinidril in gem notices the visitors the moment they enter.The key to winning this battle is to convince the chatbot-controlled Glinidril that it should team up with the party against the knights.The two knights will attack the players from the start on, while trying to convince Glinidril that the players are trying to steal the gem and should be killed.

Use Monster Manual stats for Knight (p. 347) for Aymer and Ancelm.Glinidril or the gem does not have a statblock. Instead, it "dies" the moment when the gem is removed from the pedestal (which requires an action).Glinidril rolls two initiatives and on each of her turns acts as described by the AI chatbot, usually by saying something and hitting somebody with all three darts of magic missile.

The encounter ends when the two knights are dead and the gem is removed from the pedestal.

what will go wrong: Chatbot (Glinidril) not behaving consistently adds a bit of charm to this encounter, so feel free to make the voice sound schizophrenic. Among others, it may hit unconscious or dead characters, threaten the knights but hit players (or vice versa), etc.

The Escape

In the pockets of the two knights, the players can find a bloodied letter that Glinidril initially sent to the king and that they have intercepted. Either way, they are now in a tower, surrounded by Aymer and Ancelm's soldiers, with their hands bloody. If they decide to wait, the soldiers follow the two knights after about 15 minutes, surrounding and arresting the party. If the party decide to flee the same way that they came in, they can do so easily – the animated armor only guards the passage in one direction.

It is up to you how to continue from here. If you played this as a one-shot, you probably want to finish here. If you want to integrate into a larger campaign, your may want your players to restore the mind stored in the gem (did Glinidril know some important information?).

If you end up using this one-shot or integrating it into your campaign, I'd like to hear your experience with using chatbot-powered NPCs. I'd be curious to hear what conversations it produced at your table.


Similar Guides

More about Dungeons & Dragons Online

Post: "One-shot with custom-made AI chatbots for NPCs – Glinidril’s Secret Lab" specifically for the game Dungeons & Dragons Online. Other useful information about this game:

Top 20 NEW Medieval Games of 2021

Swords, dragons, knights, castles - if you love any of this stuff, you might like these games throughout 2021.

10 NEW Shooter Games of 2021 With Over The Top Action

We've been keeping our eye on these crazy action oriented first and third person shooter games releasing this year. What's on your personal list? Let us know!

Top 10 NEW Survival Games of 2021

Survival video games are still going strong in 2021. Here's everything to look forward to on PC, PS5, Xbox Series X, Nintendo Switch, and beyond.

You Might Also Like

Leave a Reply

Your email address will not be published. Required fields are marked *