· Game Development  · 3 min read

The Disappearance of Dr Winston - Mystery Game with AI NPC Conversations

For my final year project at the University of Leicester, I integrated OpenAI's API into Unity to create dynamically responsive NPC dialogue conversations in a mystery game.

For my final year project at the University of Leicester, I integrated OpenAI's API into Unity to create dynamically responsive NPC dialogue conversations in a mystery game.

Overview

The Disappearance of Dr Winston is a 3D mystery adventure game developed using Unity, integrating OpenAI’s API to create dynamic and interactive NPC dialogues. This was my final year project at the University of Leicester and it showcases the potential of AI in enhancing gameplay experiences.

Project Details

Description

In this game, the player explores a poly-stylised world, interacts with NPCs powered by OpenAI, and solves the mystery of how Dr Winston went missing. The integration of AI enables realistic conversations with the NPCs, making each playthrough unique and engaging. Each NPC has their own personality, conversation memories, and quests. These elements are consistent and are used to supplement the storyline.

As this was a solo project, I led the entire process from concept to execution. I designed the game, wrote the storyline, conducted research, and programmed the game mechanics. The project spanned six months, culminating in a comprehensive dissertation and project demonstration to my supervisors.

Tools and Technologies

  • Unity: For game development and environment creation.
  • OpenAI API: For dynamic NPC dialogues.
  • C#: For scripting game mechanics, AI interactions, and game quests.

Project Highlights

Gameplay

The game begins with the player arriving in Whoville and speaking with the Mayor. He informs the player that Dr Winston, a mad scientist, went missing a week ago and that the player must help find him to upkeep the town’s reputation. The game features multiple quests to be completed in chronological order by conversing with NPCs. The player interacts with the characters in the game, gathers clues, solves puzzles, and advance through the story. Eventually, Dr Winston is discovered helping some aliens which crash landed in a forest nearby. The NPCs, powered by OpenAI, offer personalized and context-aware interactions, enhancing the narrative depth.

I originally planned to have separate stages of the story with their own scenes, however, with the chronological quest system created, I then realised I could keep all of the assets in one scene. Below is a diagram showing the progression of the story.

The Disappearance of Dr Winston

Challenges and Solutions

Technical Challenges

Integrating OpenAI with Unity presented significant challenges, particularly in managing multiple character interactions and ensuring seamless API communication. Extensive testing and debugging were required to optimize performance and ensure a smooth gameplay experience.

Conversation UI Testing Example

Another challenge was the very complex quest system I implemented. I wanted to have chronological quests so that the player was forced to progress through the storyline correctly. I was able to implement this successfully, but I was not able to create enough quests to fill out the story entirely.

Project Management

Managing a comprehensive project independently required meticulous planning and time management. Utilizing agile development practices and regular feedback sessions with my project supervisor helped in maintaining clear objectives and timely progress.

Conclusion

The Disappearance of Dr Winston project demonstrates the seamless integration of advanced AI in gaming. It offers a unique and interactive storytelling experience, setting a precedent for future AI-driven games. The project highlights the potential of AI in creating dynamic and engaging gameplay, paving the way for innovative developments in the gaming industry.

Media

Images

Map of Game The Disappearance of Dr Winston The Disappearance of Dr Winston

Video

Back to Blog

Related Posts

View All Posts »
National Space Centre Game

National Space Centre Game

Over three months I worked with a small team of four to produce a Unity-based game designed to bring awareness on animal migration due to climate change.