Godot mechanic secrets

From thedivergentai/GD-Agentic-Skills · View interactive version

Godot mechanic secrets is an AI agent skill from the GitHub repository thedivergentai/GD-Agentic-Skills. Implement cheat codes, hidden interactions, and unlockable meta-content via time-windowed input sequence buffers, spam thresholds, look-at (dot-product) detectors, progress-% unlocks, and meta persistence in user://secrets.cfg. Use when adding Konami-style codes, curiosity spam eggs, glimmer cues, l

How to use this skill

Skill file

Decision Tree — Which Secret Trigger?

| Player action / design goal | Choose | MANDATORY script |

|----------------------------|--------|------------------|

| Exact button combo / Konami | Time-windowed input sequence | secret_sequence_combo_matcher.gd (+ secret_konami_legacy_code.gd for classic mapping) |

| Mash / click N times on a prop | Spam threshold | secret_interaction_spam_tracker.gd |

| Face a wall / look at a spot | Dot-product look-at (not ray spam) | secret_visibility_detector.gd |

| Clear X% of content / true ending | Progress % unlock | secret_progress_threshold_unlocker.gd |

| Rare vendor / ghost encounter | Weighted random encounter | secret_random_encounter_spawner.gd |

| Persist unlock across save slots | Meta secrets.cfg | secret_meta_persistence.gd |

| Stop macro brute-force | Lockout guard | secret_lockout_cheat_guard.gd |

| Secret grants stats/items in P2P | Server/peer validation | godot-adapt-single-to-multiplayer — validate unlock before applying combat/economy advantages |

Do NOT invent a fourth custom detector until the table above fails.

Core Components

[secret_meta_persistence.gd](scripts/secret_meta_persistence.gd)

Expert logic for saving global unlocks and discovery flags across all save profiles.

[secret_visibility_detector.gd](scripts/secret_visibility_detector.gd)

View-dependent hidden wall detection using optimized Dot Product calculations.

[secret_sequence_combo_matcher.gd](scripts/secret_sequence_combo_matcher.gd)

MANDATORY for combos — Time-sensitive input buffer with suffix/window match (not full-buffer equality).

[secret_interaction_spam_tracker.gd](scripts/secret_interaction_spam_tracker.gd)

Logic for tracking repetitive player actions to trigger curiosity-based Easter Eggs.

[secret_audio_environment_occluder.gd](scripts/secret_audio_environment_occluder.gd)

Spatial logic for dynamically adjusting AudioBus effects in sealed or hidden areas.

[secret_progress_threshold_unlocker.gd](scripts/secret_progress_threshold_unlocker.gd)

Percentage-based unlocker for meta-content and 'True Ending' triggers.

[secret_random_encounter_spawner.gd](scripts/secret_random_encounter_spawner.gd)

Weighted random system for rarest-tier entities and secret vendor encounters.

[secret_lockout_cheat_guard.gd](scripts/secret_lockout_cheat_guard.gd)

Anti-brute-force lockout manager to protect secret integrity.

[secret_vfx_discovery_glimmer.gd](scripts/secret_vfx_discovery_glimmer.gd)

Subtle procedural visual cues for hinting at hidden interactables.

[secret_konami_legacy_code.gd](scripts/secret_konami_legacy_code.gd)

Specialized implementation of the iconic Konami code using the buffer matcher.

[secret_persistence_handler.gd](scripts/secret_persistence_handler.gd) / [input_sequence_watcher.gd](scripts/input_sequence_watcher.gd) / [interaction_threshold_trigger.gd](scripts/interaction_threshold_trigger.gd)

DEPRECATED — legacy helpers superseded by secret_* scripts. Do not wire new scenes here; migrate to secret_sequence_combo_matcher.gd, secret_interaction_spam_tracker.gd, and secret_meta_persistence.gd.

Usage Example (Cheat Code)

# Attach SecretSequenceComboMatcher (class_name) as a child of GameManager / Player
@onready var combo: SecretSequenceComboMatcher = $SecretSequenceComboMatcher

func _ready() -> void:
    # Default sequences Dictionary already includes "Konami"; override or add:
    combo.sequences = {
        "GodMode": ["ui_up", "ui_up", "ui_down", "ui_down", "ui_left", "ui_right", "ui_left", "ui_right"]
    }
    combo.combo_achieved.connect(_on_cheat_unlocked)

func _on_cheat_unlocked(combo_name: String) -> void:
    print("Unlocked: ", combo_name)
    # Meta flag — NOT the per-slot SaveManager payload
    SecretMetaPersistence.unlock_secret("god_mode")  # via secret_meta_persistence.gd API

NEVER Do (Expert Secret Rules)

Discovery & Triggers

Persistence & Meta

UX & Anti-Brute Force

Best Practices

  1. Event-Based Combo Detection - Avoid polling in _process.
  2. Subtle Cues - Secrets should be hinted at, not invisible.
  3. Global Persistence - Use separate save files for meta-progress.

Elite Meta Patterns (galleries / lore / ghosting)

MANDATORY when building achievement galleries, lore journals, or ghosted-secret visibility: read secrets-meta-patterns.md. Do NOT Load for basic combo/spam/look-at triggers — use the decision tree scripts above.

Reference

Progressive disclosure: open Official Documentation links only when researching a specific API; load Related Skills when routing to a peer domain — do not preload the whole lattice.

Official Documentation

Related Skills

Prerequisites
Complements
Downstream / consumers
Master
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.