All skills
thedivergentai avatar

/godot-quest-system

@9d6e91e

Expert blueprint for quest tracking systems (objectives, progress, rewards, branching chains) using Resource-based quests, signal-driven updates, and AutoLoad managers. Use when implementing RPG quests or mission systems. Keywords quest, objectives, Quest Resource, QuestObjective, signal-driven, branching, rewards, AutoLoad.

Use this Skill: https://skilld.dev/gh/thedivergentai/gd-agentic-skills/godot-quest-system

This session only. Nothing lands on disk.

referencesquest-patterns-deep.md

≈714 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Quest System Deep Dive (load on demand)

MANDATORY when wiring Quest/Objective/Manager/UI beyond quest_resource.gd + quest_manager_singleton.gd. Prefer bundled scripts over inline class dumps.

Core Resource shapes

class_name Quest extends Resource
signal progress_updated(objective_id: StringName, progress: int)
signal completed

@export var quest_id: StringName
@export var objectives: Array[QuestObjective] = []

func is_complete() -> bool:
    return objectives.all(func(obj): return obj != null and obj.is_complete())
class_name QuestObjective extends Resource
enum Type { KILL, COLLECT, TALK, REACH }

@export var objective_id: StringName
@export var required_amount: int = 1
var current_amount: int = 0

func progress(amount: int = 1) -> void:
    current_amount = mini(current_amount + amount, required_amount)

Manager accept / progress / complete

func accept_quest(quest: Quest) -> void:
    if quest.quest_id in completed_quests:
        return
    active_quests.append(quest)
    quest.completed.connect(_on_quest_completed.bind(quest), CONNECT_ONE_SHOT)

CAUTION: Disconnect completion Callables when quest leaves active set — double rewards if signals fire twice.

Triggers (decoupled)

# enemy.gd — prefer kill_objective_trigger.gd / EventBus
func _on_died() -> void:
    QuestManager.update_objective(&"kill_bandits", 1)

NEVER hardcode quest logic inside enemy scripts — use kill_objective_trigger.gd.

Quest UI tracker

Rebuild from manager signals only — quest_ui_tracker.gd. UI must not compute progress formulas.

Elite: NavMesh waypoint helper

quest_waypoint_helper.gd — update NavigationAgent3D.target_position only when objectives change (not every frame).

Elite: prerequisite graph

branching_quest_data.gd — @export var prerequisites: Array[QuestData] inspected in editor instead of hardcoded unlock chains.

Elite: thread-safe progress

quest_conflict_resolver.gd — Mutex around shared progress maps when networking or parallel combat threads update the same objective id; defer UI signals to main thread.

Persistence

Save id maps + counts — quest_persistence_loader.gd. NEVER serialize live Quest Resource graphs with mutable current_amount on shared .tres files.

Best practices

  1. Signal-driven updates — no _process polling.
  2. StringName ids — silent failures on typos with plain strings.
  3. Rewards via inventory/economy signals — not inside Quest Resource.

Source: SKILL.md on GitHub

1 warning16d4 checks · Risk SAFE
  • Gen Agent Trust Hub16d

    The skill provides a robust and well-documented framework for implementing quest systems in the Godot game engine. It utilizes best practices such as Resource-based data management and signal-driven architectures. No malicious patterns, data exfiltration, or injection vulnerabilities were detected.

  • Socket16d

    No alerts

  • Snyk16d

    Risk: LOW · No issues

  • Runlayer7mo

    3/3 files flagged

Signed by skilld at 9d6e91e. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 3 weeks ago.

Activeupdated 2 months ago

README badge

README badge for thedivergentai/gd-agentic-skills/godot-quest-system