Inspiration

Dungeons and Dragons is essentially a text-only type of game which has simple logic-based game play. However, to be a dungeon master, it requires intuition and an ability to respond to anything the players might throw at you, a perfect place for an LLM!

What it does

In this game, you start from the Main Menu screen, then you are off to the Character Creation screen where you can easily manipulate all the characters in the game, including the Dungeon Master himself. You can choose their abilities, their personalities, and names. After that, you are sent to a scene where you are seated with your fellow players and the Dungeon Master. The game is done in rounds, the DM will always describe the situation first, then a response will come from the player, after which a potential dice throw will start(if the action that was requested by the player is deemed risky) and it will end with the DM giving his opinion on the situation again.

After that, the next player starts talking to the DM, and so on and so forth, a single round is considered to be a full circle around the table.

How we built it

Using Amazon Q for helping with the programming bit, we were also pleasantly surprised that it helps with the writing of prompts which it interprets from the way we wrote other prompts in the game. This type of programming, where an LLM requires a precisely engineered prompt for every occasion, requires a lot of thinking and it helped a bunch in that.

To use the LLMs, and to work according to the requirements of the hackathon, we used AWS Bedrock for the its LLM API, specifically we used the open LLaMa models by Meta.

The game is built on top of a finite state machine as it is a linear game where the story builds up over time as you continue to play it.

Challenges we ran into

This is my first time using AWS so I had to understand how to use its API, especially with a still non-standard game engine like Godot(which this game was built with). We had to understand how to reliably extract JSON outputs from the LLM and input them into various helper classes in the game

Accomplishments that we're proud of

The game is fully textured, modeled, and has many sounds and so feels quite alive with a unique flavor to it. We also found out how easy it can be to generate unique outputs with LLMs that give flourish for free, such as using them to create an epic poem at the end of the game by simply giving it all the saved outputs during the game play, or allowing the LLM to use its internal logic to decide on risk and damage.

What we learned

We learned a lot about modelling for video games, how to use AWS in general and with its APIs, and how to leverage comments for use of Amazon Q in various places during the programming. I have also learned how to use a State Machine pattern which I was eager to get into.

What's next for Prompts & Perils

We need to flesh out the game as it is right now and make it more a more playable experience. In general, with such a game, the further you get into the various prompts, the more information you give the LLM to work with, the more interesting results it can come up with.

Built With

Share this project:

Updates

Submission history