Inspiration The campus of IIIT Jabalpur is full of legends, late-night walks, and "what if" scenarios. We’ve all walked past the brooding silence of the Core Lab or the foggy trails near Hall 4 and imagined something mysterious lurking there.
We wanted to capture that atmosphere but found traditional text-adventure games too rigid—once you play them, you know the ending. We asked ourselves: What if we could build a Dungeon Master that never sleeps, knows every corner of our campus, and generates a brand new mystery every time you press 'Start'?
That was the spark for IIIT__JABAL_MYSTERY_PUR: A bridge between the nostalgia of retro text adventures and the limitless creativity of Generative AI.
What it does IIIT__JABAL_MYSTERY_PUR is an infinite, interactive text-adventure game set on a digital twin of our college campus.
Dynamic Storytelling: It generates unique scenarios on the fly—from a rogue AI taking over the Computer Center to a supernatural event in the Library.
Choice-Based Gameplay: Instead of typing commands, the AI presents the player with 3 strategic options (A, B, C) that drive the narrative forward.
Smart Consequence System: The game remembers your actions. If you make a bad choice in the Lecture Hall Complex (LHC), the game adapts, offering funny setbacks or darker twists.
Immersive Environment: The AI acts as a mischievous NPC, describing real landmarks (the Main Gate, the Canteen, the Admin Block) with vivid, atmospheric detail.
How we built it We built this project using a hybrid stack of Game Development and Prompt Engineering:
Unity (C#): We used Unity as the frontend engine to handle the UI, state management, and HTTP requests.
Google Gemini API (Gemini 2.5 Flash): This is the "brain" of the game. We utilized the generateContent endpoint to act as the Game Master.
Structured JSON Prompting: The biggest technical hurdle was getting the AI to interact with game code. We engineered a strict system prompt that forces Gemini to output clean JSON data ({ "story": "...", "options": [...] }) instead of raw text.
Dynamic UI Rendering: The Unity script parses this JSON in real-time, updating the story text and dynamically instantiating buttons for the player's choices.
Challenges we ran into The "Hallucination" Problem: Early versions of the AI would sometimes forget the game rules or invent locations that don't exist in IIIT Jabalpur. We had to refine the "System Instruction" to strictly ground the AI in reality.
JSON Parsing Errors: LLMs love to be conversational. Sometimes Gemini would add markdown (```json) or introductory text ("Here is your story...") which broke our C# parser. We wrote a custom cleaning script to strip unwanted characters before deserialization.
Latency vs. Immersion: Text generation takes time. We had to balance the prompt complexity to ensure the response was detailed but fast enough to keep the player engaged.
Accomplishments that we're proud of Structured AI-to-Game Communication: We successfully treated an LLM as a backend API that returns game logic, not just chat.
The "Vibe" Check: The game genuinely feels like IIIT Jabalpur. The AI captures the student culture, the specific locations, and the spooky/tech atmosphere perfectly.
Error Resilience: We built a robust fallback system so if the AI sends bad data, the game doesn't crash—it retries or handles the error gracefully.
What we learned Prompt Engineering is Coding: We learned that English is effectively a programming language when working with LLMs. A single word change in the prompt can alter the entire game difficulty.
Asynchronous Programming: Deepened our understanding of Unity Coroutines (IEnumerator) and handling web requests without freezing the game frame.
The Power of Context: We learned how to manage "Chat History" arrays to ensure the AI remembers that you picked up a key in the previous turn.
What's next for IIIT__JABAL_MYSTERY_PUR Visuals: We plan to integrate the Gemini Vision capabilities to generate AI images of the current scene (e.g., a spooky generated image of the Core Lab) alongside the text.
Voice Interaction: Adding Speech-to-Text so players can verbally argue with the NPC guard.
Inventory System: Expanding the JSON structure to let players carry items (Keys, ID Cards, Laptops) that unlock special dialogue options later in the game.
Log in or sign up for Devpost to join the conversation.