Logic Breach: Immersive AI Interrogation

In Logic Breach, the Gemini API is the core engine driving the game's narrative and character realism. We integrated Gemini via C++ in Unreal Engine 5 to create a dynamic interrogation system where player input directly influences the NPC's emotional state and physical animations.

Key Integration Features:

Contextual Reasoning: We utilize Gemini’s large context window to feed the model game-specific evidence and the player's history. This ensures Julian Vane (the NPC) reacts consistently to contradictory statements.

Real-time Animation Feedback: The system parses Gemini's responses to drive an Anim Blueprint. By analyzing the text generation, we trigger procedural talking animations and state changes (Idle, Talking, Thinking) in real-time.

Natural Language Processing: Instead of pre-scripted dialogue trees, Gemini allows for a truly open-ended investigation, where the "logic" of the player's argument is evaluated by the AI to determine if the suspect "breaks" or stays silent.

Gemini is central to the application because the gameplay loop is entirely dependent on the AI’s ability to understand nuance, detect pressure, and respond with human-like latency, turning a static 3D model into a living witness.

Inspiration

My primary inspiration was the retro aesthetic of Classic Film Noir combined with the untapped potential of Generative AI. I wanted to break away from traditional 'dialogue trees' where player choices are pre-written and limited. Logic Breach acts as a psychological thriller where the suspect is not a static script, but a dynamic consciousness powered by Gemini.

What it does

Logic Breach is a first-person detective game where players must solve a high-stakes digital heist. Unlike traditional games, you interrogate suspects using free-form text or voice. Powered by Gemini, the suspect reacts dynamically to your tone, evidence, and contradictions.

How we built it

I integrated Unreal Engine 5 with the Gemini API using the VaRest plugin for real-time communication. The environment utilizes Lumen for dynamic Noir lighting, while a custom 'Context Injection' system feeds physical clues found in the world directly into the AI’s memory.

Challenges we ran into

The biggest challenge was maintaining narrative consistency. I had to fine-tune the System Instructions to ensure Gemini stayed in character as a defensive suspect without breaking the immersion.

Accomplishments that we're proud of

C++/Blueprint Synchronization: I am very proud of building a robust bridge between the Gemini API and the Unreal Engine animation system. Making an external AI dictate real-time responses and character state changes was my greatest technical challenge and success.

Open-ended Interrogation Mechanics: I managed to eliminate boring, pre-set dialogue menus. In Logic Breach, the player can ask anything; thanks to the speed of Gemini 3 Flash, the suspect responds almost instantaneously with astonishing coherence.

What we learned

Asynchronous Communication: I learned the vital importance of handling network requests outside of the game's main thread. This prevents "hitchings" or freezing the frame rate while the AI is generating a response, ensuring a smooth player experience.

Unreal Engine C++ Reflection: I took a deep dive into Unreal's Reflection system (FProperty, CastField) to modify internal Blueprint variables directly from C++ code—an advanced technique that is essential for building sophisticated AI tools within the engine.

Prompt Engineering for Games: I discovered that the key to a great NPC isn't just raw intelligence, but giving them a distinct personality and clear boundaries through the System Prompt. This is crucial to prevent the AI from breaking player immersion.

What's next for Logic Breach

New Cases & Emotional States: Developing new storylines with diverse suspects, each featuring unique personalities. I plan to implement a "Nervousness System" where the AI's stress level dictates when they are more likely to confess.

Visual Evidence System: Implementing a multimodal feature where players can present physical evidence (3D objects) to the suspect. Gemini will analyze the item to decide whether the suspect doubles down on a lie or finally breaks.

Crime Scene Investigation: Creating interactive levels where players can move freely to discover clues. These findings will be stored as dynamic context that can be used against the suspect during interrogation.

Generative Voice Integration: Integrating Google Text-to-Speech so that Gemini's responses are not just text, but synthesized voices perfectly synced with the lip-sync and facial animations already developed.

Built With

Share this project:

Updates