About the Project
Inspiration
I wanted to experiment with a different kind of game mechanic using Gemini.
Instead of letting the player control everything, I asked a simple question:
What if the player could only influence the hero through conversation?
This idea led to a narrative game where the player is an NPC in a war-torn world, and the AI controls the hero. The player’s only tool is dialogue, and trust must be earned over time.
What I Learned
While building this project, I learned:
- How to use Gemini as a reasoning agent rather than a simple chatbot
- How persistent state (trust, suspicion, memory) creates emergent behavior
- The importance of handling AI failures safely in real applications
- How prompt design directly affects consistency and realism
I also gained hands-on experience working with managed AI backends instead of embedding API keys directly.
How It Was Built
The project is a text-based narrative game powered by Gemini 3 Flash.
Each interaction follows a loop:
- The player speaks to the hero.
- Gemini reasons internally as the hero and updates hidden state.
- The world evolves based on the hero’s decision.
- Only the hero’s dialogue is shown to the player.
Trust is modeled as a value
[
t \in [0,1]
]
and updated incrementally each turn, ensuring gradual relationship changes rather than instant outcomes.
The app is deployed using Lovable’s managed infrastructure, which securely handles Gemini model access.
Challenges
The main challenges were:
- Debugging backend issues when the model returned no output
- Ensuring structured reasoning without exposing internal state
- Optimizing responses to stay within limited usage credits
Overcoming these challenges helped me better understand how to build reliable AI-powered applications.
Conclusion
This project explores how AI can drive storytelling through trust, memory, and limited player agency.
It demonstrates how Gemini can be used to create interactive systems that feel alive, responsive, and unpredictable.
Built With
- ai
- backend
- chatgpt
- cloud
- game
- gemini
- javascript
- lovable
- narrativeai
Log in or sign up for Devpost to join the conversation.