What it does
Marvin is a local-first AI spectator for Baldur’s Gate 3 and Twitch.
The release candidate watches BG3 through OBS, periodically captures gameplay frames, and sends selected screenshots to a locally hosted vision-language model through LM Studio. Marvin reacts through an OBS-ready character overlay with multiple poses and dynamically rendered dialogue.
The runtime deliberately separates game capture, BG3 evidence, model inference, and presentation. Twitch EventSub can provide audience messages, while deterministic polls and preauthored social reactions handle familiar interactions without competing for the model’s limited inference budget. Simulated interactions are labeled and kept separate from genuine Twitch votes.
Marvin is intentionally an occasional spectator rather than a continuous narrator. He can be funny, insightful, wrong, repetitive, or silent. The current prototype still misses fast events and sometimes produces generic or unsupported commentary, so it should be treated as a supervised entertainment experiment rather than a dependable tactical adviser.
How we built it
The project began as a tactical companion with an interest in direct access to game state.
We eventually moved in the opposite direction.
Rather than modifying BG3 or depending on privileged game memory, Marvin observes the same game presentation a viewer sees through OBS. A reusable world_state layer keeps captured evidence and historical state separate from the BG3-specific visual parser, while Marvin’s local GLM vision model handles the parts that require interpretation.
The Twitch audience layer and OBS presentation remain separate from the game’s control path. Marvin can react to viewers, display polls, change poses, or perform theatrical effects without controlling BG3 itself.
Codex helped build the capture pipeline, parser, local inference integration, Twitch and OBS components, character overlay, tests, evaluation harnesses, and multiple experimental versions.
Human direction and gameplay review remained important throughout the project. Passing tests or valid citations were not treated as proof that a generated remark was useful, correct, or entertaining.
What changed during development
One of the largest lessons came from repeatedly making Marvin more capable on paper and worse in practice.
At one point, the same local model was being asked to interpret gameplay, track changing state, remember viewers, schedule social replies, fact-check previous comments, maintain conversational continuity, and improvise comedy.
Version D added persistent audience memory and more sophisticated scheduling. It also made the system slower and less consistently entertaining.
We experimented with smaller contexts, better evidence handling, repetition
Accomplishments that we're proud of
We built a local-first AI companion that can watch a real Baldur’s Gate 3 session through OBS, interpret selected gameplay frames with a locally hosted vision-language model, and respond through a character overlay with its own personality and visual reactions.
More importantly, Marvin became something we could actually enjoy having on screen.
The project grew beyond simple image captioning into a working streaming experience with:
- BG3 gameplay capture through OBS
- local multimodal inference through LM Studio
- a reusable evidence and world-state pipeline
- dynamic Marvin dialogue and multiple character poses
- Twitch EventSub integration
- deterministic audience voting
- clearly separated simulated and live audience events
- operator-controlled social reactions and theatrical effects
- repeatable evaluation tooling for comparing different prompt, context, and memory strategies
We are especially proud that the project remained local-first throughout the release candidate. The model, screenshots, and inference path run on local hardware rather than depending on a hosted model API.
The final prototype is imperfect, but the core idea works: Marvin can become a recognizable participant in the stream rather than simply another information panel.
What we learned
The largest lesson was that orchestration is much harder than connecting several intelligent components together.
We repeatedly made Marvin more sophisticated while making the actual experience worse.
Adding conversational memory, audience history, encounter knowledge, scheduling logic, self-correction, and larger context windows all sounded useful independently. In practice, those features competed for limited inference time and sometimes contaminated one another.
Previous dialogue could anchor later responses. Encounter-specific knowledge could make unrelated scenes look like the encounter we had described. Missing information could be mistaken for a meaningful state change. A valid citation could still support an incorrect interpretation.
We also learned that passing automated tests is not the same as creating a good companion. Some technically successful versions were slower, more repetitive, and less entertaining than simpler ones.
That changed how we thought about the architecture.
Predictable behavior does not always require inference. Poll counting, common audience reactions, and repeated social patterns can be handled cheaply and deterministically, preserving model capacity for situations where interpretation and improvisation are actually useful.
We also learned to separate observation from commentary. Marvin’s previous jokes are not game state, and model-generated conclusions should not silently become evidence for future conclusions.
The project ultimately reinforced a simple idea:
More context is not automatically better context.
What's next for Marvin — An Opinionated Overlay Advisor
The current release is only one version of the idea.
The next step is to make Marvin a more capable opinionated overlay advisor: a reusable character layer that can observe different games, react selectively, and develop continuity without requiring every interaction to pass through an expensive inference step.
Several directions are especially interesting.
Change-aware observation
Instead of repeatedly interpreting isolated screenshots, a future version could compare selected before-and-after frames and focus inference on what actually changed.
That may improve event recognition, reduce repetitive commentary, and allow Marvin to preserve compact evidence about transitions without continually feeding his own previous dialogue back into the model.
Local and hosted model selection
The current release runs entirely on local models.
Future versions could optionally route selected difficult observations to a hosted API model while keeping routine processing local. This would allow direct comparison of quality, latency, privacy, and cost rather than assuming one provider or deployment model is always preferable.
Better attention selection
Marvin does not need to think deeply about every chat message or every frame.
A lightweight attention layer could recognize repetitive or familiar situations quickly, while genuinely novel, important, or ambiguous events become candidates for model inference.
Richer audience relationships
The more ambitious audience-memory experiments were intentionally scaled back for this release.
Longer-term versions could revisit viewer history, callbacks, persistent running jokes, and more natural back-and-forth once inference capacity and context management are strong enough to support them reliably.
Beyond Baldur’s Gate 3
The observation architecture was deliberately kept separate from BG3-specific interpretation.
That creates a path toward other games and environments, including faster and less forgiving games where selective observation and timing become even more important.
The long-term idea is not a perfect tactical oracle.
It is a companion with enough awareness, memory, and personality to make playing—and watching—feel different.
Built With
- eventsub
- html
- javascript
- lms
- obs
- openai
- python
- twitch