Inspiration
Most game companions feel like scripted followers, while AI assistants usually live in a separate chat window. We wanted to explore what happens when an agent becomes a genuine party member—one that understands the battlefield, remembers the journey, offers useful advice, and acts through the same rules as the player.
Storyforge grew from the idea that AI should not replace the player or secretly rewrite the game. It should make the adventure feel more social, strategic, and alive.
What it does
Storyforge is a fantasy action RPG in which the player becomes the Last Heir and travels across five corrupted realms to recover the Eclipse Seals.
The player fights enemies, completes realm-specific objectives, collects weapons, recruits companions, and confronts multi-phase bosses. Each companion has a distinct personality, ability, tactical role, trust level, and independent motivation.
Through WebMCP, an external agent can:
- Inspect the live battlefield and fellowship state
- Understand health, enemies, inventory, objectives, pressure mechanics, and boss phases
- Explain the next valid quest action
- Recommend companion abilities and battle strategies
- Issue reversible tactical commands
- Propose coordinated party plans for the player to approve
Agent actions appear in a visible activity feed, keeping the collaboration understandable and accountable.
How we built it
We built Storyforge with React, TypeScript, Vite, Zustand, and a deterministic TypeScript game engine.
The WorldEngine is the canonical source of truth for combat, quests, inventory, companions, relationships, and campaign progression. Both the React interface and WebMCP tools operate on this same state.
The game registers typed, JSON-schema-based WebMCP tools through document.modelContext or navigator.modelContext. Read tools expose purpose-built views of the battlefield and fellowship. Action tools pass validated commands into the engine rather than manipulating the interface or inventing results.
Consequential agent actions create visible proposals that the player can accept or reject. Activity is persisted locally, and the project includes automated tests for combat, quest progression, companion behavior, and WebMCP integration.
Challenges we ran into
The hardest challenge was making agents useful without allowing them to bypass the game.
Early versions made companions feel cosmetic because the player could complete most objectives alone. We redesigned the campaign around companion-specific abilities, recruitment trials, trust, pressure mechanics, coordinated attacks, and independent initiatives.
We also had to keep agent reasoning grounded. Instead of asking an agent to interpret pixels, we exposed structured battlefield state and enforced every action through the game engine.
Another challenge was browser compatibility. WebMCP, browser speech synthesis, microphone access, and deployment environments expose different capabilities. We added feature detection, captions, typed-command fallbacks, visible status indicators, and a Chrome Origin Trial token.
Finally, presenting a large game world alongside combat information, party controls, dialogue, recommendations, and agent activity required several UI redesigns to prevent overlapping panels.
Accomplishments that we're proud of
We are proud that WebMCP is part of the actual gameplay rather than a decorative chatbot.
The agent sees the same canonical state that drives combat and can affect the encounter through real, constrained tools. At the same time, the player retains authority over movement, major plans, and consequential changes.
We are also proud of the fellowship system. Companions persist across realms, fight alongside the player, develop trust, unlock combinations, offer contextual advice, and sometimes leave to pursue opportunities based on their own priorities.
The result is a complete five-stage campaign with distinct environments, collectible equipment, recruitment challenges, escalating realm mechanics, multi-phase bosses, persistent progression, remappable controls, and a visible human-agent collaboration history.
What we learned
We learned that believable agentic gameplay depends more on constraints and consequences than unlimited freedom.
Agents feel intelligent when they receive accurate context, understand what is currently possible, and make decisions that visibly affect the world. Giving an agent unrestricted control would have made the game less coherent and less enjoyable.
We also learned that transparency improves trust. Showing tool calls, recommendations, proposals, and outcomes makes the agent feel like a teammate whose reasoning can be understood—not an invisible system changing the game behind the scenes.
Most importantly, AI companions become compelling when they have specialized capabilities, incomplete information, relationships, and motivations of their own.
What's next for Storyforge
Next, we want to deepen the social and strategic side of the fellowship:
- Dynamic voice generation with a distinct voice for every companion and boss
- Longer companion memory and relationships shaped by player decisions
- Procedurally generated quests grounded in persistent world rules
- More companion disagreements, personal missions, and conflicting priorities
- Drop-in cooperative play between human and agent-controlled party members
- Additional realms, weapons, enemies, and branching endings
- Improved tactical planning with environmental interactions and party formations
- Shareable campaign histories that preserve every important human-agent decision
Our long-term goal is for every Storyforge adventure to feel like playing with a group of friends who understand the world, surprise you, and help create a story none of you could have produced alone.
Built With
- api
- chrome
- immer
- indexeddb
- origin
- react
- speech
- trial
- typescript
- vercel
- vite
- vitest
- web
- webmcp
- zustand
Log in or sign up for Devpost to join the conversation.