Inspiration
Generative AI in video games is currently broken because it lacks structure. If you slap a raw LLM onto an NPC, it acts like an improv actor—just saying "yes" to whatever the player types. This completely destroys hard-coded quest logic and makes linear storytelling impossible. We wanted to fix this.
Our inspiration came directly from the Dungeon Master in Dungeons & Dragons.
In D&D, players have absolute agency. They can say or do whatever they want. But a veteran DM is still running a linear story. The genius of a good DM is the illusion of total freedom; they listen to the players' chaotic inputs and dynamically adapt the world's responses to subtly guide the party back toward the main plot hooks. If a player tries to derail the campaign or threatens a critical NPC, the DM enforces strict, mechanical consequences.
We wanted to build that exact dynamic into a video game: a digital DM. We needed the infinite dialogue freedom of an LLM, but locked inside a rigid narrative structure. Instead of an AI that just chats with you, we built an AI that evaluates your psychology, guards the linear story, and punishes you with brutal, Bloodborne-style combat if you fail your "charisma checks."
What it does
How we built it
We built the game in Unity 6.3, heavily utilizing the Starter Assets New Input System to keep our player controller decoupled and responsive. To bridge the gap between generative AI and rigid game logic, we engineered the Alignment & Tension Matrix. The Evaluator LLM returns a JSON payload containing sentiment scores (e.g., Aggression, Fear). We calculate the NPC's breaking point dynamically. For an NPC's total tension $T$ at conversation turn $n$:$$T_{n} = \min\left(100, T_{n-1} + \alpha \Delta F + \beta \Delta A\right)$$(Where $\Delta F$ is the change in Fear, $\Delta A$ is the change in Aggression, and $\alpha, \beta$ are hidden character-specific volatility weights).When $T_{n} \ge 100$, the C# InterrogationManager fires a UnityEvent that disables the UI canvas, spawns the player's weapons, and enables the Enemy AI state machine.For the combat system, we programmed a custom dual-health algorithm. The enemy's active wound state $W$ at time $t$ is calculated as the sum of rapier damage $D_{r}$, minus a rapid regeneration rate $R$ that only triggers if the time since the last hit $\Delta t$ exceeds $3$ seconds:$$W(t) = \sum D_{r} - \begin{cases} 0 & \text{if } \Delta t \le 3 \ R \cdot (\Delta t - 3) & \text{if } \Delta t > 3 \end{cases}$$The Flintlock execution simply sets $H_{current} = H_{current} - W(t)$ and resets $W(t) = 0$.
Challenges we ran into
Constant merge conflicts as one is working on map one in combat and one the ai responsible for all the dialogues simultaneously.
Accomplishments that we're proud of
Created a game demo to showcase AI capabilities in 36 hours
What's next for Echoes of entanglement
Improved graphics Model for the player Map expansion Polished animations and combat
Log in or sign up for Devpost to join the conversation.