Inspiration
The Game-Assistant project was inspired by my school-work where I could create a cool game, but couldn't come up with characters and what they do. I think some of us technical people can create something amazing if we know what it is what we're creating, and Game-Assistant is something that takes an inkling of an idea and automates the generation of the lore, characters and description so that we can focus on making the game.
What it does
Game-Assistant is a webserver that can be hosted anywhere, and can also be run on your own computer.
The frontend is a website that guides the user through the creation of characters, descriptions, etc based on prompts from the user, such as the theme, genre, game name, and other details the user wants to provide.
The backend takes the information provided and creates prompts to OpenAI's chatGPT and DALL-E to create the resources for the user.
The information is passed back with the game description, character profiles and even a colour theme.
How we built it
The application consists of a Flask application which serves webpages, and a backend that processes payload hooks from information the user provides, creates prompts to OpenAI, then returns the structured response to a new webpage that shows all the content generated.
Challenges we ran into
Initially, we had trouble figuring out what to use for our front-end and back-end. We decided to use js and AWS lambdas, eventually moving everything to host on AWS. This way we could just tell everyone to go to a certain webpage and they could try our service. Unfortunately, our teammate, who had initially provided the AWS accounts, had dropped off the face of the Earth on Saturday evening and so we could no longer use their AWS account we had set up. We had tried contacting them many times to no avail and this really threw a wrench in our plan.
Sunday we got together on VC and decided to create a webpage that any user could run from their computer, instead of hosting the webpages ourselves. This required a whole redesign, and since time was now short we used ChatGPT to generate the .HTML pages needed.
We noticed that the char generation was a bit slow, because we sent requests one-at-a-time to ChatGPT. We decided to see if ChatGPT could return the response all in one go and it worked! We told it all the information it wanted, and the structure we wanted the response in.
Unfortunately we had the same issue with the image generation, but the image generation is only one description at a time, and couldn't pass back images for different descriptions with one call. So we used multiprocessing to try to send multiple requests, but going this route we realized we had anti-patterns that resulted in ugly code because memory is not shared across processes, so we switched to multithreading instead and used a fairly standard pattern to call the image generation.
Accomplishments that we're proud of
We were able to pivot off our original idea of AWS lambdas and serving js to an all Flask implementation and finished coding it in a few hours. Everyone had a role to play and though some people's work is not in the final product, they work they did helped steer us onto the right path.
What we learned
Keep it simple, frontend and backend in Flask was much easier to do than trying to stitch together everyone's work. Use contracts! Everyone knows what they need to do, but they don't know what they will be sending or receiving. By using strict API contracts, we could create mocks of what the requests and responses would be so each person could work off of the mock. As each piece was complete and integrated, we could see it coming alive as the pieces did their jobs.
What's next for Game-Assistant
The biggest discovery is how we could get a strict structured response back from ChatGPT. I think we would actually go a different direction with game assistant, wherein we develop a tool that can enable any Game Engine to utilize LLMs and image generation tools. In our github repo we show an example of such a thing: a lightweight application that consumes protobufs, translates it into a prompt from chatgpt, and dumps the response into a proto for the game engine to consume.
For Game-Assistant, it can branch off into a UI that simply exposes the APIs of the lightweight application so that users can interact with it and create quests, characters, items, etc as Game-Assistant does now, but in a much more robust manner.
Built With
- amazon-web-services
- html
- javascript
- lambda
- openai
- python
- vue
Log in or sign up for Devpost to join the conversation.