DnD PvP Mode - AI-Generated Text-Based Adventure/ PvP Game

Inspiration The inspiration for DnD PvP Mode stemmed from our love for traditional tabletop role-playing games like Dungeons & Dragons. We wanted to create an immersive and dynamic experience where players could engage in turn-based combat using natural language input, leveraging the power of AI to generate combat art through Dall-E 3.

What it does

DnD PvP Mode is a text-based adventure and player versus player (PvP) game that brings the magic of Dungeons & Dragons into the digital realm. Two players enter the game from different computers, each choosing their character's name and class. The AI Dungeon Master (DM) takes charge, setting the scene with detailed descriptions of the environment and characters. Players are then free to interact with the world, unleashing their creativity and convincing the DM with their decisions.

The game's core revolves around turn-based combat, where players input their actions and strategies using natural language. The AI DM parses this input, orchestrating a thrilling battle that unfolds in the minds of the players. To enhance the immersive experience, we incorporated Dall-E 3, an AI model that generates stunning combat art based on the DM's descriptions, bringing the characters and scenes to life.

How we built it

We used Python as our primary programming language, making heavy use of the OpenAI API for GPT3.5 to power the AI Dungeon Master. This intelligence enabled it to understand and respond to the players' unrestrained natural language input and parse out function calls to progress the game. To generate captivating combat art, we integrated Dall-E 3 into the game flow, turning textual descriptions into striking images.

We used Flask for the web server (along with HTML, CSS, and JavaScript) to create an intuitive and responsive user experience. Flask's simplicity let us rapidly prototype our game to create the best version of it we could as fast as we could. The web-based design also let players join in the game from their own devices, allowing them to make their decisions and witnessing the unfolding narrative from anywhere they chose.

Challenges we ran into

One of the main challenges we faced was parsing and integrating user input into a solid underlying game system. Using GPT functions to parse natural language output and consistently produce quality outputs was a challenging task, but rewarding. Coordinating the communication between the AI Dungeon Master, Dall-E 3, and the web interface took a lot of work, especially to guarantee that each player's client remained in-sync and avoided race conditions. Ensuring that the generated combat art aligned with the narrative and remained stylistically consistent between prompts posed a creative and technical challenge that required a lot of careful prompt engineering. Although we managed to stabilize the style, we weren't able to generate consistent characters between turns (although this could likely be done with fine-tuned models trained to output only a few characters). Additionally, although AI generated art has improved drastically as of late, it still lacks a human touch and direction to it, and each image does not necessarily play well into the next as it would in a hand-drawn and planned story. Further, dungeon masters usually make funny voices, and ours doesn't.

Accomplishments that we're proud of

We are proud to have successfully combined traditional tabletop RPG elements with cutting-edge AI technology. The ability to have our unrestricted natural-language input consistently parsed into game terms and rapidly illustrated is a joy and a significant achievement for our team.

What we learned

Throughout the hackathon, we learned a great deal about using AI for interactive storytelling and visual art generation, as well as a first foray into game design. Also, the effective integration of GPT3.5 and Dall-E 3 required us to attain a deeper level of understanding of both technologies. Having made this prototype with these tools, we are excited to continue exploring their potential in future projects.

What's next for DnD PvP Mode

The journey doesn't end here! In the future, we plan to expand DnD PvP Mode by incorporating more status features, classes, and environments. We aim to enhance the AI Dungeon Master's capabilities with a broader range of functions to call, allowing for even more intricate and personalized storytelling and statuses that it may inflict upon the players. In future, we may also be able to create stable characters which the AI art generation models may be able to recreate in each scene for a consistent visual story to pair with the text. Stay tuned for more adventures in the world of DnD PvP Mode!

Built With

Share this project:

Updates