Inspiration

As CS majors, we have heard plenty of ideas about using AI to improve productivity or supplement learning. We thought that a fun twist would be to combine it with the arcade theme and create an educational game powered by AI and inspired by early text-based computer games like Oregon Trail which paved the way for the games we have today.

What it does

Nova is a retro styled text-based adventure game, themed around studying computer science. The player can type in natural language what they would like to do based on the setting provided, and various encounters with enemy bugs or rogue AI will challenge them to answer questions about programming concepts in order to survive and beat the game. Because it is language model powered, we don't need to limit the creativity of the player's inputs (besides making it too easy to cheat the story), and the story itself is created completely originally for every round, making every game interesting.

How we built it

The front end is a pretty simple react app, and the backend was built using FastAPI with Python because it was easy to convert a proof-of-concept script we had that called GPT and took terminal input into a stateless API.

Challenges we ran into

We were doing some things from scratch and haven't built anything like this before, so we certainly spent a lot of time experimenting and solving minor bugs. We would have liked to had the time to implement an accounts system and a hosted app so that we could have persistent games, for example.

There was also a point when we were using GPT-4o-mini with a very specific prompt and randomly after a while the output started changing without us doing anything on our end, breaking down and infinitely repeating JSON tokens. We honestly believe it was some kind of bug in OpenAI's system because they cache prompts and JSON schemas for efficiency and it suddenly stopped working after a period of testing where it seemed perfect. It was resolved when we realized this and implemented a new design for the language model interactions and hopefully does not arise again.

Accomplishments that we're proud of

Using structured outputs and thinking carefully about the game design and prompting, we harnessed the LLM to actually control game states which we can reflect in the UI (health, text colors, etc) and also trust to be more accurate and consistent than a purely text-based interaction like the chatgpt website. Things like health values and inventory items get lost to LLM hallucinations easily and creating a more discrete shape of outputs makes it as a whole much more trustworthy. This setup would also make it easy to deploy an intermediate safety model that can identify things like rule-breaking inputs without requiring the entire context. The retro terminal design is also pretty cool :)

What we learned

Learned a lot about good design practices, got more practice with React, and especially learned a lot about optimizing language model responses.

What's next for Nova

As a study tool, the current setup rarely asks challenging questions. As it stands, it is best suited for entry level programmers and for entertainment. However, It could easily be adapted to take in a user's bio and adjust difficulty or choose more specific topics. It could also easily be shifted to being completely unrelated to computer science (e.g. a patient diagnosis game for med students). It would also be doable to integrate AI image generation to visualize each scene and a conversational voice mode for a more immersive experience. Besides these, we would like to build out an account/database system and then be able to explore ideas like multiplayer, etc. Finally, there were various UI/UX quality of life details we would like to have to polish out the frontend, like a box style cursor in the terminal or better readability.

Built With

Share this project:

Updates