neon-sprawl/docs/decomposition/modules/E7_M1_QuestStateMachine.md

2.5 KiB
Raw Blame History

E7.M1 — QuestStateMachine

Summary

Field Value
Module ID E7.M1
Epic Epic 7 — Quest / Faction
Stage target Prototype
Status Planned (see dependency register)

Purpose

Data-driven quest lifecycle: start, step progression, branching, failure/reset, and completion with durable persistence. Integrates crafting and combat outcomes so guided content ties together gathercraftcombat loops without duplicate rewards.

Responsibilities

  • Load and interpret QuestDef; track QuestStepState per player (or party scope as designed).
  • Apply QuestStateTransition rules for advance, abandon, fail, and complete.
  • Invoke or subscribe to E3.M2 and E5.M1 (or their events) for step completion predicates.

Key contracts

Contract Role
QuestDef Steps, prerequisites, objectives, and branching metadata.
QuestStepState Current step progress and internal flags.
QuestStateTransition Valid transitions and side effects (before E7.M2 reward routing).

Module dependencies

  • E3.M2 — RefinementAndRecipeExecution: craft completion, item hand-ins, refine steps.
  • E5.M1 — CombatRulesEngine: defeat objectives, encounter-linked steps.

Dependents (by design)

See Epic 7 Slice 1 — Quest core and persistence: 35 onboarding quests plus one chain across gather/craft/combat; telemetry quest_start, quest_step_complete, quest_complete, funnel times.

Risks and telemetry

  • Scripting weight: keep QuestDef data-first; templates in decomposition/tooling path per epic.
  • Double-claim: design for idempotency before E7.M2; lint bundles vs E6.M4 / E3.M5.

Source anchors