Inspiration

We were inspired by Dungeons and Dragons tabletop game to create a virtual Dungeon Master that determines the dice rolls and next moves for the customized character you create.

What it does

Queries the Gemini API as the Dungeon Master for a DnD game.

How we built it

We used JS, HTML, CSS, Python, and the Gemini API

Challenges we ran into

Challenges we had:

  1. Rules Engine not behaving as expected Problem: the difficulty values were being overwritten due to multiple if statements. Also the API wasn't getting the narrative story to generate accurately. Solution: Take the code step by step and add print statements throughout the blocks of code to see if each segment was working as expected or not.
  2. The main.py file was running as needed and the import statements weren't syncing with the code. The backend connection was crashing and wouldn't run the FASTAPI since it was not registering. Solution: Modify the import statements and go line by line trying to fix all the FASTAPI statments and match the functions with the ones appearing in the ai_engine.py.
  3. Having to recall certain CSS and HTML factors was also challenging at times, however through trial and error with the UI we were able to make the proper adjustments in order to get the pages looking how we wanted them to.
  4. Making the API key private At first we added the Gemini API key we were using to the ai_engine.py file on GitHub but we realized that API keys weren't meant to be shared publicly so we had to research how to hide the API key on GitHub while still making a functional app that could access the Gemini API. Solution: We ended up using a .env file for the new private API key and deleting the old compromised API key so it couldn't be used. We had to import the dotenv package to read the API key from the .env file.

Accomplishments that we're proud of

Querying the Gemini API with the API key

What we learned

Google AI Studio is an easy place to get a free API key for AI generation.

What's next for QuestBound

Being able to physically customize characters would be cool.

Built With

Share this project:

Updates