- The paper presents a dependency-aware multi-stage LLM pipeline that generates coherent RPG worlds, characters, and quests through structured JSON data flow.
- The approach enforces inter-stage dependencies and halts on parser failures to ensure narrative consistency and minimize drift in generation.
- Results indicate stable narrative coherence and high structural completeness across RPG content, validating the modular and extensible pipeline design.
Dependency-Aware Multi-Stage Prompt Pipelines for Coherent RPG Generation
Introduction
Automating the generation of complex, structured, and interdependent narrative artifacts has long been a challenge in procedural content generation (PCG) for role-playing games (RPGs). The paper "From World-Gen to Quest-Line: A Dependency-Driven Prompt Pipeline for Coherent RPG Generation" (2604.25482) presents an explicit dependency-aware, multi-stage prompt pipeline leveraging LLMs for the end-to-end instantiation of richly structured RPG worlds. By enforcing structured data flow between logically distinct stages—world, NPC, player character, campaign-level quest, and extended quest—this work directly addresses the coherence, consistency, and controllability issues that frequently undermine naïve LLM-based content generation.
System Architecture and Design Principles
The pipeline decomposes RPG content generation into modular, contextually grounded stages, with strict inter-stage data dependencies. Each stage conditions input prompts on the full set of structured JSON outputs from all predecessor stages. These representations function as explicit narrative state, propagating coherence constraints throughout the generative process and making each artifact's dependencies transparent and enforceable.

Figure 1: Dependency-aware multi-stage prompt pipeline for structured RPG content generation. Each generation stage conditions on the complete set of structured JSON outputs produced by all preceding stages.
The controller orchestrates pipeline execution and enforces halting on intermediate parser failures to preclude downstream narrative collapse. The LLM (GPT-5, zero-shot) operates without further fine-tuning, with all behavioral guidance realized through rigorous prompt templates and output-constrained via JSON schemas.
Sequential Stage Breakdown
World Generation
The foundational stage defines the world schema—city, locations, buildings, and political/factional structure—with maximal creative flexibility. No prior context is injected; output is a comprehensive, parseable world artifact that downstream systems systematically reference.
NPC Generation
Subsequent NPC instantiation is explicitly conditioned on the structured world. Multiple NPCs are generated per run, each with formalized identity, personality, skills, secrets, and relational links (e.g., rivalry, cooperation), providing a graph-structured social scaffold. These relational graphs ensure that subsequent narrative phases have access to explicit, traversable inter-character dependencies.
Player Character Generation
The protagonist is created with reference both to the structured world and sampled NPCs, embedding the player within established social networks and political contexts. This conditioning strengthens protagonist integration and foreshadows quest-anchoring.
Campaign-Level Quest Generation
Quests are produced as interrelated planning artifacts, referencing previously defined world entities and characters. This approach encodes campaign structure and inter-quest dependencies, but intentionally defers local narrative elaboration, decoupling high-level progression from quest detail generation.
Extended Quest Generation
Individual campaign quests are then elaborated, with full context injection and expressive expansion into multi-step experiences featuring dialogue, choice, and explicit connections to the broader narrative graph. These extended artifacts are amenable to further inspection, validation, and modular editing.
Evaluation Protocol
A qualitative, human-centric evaluation protocol was applied, focusing not on automated linguistic similarity but on structural validity, internal consistency, narrative coherence, diversity, and actionability of artifacts. Sampling and assessment were performed across 20 complete pipeline runs—each generating full world, NPC, PC, 10 quests, and their extended versions—yielding a substantial corpus for evaluation.
Each artifact was rated on a five-point Likert scale across the criteria, with performance aggregated by content type (World, NPCs, Player, Campaign-Quests, Extended Quests).
Results and Key Findings
No significant degradation in narrative integrity was observed at later pipeline stages. World and NPC generation achieved high marks for structure and diversity, while quests maintained internal consistency and narrative coherence in spite of dependency depth. Notably, when extended quest generation was conditioned on the campaign backbone, actionability and local coherence remained strong—highlighting the benefit of separating global narrative planning from per-quest elaboration.
The most salient effects are:
- High structural completeness and consistency across all stages, attributed to JSON schema enforcement and explicit dependency management.
- Stable narrative coherence when scaling from world to extended quests—mitigating drift and contradiction typical with single-prompt, monolithic generation approaches.
- Modularity and extensibility, as additional generative passes and validation steps can be incorporated without architectural overhaul, provided the structured interface contract is maintained.
Discussion and Implications
Structured Prompting and Dependency Propagation
The explicit use of structured JSON as both input and output at every stage critically reduces ambiguities in model responses and directly counteracts LLM hallucinations. This explicit state management enables deterministic validation, robust error handling (halting execution or falling back to preserved raw artifacts), and transparent integration with downstream tooling.
Campaign and Quest-Level Decoupling
By generating campaign-level quest graphs prior to local quest expansion, the pipeline enforces global narrative constraints while supporting fine-grained, context-sensitive quest writing. This approach is essential for maintaining thematic pacing and causal integrity in RPG scenarios, where shallow or fractured quest chains rapidly erode design value.
Reproducibility and Usability for Game Development
All artifact outputs—world definitions, entity tables, quest graphs—are delivered as structured, reusable data, facilitating rapid iteration and integration into RPG pipelines. Designers benefit by being able to sample, inspect, and edit any artifact in situ, leveraging the modular outputs for downstream systems, visualization, or further authorial intervention.
Generalization to Broader Generative Systems
Although evaluated on the RPG domain, the principles demonstrated here—dependency-aware staged generation, explicit structured representations, and strict output constraints—are directly applicable to other domains requiring sequential reasoning, such as simulation design, scenario authoring for training environments, or structured document generation in technical writing.
Limitations
Several methodological limitations are acknowledged:
- All evaluations were performed by system-familiar experts, with the absence of external or user-centered ratings. No formal inter-rater reliability analysis was reported.
- There was no quantitative or baseline comparison against alternative flat or one-shot generation pipelines. The effect size relative to baseline approaches is thus not directly measured.
- The pipeline behavior was evaluated with a single LLM variant, and generalization to other architectures or prompt handling behaviors remains unexplored.
Conclusion
The dependency-aware, multi-stage prompt pipeline for RPG content generation demonstrates that explicit inter-stage conditioning and structured outputs can substantially enhance the coherence, consistency, and utility of LLM-generated narrative artifacts. The approach mitigates the stochastic, drift-prone weaknesses of naïve LLM deployment in PCG, allowing for practical application in environments where modularity, traceability, and narrative logic are paramount.
Future lines of work should systematically compare this pipeline to alternative architectures, investigate large-scale automated metrics for narrative structure, and incorporate broader user and designer evaluation. Additionally, hybridization with symbolic reasoning and reinforcement of fine-grained validation may offer further controllability gains.
The explicit separation of global planning and local expansion, mediated by structured intermediate representations, constitutes an effective paradigm not only for RPGs but for a wide range of generative tasks requiring sequential, stateful artifact synthesis.