Skip to content

Documentation proposal: end-to-end questphase and scene authoring guides #80

Description

@hlky

Summary

cc @manavortex

The current quest documentation provides useful introductions to inspecting quest files, using the WolvenKit Quest Editor, and implementing individual features. However, there still seems to be room for an end-to-end guide covering how a new quest flow and dialogue scene fit together.

While developing a custom quest mod, we have accumulated practical, runtime-tested knowledge that could form the basis of new documentation for:

  • authoring and registering .questphase resources;
  • creating custom .scene resources;
  • coordinating questphase, scene, journal, localization, world, and character resources;
  • diagnosing structurally valid resources that nevertheless fail or behave incorrectly at runtime.

We would be interested in turning this work into one or more contributions to the documentation.

Proposed questphase guide

A questphase guide could follow a small playable quest from registration through completion, covering:

  • registering a root questphase under base\quest\cyberpunk2077.quest with ArchiveXL;
  • dividing a quest into root and child phases;
  • input/output sockets and child-phase handoff;
  • facts, conditions, branching, and completion states;
  • journal objectives, descriptions, contacts, messages, and map pins;
  • resolving journal paths and their fileEntryIndex values;
  • trigger conditions and NodeRefs;
  • activating communities and waiting for CharacterSpawned;
  • starting a scene and handling its named exit sockets;
  • ownership boundaries between the questphase and scene;
  • validating graph connections and CR2W handle ordering;
  • converting between packed CR2W resources and editable CR2W-JSON with WolvenKit.

A particularly useful topic would be lifecycle ordering. For example, our working flow activates the community, waits for the character to spawn, waits for a broad setup trigger, and only then starts the scene. The running scene handles the closer interaction gates. Getting this ownership or ordering wrong can produce failures that are difficult to distinguish from malformed scene data.

Proposed scene guide

A companion scene guide could cover:

  • the high-level structure of a .scene;
  • actors, performers, screenplay items, graph nodes, sections, and events;
  • spoken dialogue sections and player choice nodes;
  • padding and connecting choice nodes correctly;
  • scene-local quest nodes and trigger conditions;
  • declaring and reaching multiple scene exits;
  • connecting scene exits back to questphase sockets;
  • subtitle, VO-map, and embedded choice-localization responsibilities;
  • resource references, animation sets, and lipsync slots;
  • stable IDs and the different ID domains found in scenes;
  • using vanilla scenes as structural references;
  • serialization round trips and runtime validation.

We also encountered several non-obvious details that may be worth documenting explicitly:

  • Scene event and localization-variant IDs need to retain their full unsigned 64-bit values. Masking them to 63 bits produced a runtime crash in our testing.
  • Choice text is stored in the scene’s embedded localization store rather than in the subtitle or VO maps.
  • Merely including the required localization variants is not sufficient. Descriptor ordering can affect runtime choice lookup; our tested resources required each locale block to be sorted numerically by localization string ID.
  • WolvenKit serialization can preserve a structurally incorrect lookup order, so a successful serialize/deserialize round trip is necessary but not sufficient validation.
  • Lipsync slot cardinality must agree with the scene’s distinct lipsync resource references. A mismatch caused scene initialization crashes in our test case.
  • Starting a scene before its community and actor are ready can lead to difficult runtime failures.

Some of these findings are based on comparison with vanilla resources plus controlled in-game testing. We would clearly distinguish confirmed invariants from observations that may be specific to a particular scene structure or current tool/game version.

Possible tooling section

We have also built small tools that may be useful as examples or companion resources:

  • focused explorers for .questphase, .scene, .journal, localization, entity/appearance, and world CR2W-JSON;
  • Graphviz/DOT output for questphase and scene graphs;
  • a compact JSON scene specification and deterministic scene generator;
  • validation of handles, graph edges, resource references, IDs, localization ordering, and checked-in generated output;
  • regression tests around known runtime-sensitive structures.

The guides would not need to prescribe code generation. The tools could instead demonstrate how to inspect large resources without manually searching raw JSON and how to add repeatable validation around WolvenKit workflows.

Character creation tooling

A separate guide or follow-up proposal could document the character pipeline developed alongside the quest:

  • manifest-driven NPC generation;
  • .ent and .app structure and their relationship;
  • TweakXL character and faction records;
  • assembling head, body, hair, clothing, and appearance resources;
  • selecting compatible assets from installed game archives;
  • extracting actual mesh appearance names;
  • previewing morph-target heads in a local WebGL interface;
  • applying facial shape selections in Blender;
  • exporting GLB resources and rebuilding CR2W meshes with WolvenKit;
  • validating generated resources against a known template;
  • common packaging risks, especially accidental global base\... overrides.

This material is less mature than the core quest/scene work, so it may be better presented separately or initially as an advanced/tooling-oriented guide.

Suggested deliverables

Depending on the preferred documentation structure, this could become:

  1. Creating a minimal custom questphase
  2. Creating a custom dialogue scene
  3. Connecting questphase, scene, journal, localization, and world resources
  4. Debugging and validating custom quests and scenes
  5. Advanced: a manifest-driven custom NPC pipeline

Each guide could use a minimal example rather than the full production quest, with diagrams, focused CR2W-JSON excerpts, WolvenKit screenshots, and explicit notes about what has been verified in game.

Would maintainers be interested in contributions along these lines? If so, guidance on the preferred scope, page structure, and whether the questphase and scene material should be one tutorial or separate guides would be appreciated.

About Ghostline

Ghostline is an open-source Cyberpunk 2077 quest-mod project.

Its broader goal is to develop a complete, reproducible workflow for creating original quests rather than modifying only isolated pieces of existing content. The first playable slice, gq000, follows the player from an initial message exchange through meeting a custom character named Patch, accepting a job, and transitioning to the next objective.

The project currently brings together:

  • root and child questphases;
  • custom dialogue scenes with choices and multiple exits;
  • journal entries, objectives, contacts, messages, and map pins;
  • world triggers, community spawning, AI spots, and scene markers;
  • subtitles, voiceover maps, generated VO, and embedded choice localization;
  • a custom NPC assembled from .ent, .app, mesh, texture, morphtarget, and TweakXL resources;
  • deterministic generators, focused CR2W-JSON explorers, validators, and regression tests;
  • documented runtime investigations into scene initialization, localization lookup, NodeRef resolution, and quest/scene lifecycle ordering.

The repository is both a quest mod and a research project: discoveries are checked against vanilla resources, encoded into tooling and tests where possible, and then validated in game. This provides a reasonably substantial worked example from which smaller documentation samples could be extracted.

Character creator preview

The project also includes a local, manifest-driven character creator. It can preview the real morph-target head, search an index built from installed-game assets, uncook selected meshes for browser preview, assign supported appearances, and drive an isolated Blender/WolvenKit build pipeline.

Image
msedge_rTfl1s77gj.mp4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions