Unity Quest System

C#UnityGame SystemsQuest DesignScriptableObjectsEvent BusStrategy Pattern

Project Overview

A standalone Unity package that handles quest logic without coupling game code to a monolithic quest manager. Quest objectives are defined as data assets in the editor. Runtime events flow through an event bus: broadcaster components emit when conditions are met, and receiver components anywhere in the scene respond by running pluggable execution strategies. Three trigger modes cover every common quest scenario (fire-once, toggle, and always-active). The quest manager persists across scene loads, and the system integrates directly with the Unity Extensions Logic module so quest completion states can be composed into condition trees. Requires the Unity Extensions library.

Feature Overview

Everything included in this library, at a glance.

ScriptableObject Quest Objectives

Define quest goals as data assets directly in the Unity Editor. Set a description, a maximum completion count for repeatable objectives, and an execution queue length. Content designers can build and iterate on quest content without touching code.

Broadcaster / Receiver Architecture

Attach a broadcaster component to any GameObject to emit a quest event when a condition is satisfied. Place receiver components anywhere in any scene to respond. The two halves of a quest step are entirely decoupled; they can live in separate prefabs, separate scenes, or anywhere in the hierarchy.

Three Trigger Modes

Receivers ship with three built-in behaviors: fire permanently when first satisfied, reset when the condition goes false and re-fire when it becomes true again, or execute on every single positive broadcast. Each mode covers a common quest scenario with no custom trigger logic needed.

Pluggable Condition Strategies

Define how a broadcaster evaluates its condition through a strategy interface: physics trigger overlap, countdown timer, dialogue response, inventory check, or any arbitrary game state. Swap strategies in the Inspector at design time. The framework handles lifecycle, deduplication, and broadcast logic.

Pluggable Execution Strategies

Define what a receiver does when its quest outcome fires through a strategy interface: unlock a door, spawn enemies, start a cutscene, update an HUD marker. Each receiver carries its own strategy, so a single quest step can trigger different behaviors across multiple locations simultaneously.

Cross-Scene Persistence

The quest manager persists across scene loads. Objective completion state survives transitions, so a quest started in an early zone is still accurately tracked when the player reaches the final area.

Thread-Safe Repeatable Objectives

Objective instances track conditions met and total completions as separate counters behind a lock, safely handling the case where multiple broadcasters attempt to mark the same objective complete simultaneously. Repeatable objectives clamp correctly and never double-count.

Composable with Logic Conditions

Quest objective completion state can be wrapped as a composable condition and plugged into the Logic module from Unity Extensions. Gate abilities, unlock content, or branch dialogue trees using AND, OR, and NOT operators over quest state. No special-casing required.