Inspiration
S.T.A.L.K.E.R. has always felt more alive than most open-world games because of A-Life. Stalkers travel, fight, survive, join squads, gain reputations, die off-screen, and continue existing whether the player is watching or not.
But the world rarely remembers those events socially.
A Renegade can be mauled by a boar, a squad can be wiped out, or the player can change the balance of a region—and most NPCs will never meaningfully acknowledge it. At the same time, many current attempts at using LLMs in games simply turn NPCs into exposed chatbots that invent lore, forget context, and undermine the simulation.
I wanted to prove there was another approach.
Word Gets Around in The Zone uses a local LLM as a bounded narrative layer over an existing simulation. A-Life remains authoritative. The model does not control combat, quests, faction relations, game state, or memory. It receives a small set of verified facts and proposes how a stalker might interpret or describe them.
A-Life lives the world. Session Intelligence remembers it. The model voices it.
What it does
The mod currently supports two major end-to-end systems:
Faction-aware player origins
During character creation, the player can generate, edit, regenerate, and approve a personal history grounded in their selected faction.
The origin includes details such as:
- former occupation
- reason for entering the Zone
- past failure or unpaid debt
- existing contact or enemy
- fear or superstition
- personal survival rule
The generated origin is never written directly into canon. The player reviews and edits it first, and it becomes persistent player history only after approval and a real save.
Faction context meaningfully changes the result. For example, a Monolith origin focuses on the character's pre-conversion identity, capture, indoctrination, and fragmented memories rather than treating Monolith like an ordinary employer.
Dynamic rumours from real A-Life events
The mod observes verified events already produced by the game, journals them, reduces them into deterministic world history, and selectively turns them into rumours.
A stalker killed by Clear Sky, mauled by a mutant, or shot through the head can later become something another NPC discusses through an ordinary in-game dialogue option.
The model is not allowed to invent the underlying event. X-Ray supplies the facts; the model only supplies the phrasing and point of view.
This means the player can see an event appear in the PDA, ask a random stalker what they have heard, and receive a natural response based on something that genuinely happened in the simulated world.
How I built it
The project is roughly 30,000 lines across Lua, Python, configuration, schemas, tests, packaging, and integration code.
The architecture is split into several layers:
- X-Ray and A-Life produce authoritative world events.
- Lua bridges capture verified game state without blocking the engine.
- A file-based spool transfers requests and responses safely between the game and the companion process.
- A Python companion validates events, journals them in SQLite, applies deterministic reducers, manages save lineage, and prepares narrowly scoped prompts.
- llama.cpp running through CUDA performs local inference.
- Validators accept or reject the model output.
- Approved text is projected back into the game's native PDA and dialogue systems.
Python acts as the orchestration layer. The model itself runs through compiled C++ and CUDA using llama.cpp.
The game never waits for inference and remains fully playable if the model, companion, database, or Session Intelligence layer is unavailable.
Session Intelligence
Word Gets Around in The Zone uses a game-specific implementation of Session Intelligence, an architecture I originally built for long-running software-engineering agents.
The original problem was context loss.
Coding agents could read a repository, make architectural decisions, edit dozens of files, use tools for hours, and then gradually lose track of which files mattered, what had already been tried, why earlier decisions were made, and which parts of the system were currently active. Simply placing more text into the context window was expensive, repetitive, and unreliable.
Session Intelligence was built as a deterministic runtime surrounding those stochastic agents.
It observes and indexes information such as:
- user instructions and architectural decisions
- files read and modified
- tool usage
- repository structure
- active tasks and failures
- recent implementation history
- frequently accessed or “hot” files
- prior model conclusions and handoffs
This information is stored outside the model and retrieved only when relevant. Session hooks capture state at startup, during prompt handling, and when work stops. Custom MCP tools expose controlled repository reads, writes, searches, shell operations, semantic retrieval, and reranking while updating the Session Intelligence state.
The goal is not to make the model remember everything. The goal is to ensure the surrounding system remembers what is true and supplies the right subset when needed.
In practice, the original SI reduced the initial context required by some long-running Claude sessions from roughly 35–45% of the available window to around 3–10%. During one Codex session it avoided approximately 20,000 tokens of repeated repository loading in about twenty minutes. It also allowed work to move between different models with far less loss of architectural context.
I developed the system independently to solve failures I was repeatedly seeing in real agent workflows. I later discovered that parts of the design resembled ideas explored by systems such as MemGPT, particularly the separation between active context and externally managed memory.
From software agents to a simulated world
The GAMMA implementation shares the same core philosophy but is structured very differently.
The original Session Intelligence answers:
How can a coding agent continue working across a large repository without forgetting important decisions, files, failures, and current state?
The game implementation answers:
How can a stochastic model participate in a persistent simulated world without becoming the source of truth?
For Word Gets Around in The Zone, Session Intelligence stores and manages:
- verified A-Life events
- player canon and approved character origins
- actor and faction knowledge
- save and branch lineage
- repetition history
- event evidence
- model requests and verdicts
- stale-response rejection
- narrative state derived through deterministic reducers
The model does not own any of this memory. It receives a narrow, authenticated projection of the facts relevant to one generation request.
This preserves the same governing principle used by the original system:
Deterministic state surrounds the stochastic model.
In the software-engineering version, SI prevents an agent from forgetting the repository.
In the game version, SI prevents the model from inventing or forgetting the world.
Challenges
The largest challenge was integrating a modern local-model runtime into an undocumented legacy engine without compromising stability or performance.
Some of the issues included:
- native X-Ray crashes caused by missing XML nodes
- UI controls that could trigger pure virtual function failures
- multiple competing UI code paths inside the same scripts
- save and autosave lineage bugs that stranded events across sibling saves
- stale responses arriving after reloads
- accidentally resolving the wrong llama.cpp executable and running a Vulkan build instead of the validated CUDA build
- engine settings reads that could cause native fatal errors rather than catchable Lua exceptions
- preserving user-edited origin values instead of approving an older generated draft
- preventing internal faction identifiers such as
cskyfrom leaking into natural dialogue - ensuring speakers understand whether they personally caused an event, witnessed it, or merely heard about it
- keeping generated dialogue grounded, faction-aware, concise, non-repetitive, and indistinguishable from existing game content
The project now has more than 400 automated tests alongside repeated live validation inside GAMMA.
Accomplishments
The most important result is that the system disappears into the game.
During testing, I asked an ordinary stalker for a rumour and received a model-generated response based on a Renegade who had genuinely been mauled by a boar earlier in the simulation. The dialogue appeared through the normal game menu and blended closely enough with existing content that I checked the PDA afterward to confirm it came from the mod.
The current validated reference system uses:
- Windows
- an NVIDIA RTX 3080 with 10 GB VRAM
- CUDA
- a local quantized Gemma model
- llama.cpp
- approximately 8 GB of VRAM during operation
GAMMA remained around 100 FPS during live testing.
What I learned
LLMs do not need to become unrestricted chatbots to add value to games.
They work extremely well as controlled stochastic actors inside deterministic systems. The game provides truth, persistence, identity, and consequences. The model contributes variation, interpretation, and voice.
The most important engineering work was not prompt writing. It was authority separation, event capture, save integrity, validation, recovery, repetition control, process supervision, and ensuring the generated content respected the world that already existed.
What's next
Part 1 is operational and playable, but still requires more long-session testing and release packaging.
Future work may include:
- polished one-click installation and removal
- wider hardware qualification
- improved speaker perspective and faction-name normalization
- richer use of combat details such as weapons, damage types, and hit locations
- additional A-Life behaviour enhancements
- dynamic missions compiled from verified world pressures
- Warfare mode improvements
- Azazel mode identity handling
- more faction-specific social behaviour and dialogue
The long-term goal is not to replace A-Life.
It is to help the world remember what A-Life already did.
Log in or sign up for Devpost to join the conversation.