Inspiration

We love role playing games and wanted one that we could play on the go throughout the day. We thought GPT4's ability to keep track of longer conversations was perfect for our application.

What it does

The game is started online, where a telegram QR code is created and all players can join by scanning. Once all players have joined, the program uses openAI's API to generate characters for each player and starts the story. The story is completed in turns where each player gets 3 choices DM'd to them then the story gets updated in the group chat. (Can easily be extended to other platforms like telegram or whatsapp)

How we built it

Created a website that handles creating the telegram group. The backend uses functions to set up the games rules with GPT. GPT starts the game, which gets sent to the telegram chat complete with character sheets, then choices are dm'd to each player, who can make their choice by replying to the dm. Player turns are cycled through with another function that prompts GPT with the choices we make. Data structures are maintained for the player_id (roles) and other information to maintain consistency in the story.

Challenges we ran into

It was difficult to find a messaging platform that doesn't require verification for each person before sending a message that doesn't require a business verification first. This is why we chose telegram, but we could easily extend it to whatsapp/sms/etc. if we had more time to complete the verification process. We wanted our frontend to start the game on the backend too, but starting the backend using a subprocess was difficult with trying to get the player numbers fed back to the backend from the telegram group. Could accomplish this with a little more time

Accomplishments that we're proud of

Using prompt engineering to get GPT to maintain consistency

What we learned

Great experience overall for our first hackathon. Learned to use telegram and openai API, and how to integrate a structure from a sequential program with the dynamic feedback from an LLM.

What's next for Roleplayer

We want to get the frontend-backend launch process automated, then add a game setup function that sets up our stories with different themes that the players can choose. e.g. fantasy, spy, scifi, etc.

Built With

Share this project:

Updates