Quest Director

Table of Contents

  1. Overview
  2. UPulseQuestDirector
    1. Configuration
    2. Lifecycle
    3. Director state (EPulseQuestDirectorState)
    4. Blueprint API
    5. Save data key
  3. UPulseQuestStateTreeDirector
    1. Configuration
    2. Schema context objects
    3. StateTree lifecycle
  4. Load Behavior

Overview

The Quest Director is an optional, server-only object that manages the narrative layer of quests — deciding when to start or stop quests, scripting cutscene-like sequences, and handling global storyline state.

When a Director is configured, it takes full responsibility for starting quests on load (bypassing the default “restart all saved quests” behavior).


UPulseQuestDirector

Configuration

Set ManagerParams.QuestDirectorClass on the UPulseQuestManager or APulseSharedQuestHost to a subclass of UPulseQuestDirector.

Lifecycle

Event When
Init(Manager) Immediately after the Quest Manager initializes
Start() Called by the manager; State moves from Idle → Running
Stop() Called on manager reset or explicit stop
Tick(DeltaTime) Each tick while State == Running
OnSaveGame(SaveData) Manager is saving; Director writes its data
OnLoadGame(SaveData) Manager loaded; Director reads its data and starts quests

Director state (EPulseQuestDirectorState)

Value Meaning
Idle Not yet started
Running Actively driving quest flow
Stopped Stopped, will not tick

Blueprint API

GetQuestManager()           → TScriptInterface<IPulseQuestManagerInterface>
GetQuestManagerData()       → UPulseQuestManagerData*
GetState()                  → EPulseQuestDirectorState
IsRunning()                 → bool
StartQuest(Tag, OutReason)  → bool
StopQuest(Tag, Result)      → bool
K2_OnInit()                 – override: initialization
K2_OnStart()                – override: begin directing
K2_OnStop()                 – override: cleanup
K2_OnSaveGame(SaveData)     – override: write director save data
K2_OnLoadGame(SaveData)     – override: read director save data + start quests

Save data key

The director stores its serialized bytes in the save game under:

Pulse.Quest.Save.Director   (FGameplayTag constant)

UPulseQuestStateTreeDirector

A specialized Director subclass that runs a StateTree asset (UPulseQuestDirectorStateTreeSchema). This is the recommended approach for complex non-linear storylines.

Configuration

  1. Create a UStateTree asset compiled with UPulseQuestDirectorStateTreeSchema.
  2. Set StateTree property on your UPulseQuestStateTreeDirector subclass (or directly on the default object in the Blueprint).

Schema context objects

Name Type
QuestManager Implements IPulseQuestManagerInterface
QuestManagerData UPulseQuestManagerData
QuestDirector UPulseQuestDirector

StateTree lifecycle

  • Start() calls FStateTreeInstanceData::Init and starts StateTree execution.
  • Tick() calls FStateTree::Tick.
  • Stop() calls FStateTree::Stop.
  • Transitions in the StateTree can start/stop quests using the Director-variant tasks (same task library, Director context).

Load Behavior

When no Director is configured:

  • All quests saved with FPulseQuestSaveRecord are automatically restarted if their flags allow it (i.e., PQF_NoStartOnLoad is not set).

When a Director is present:

  • The automatic restart behavior is suppressed.
  • The Director’s K2_OnLoadGame / OnLoadGame is called with the deserialized save data.
  • The Director is responsible for starting quests in the correct narrative order.
// Example: C++ Director restoring state
void UMyDirector::OnLoadGame(const FPulseQuestSaveGameView& SaveData)
{
    Super::OnLoadGame(SaveData);

    // Check which quests were saved and re-sequence
    for (const FPulseQuestSaveRecord& Record : SaveData.QuestRecords)
    {
        if (Record.bIsActive)
        {
            FGameplayTagContainer Reason;
            StartQuest(Record.QuestTag, Reason);
        }
    }
}

Back to top

Copyright © 2026 LuQ Studios. Distributed under the MIT License.

This site uses Just the Docs, a documentation theme for Jekyll.