Inspiration

We jumped off of a previous hackathon project that used machine learning to generate faces based on a set of sample images.

What it does

It uses a set of text samples with PyTorch to train a model to generate similar text. Then, this text is combined with a randomized branching story structure in Ren'Py. Then, computer generated images of characters are added and paired with lines of dialogue. Lastly, Google Cloud Natural Language API is used to look at the blocks of text to label that section and select an appropriate background.

How we built it

This uses several different python functions to generate the content for the story with machine learning. Then, we wrote a function which takes this content and writes a script file which can be executed to play the story in Ren'Py.

Challenges we ran into

HTTP requests in Python can be difficult to do correctly. Randomly generating a branching tree structure took some creative thinking and programming.

Accomplishments that we're proud of

Sometimes, the generator produces a few lines which make sense are actually interesting or funny. Overall, the program is pretty good at creating faces and detecting the topic of a passage of text. It was pretty satisfying to finally get the random story tree generator going.

What we learned

We learned how to use Google Cloud Machine Learning and gained more experience with PyTorch. We got to experiment with Ren'Py, which is an interesting Python-based game-maker. Getting a program to write English words is not too hard. Getting those words to make sense is harder.

What's next for Choose Your Own Adventure Generator

We could set up the background selector to search the web for backgrounds, use a spell checker to help the text make more sense, and add a feature where the text actually mentions the characters' names.

Built With

Share this project:

Updates