Introduction

Imagine a video game where the lines between programmed responses and true intelligence blur – a game where the central detective isn’t a scripted collection of dialogue, but a sophisticated language model capable of unraveling a complex mystery. Driven by a fascination with the potential of Large Language Models (LLMs) to revolutionize video game storytelling, we embarked on a project to explore these possibilities. Our experiment: constructing a murder mystery experience where players interrogate an LLM-powered NPC to unravel a perplexing case. Could an AI agent, acting as a knowledge repository, articulate facts, reason logically, and ultimately, assist the player in their investigation?

Inspiration and the Investigative Process

The spark for this project ignited from a desire to push the boundaries of NPC (Non-Player Character) interactions in games. We envisioned a scenario where the typically passive, predictable NPCs evolve into dynamic collaborators, capable of driving the narrative forward. Inspired by the captivating detective work in the anime series Hyouka, we set out to build a similar mystery experience, placing an LLM detective at its core. Our initial research revealed the exciting potential of LLMs in chat-based scenarios and Knowledge Based Question Answering (KBQA). However, their applications in driving complex game narratives remained a vastly under-explored territory. This gap fueled our determination to investigate and push the boundaries of AI-driven gaming experiences.

Tools of the Trade

To bring our mystery to life, we carefully assembled our toolkit:

Unity (2D Game): We chose this user-friendly game engine for its ideal blend of visual storytelling capabilities and compatibility with our LLM integration.

Inworld.ai: This platform proved invaluable for developing our LLM protagonist, Chitanda. Inworld.ai’s flexibility allowed us to tailor her knowledge base, conversational style, and personality, ensuring she felt authentic to the game’s world and narrative.

itch.io: This platform empowered us to share our creation with the world, inviting players to step into the role of detective and collaborate with our AI sleuth.

Building the Case 

Challenges and Insights Our game unfolds through evocative scenes inspired by a specific Hyouka episode. A key focus was ensuring the LLM stayed on track, grasped the story’s intricacies, and effectively used its vast knowledge to assist players throughout their investigation. To accomplish this, we painstakingly structured the LLM’s knowledge base with meticulous attention to detail. Furthermore, one of our most significant challenges lay in guiding conversational flow and fine-tuning our LLM’s reasoning capabilities. LLMs, despite their power, can be prone to misunderstandings and deviations. Overcoming this hurdle involved careful prompt engineering and constant refinement of our LLM’s knowledge base to maintain focus on the mystery at hand.

Results and Revelations

The outcome surpassed our expectations! We successfully developed a murder mystery game where the core detective is assisted by AI. Our LLM agent demonstrated a remarkable ability to understand the narrative and provide factual information to players, guiding them towards crucial clues. While the project wasn’t without its hiccups, it instilled a deep appreciation for the immense potential and the remaining roadblocks of integrating LLMs into the very fabric of gaming experiences. Perhaps most intriguingly, the project ignited exciting questions about the future of LLM agents. Could they eventually adopt roles even more dynamic and unpredictable for players? Could they become skilled interrogators, extracting information from players themselves? Perhaps, they could even deceive players or, on the other hand, fall victim to skillful deception themselves. The possibilities seem thrillingly limitless.

Looking Ahead: The Future of AI-Driven Storytelling

Our project provided a tantalizing glimpse into the future of AI-powered gaming. While technical challenges remain, the potential for LLMs to shape dynamic, unpredictable, and intensely engaging game narratives is clear. It’s a future where the line between player and AI blurs, fostering a thrilling new level of interactivity and immersion.