
Godot Mechanic Secrets
- 150 installs
- 454 repo stars
- Updated July 28, 2026
- thedivergentai/gd-agentic-skills
Use godot-mechanic-secrets for development tasks
About
godot-mechanic-secrets: A skill for development. This provides functionality for development workflows.
- godot-mechanic-secrets
Godot Mechanic Secrets by the numbers
- 150 all-time installs (skills.sh)
- +15 installs in the week ending Aug 5, 2026 (Skillselion tracking)
- Ranked #2,522 of 4,347 Backend & APIs skills by installs in the Skillselion catalog
- Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/thedivergentai/gd-agentic-skills --skill godot-mechanic-secretsAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 150 |
|---|---|
| repo stars | ★ 454 |
| Last updated | July 28, 2026 |
| Repository | thedivergentai/gd-agentic-skills ↗ |
What it does
Use godot-mechanic-secrets for development tasks
Files
Secrets & Easter Eggs (Mechanics)
Overview
This skill provides reusable components for hiding content behind specific player actions (e.g., Konami code, repetitive interaction) and managing the persistence of these discoveries.
Core Components
secret_meta_persistence.gd
Expert logic for saving global unlocks and discovery flags across all save profiles.
secret_visibility_detector.gd
View-dependent hidden wall detection using optimized Dot Product calculations.
secret_sequence_combo_matcher.gd
Professional time-sensitive input buffer for detecting complex cheat combos and sequences.
secret_interaction_spam_tracker.gd
Logic for tracking repetitive player actions to trigger curiosity-based Easter Eggs.
secret_audio_environment_occluder.gd
Spatial logic for dynamically adjusting AudioBus effects in sealed or hidden areas.
secret_progress_threshold_unlocker.gd
Percentage-based unlocker for meta-content and 'True Ending' triggers.
secret_random_encounter_spawner.gd
Weighted random system for rarest-tier entities and secret vendor encounters.
secret_lockout_cheat_guard.gd
Anti-brute-force lockout manager to protect secret integrity.
secret_vfx_discovery_glimmer.gd
Subtle procedural visual cues for hinting at hidden interactables.
secret_konami_legacy_code.gd
Specialized implementation of the iconic Konami code using the buffer matcher.
Usage Example (Cheat Code)
# In your Game Manager or Player Controller
@onready var cheat_watcher = $InputSequenceWatcher
func _ready():
# Define UP, UP, DOWN, DOWN...
cheat_watcher.sequence = [
"ui_up", "ui_up", "ui_down", "ui_down"
]
cheat_watcher.sequence_matched.connect(_on_cheat_unlocked)
func _on_cheat_unlocked():
print("God Mode Enabled!")
SecretPersistence.unlock_secret("god_mode")NEVER Do (Expert Secret Rules)
Discovery & Triggers
- NEVER hardcode input checks in `_process` — Frame-dependent polling is unreliable for fast combos. Always use an event-based buffer like
secret_sequence_combo_matcher.gd. - NEVER use complex Raycasts for 'LookingAt' secrets — Physics raycasts are expensive if every wall is checking. Use the Dot Product method in
secret_visibility_detector.gdfor overhead efficiency. - NEVER make 'Hidden Walls' identical to real walls — Players need a subtle "Glimmer" or texture discrepancy. Total invisibility isn't a secret; it's a bug to the player.
Persistence & Meta
- NEVER save "Secrets Found" in the main Save Slot — If the player deletes their save to try a different build, their meta-progress (Gallery, Achievement flags) should persist. Use
secret_meta_persistence.gd. - NEVER trust client-side cheat validation in Peer-to-Peer — If a secret grants a stat boost, other peers should validate the "Unlock" to prevent simple memory-editing cheats.
- NEVER use `PlayerPrefs` (Godot's equivalent of Settings) for secrets — Use a dedicated
user://secrets.cfg.
UX & Anti-Brute Force
- NEVER allow unlimited rapid-fire cheat attempts — A simple macro can brute-force a 4-button combo in seconds. Use
secret_lockout_cheat_guard.gdto add a penalty for excessive failures. - NEVER trigger a secret without an 'Aha!' audio/visual cue — The reward for finding a secret is the feeling of discovery. Use
secret_audio_environment_occluder.gdto change the atmosphere.
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 Godot 4.x Patterns
1. Secret Flag Tracker (Achievement Bridge)
Use Resource objects to track discovery states and emit signals that bridge to your achievement system.
# secret_data.gd
class_name SecretData extends Resource
@export var id: StringName
@export var is_found := false:
set(v):
is_found = v
emit_changed()
# secret_manager.gd (AutoLoad)
func _on_secret_changed(data: SecretData):
if data.is_found:
achievement_system.unlock(data.id)2. Environmental Storytelling Lore History
Extend secret resources to include lore snippets. Record a history of discovered items to populate a player journal using RichTextLabel with BBCode.
# lore_item.gd
class_name LoreItem extends SecretData
@export_multiline var description: String
# lore_journal_ui.gd
func add_entry(lore: LoreItem):
journal_label.text += "\n[b]Discovery:[/b] " + lore.description3. Ghosting System (Collected Secret Visibility)
Instead of deleting found secrets, render them with partial transparency and disable their collision. This informs players that the area has been "cleared."
# ghostable_secret.gd
func _ready():
if secret_data.is_found:
_apply_ghost_visuals()
func _apply_ghost_visuals():
# 2D: Use modulate alpha
modulate.a = 0.3
# 3D: Adjust GeometryInstance3D transparency
# transparency = 0.7
# Disable monitoring safely
set_deferred("monitoring", false)Reference
- Master Skill: godot-master
class_name InputSequenceWatcher
extends Node
## A node that listens for a specific sequence of input actions.
## Useful for cheat codes (Konami Command) or hidden input mechanics.
signal sequence_matched
## The target sequence of input actions (strings corresponding to InputMap actions).
@export var target_sequence: Array[String] = []
## Maximum time allowed between inputs before the buffer resets.
@export var timeout: float = 1.0
## If true, the buffer resets immediately after a successful match.
@export var reset_on_match: bool = true
var _current_buffer: Array[String] = []
var _timer: Timer
func _ready() -> void:
_timer = Timer.new()
_timer.one_shot = true
_timer.wait_time = timeout
_timer.timeout.connect(_reset_buffer)
add_child(_timer)
func _input(event: InputEvent) -> void:
if not event.is_pressed() or event.is_echo():
return
# Check all defined actions to see if one was just pressed
# We iterate the InputMap actions because event.as_text() is unreliable for logical mapping
var matched_action = ""
for action in InputMap.get_actions():
if event.is_action_pressed(action):
matched_action = action
break
if matched_action != "":
_process_input(matched_action)
func _process_input(action_name: String) -> void:
# Reset the timer on any valid input to keep the "combo" alive
_timer.start()
# Append to buffer
_current_buffer.append(action_name)
# Optimization: If the buffer is longer than the target, we can slice it
# providing a "rolling window" affect.
if _current_buffer.size() > target_sequence.size():
_current_buffer.pop_front()
if _current_buffer == target_sequence:
sequence_matched.emit()
if reset_on_match:
_reset_buffer()
func _reset_buffer() -> void:
_current_buffer.clear()
class_name InteractionThresholdTrigger
extends Node
## A component that tracks interactions and triggers a signal at a threshold.
## Useful for "Stop Poking Me" Easter eggs or breaking hidden walls.
signal threshold_reached
## The number of interactions required to trigger the event.
@export var target_interactions: int = 10
## If true, the counter resets to 0 after triggering, allowing repeat activations.
@export var repeat_trigger: bool = false
## Optional: How fast the interactions must happen (in seconds).
## If > 0, the counter resets if no interaction occurs within this time.
@export var reset_cooldown: float = 0.0
var _current_count: int = 0
var _timer: Timer
func _ready() -> void:
if reset_cooldown > 0:
_timer = Timer.new()
_timer.wait_time = reset_cooldown
_timer.one_shot = true
_timer.timeout.connect(_reset_count)
add_child(_timer)
## Call this function from your interaction system (e.g., area_2d.input_event)
func interact() -> void:
_current_count += 1
if _timer:
_timer.start() # Reset the cooldown timer
if _current_count >= target_interactions:
threshold_reached.emit()
if repeat_trigger:
_current_count = 0
else:
# If not repeating, we might want to disable further interactions or just clamp
# But for simplicity, we just stop emitting.
pass
func _reset_count() -> void:
_current_count = 0
class_name SecretAudioOccluder
extends Area3D
## Expert Secret Room Audio Occlusion.
## Modifies AudioBus effects (e.g. Muffle/Reverb) when entering secret areas.
@export var target_bus: String = "Master"
@export var effect_index: int = 0 # E.g. LowPassFilter
func _on_body_entered(body: Node) -> void:
if body.is_in_group("Player"):
AudioServer.set_bus_effect_enabled(AudioServer.get_bus_index(target_bus), effect_index, true)
func _on_body_exited(body: Node) -> void:
if body.is_in_group("Player"):
AudioServer.set_bus_effect_enabled(AudioServer.get_bus_index(target_bus), effect_index, false)
## Rule: Secret rooms should sound 'different' (e.g. vacuum-sealed or echoey) to enhance discovery.
class_name SecretInteractionSpamTracker
extends Node
## Expert Interaction Spam Tracker.
## Triggers events based on repetitive clicks or actions (e.g. NPC dialogue secrets).
signal secret_spam_triggered
@export var required_interactions: int = 50
@export var reset_on_exit: bool = true
var interaction_count: int = 0
func interact() -> void:
interaction_count += 1
if interaction_count >= required_interactions:
secret_spam_triggered.emit()
interaction_count = 0 # Optional reset
func reset() -> void:
if reset_on_exit:
interaction_count = 0
## Tip: Use 'Interaction Spam' for Easter Eggs that reward player persistence/curiosity.
class_name SecretKonamiLegacy
extends SecretSequenceComboMatcher
## Classic Konami Code Specialization.
## Example of extending the Sequence Matcher for the most famous cheat.
func _ready() -> void:
sequences = {
"Konami": ["ui_up", "ui_up", "ui_down", "ui_down", "ui_left", "ui_right", "ui_left", "ui_right", "ui_accept"]
}
combo_achieved.connect(_on_konami)
func _on_konami(combo_name: String) -> void:
if combo_name == "Konami":
SecretMetaPersistence.unlock_meta_secret("konami_legacy_achieved")
# Give 30 lives or enable debug mode...
## Rule: The Konami code is a 'Gamer Rite of Passage'—always include it in retro-styled projects.
class_name SecretLockoutCheatGuard
extends Node
## Expert Anti-Brute Force Guard.
## Prevents automated scripts from guessing cheat codes.
@export var max_failed_attempts: int = 3
@export var lockout_duration: float = 30.0
var failed_attempts: int = 0
var is_locked: bool = false
func register_failure() -> void:
failed_attempts += 1
if failed_attempts >= max_failed_attempts:
_start_lockout()
func _start_lockout() -> void:
is_locked = true
await get_tree().create_timer(lockout_duration).timeout
is_locked = false
failed_attempts = 0
## Rule: Always provide a subtle 'Denied' sound cue when a player is in lockout mode.
class_name SecretMetaPersistence
extends Node
## Expert Meta-Save Handler.
## Manages global unlocks (e.g., sound test, secret characters) across all save slots.
const META_PATH = "user://meta_secrets.cfg"
var meta_config: ConfigFile = ConfigFile.new()
func _ready() -> void:
if FileAccess.file_exists(META_PATH):
meta_config.load(META_PATH)
func unlock_meta_secret(secret_id: String) -> void:
meta_config.set_value("Ulocks", secret_id, true)
meta_config.save(META_PATH)
func is_unlocked(secret_id: String) -> bool:
return meta_config.get_value("Ulocks", secret_id, false)
## Rule: Separate Meta-Unlocks from Game-Saves so players don't lose 'Gallery' items when starting a New Game.
class_name SecretPersistenceHandler
extends Node
## A utility for saving/loading unlocked secrets to user://secrets.cfg.
## This ensures that Easter eggs or unlocked modes persist across game sessions.
## Designed to be an Autoload or a static helper.
const SAVE_PATH = "user://secrets.cfg"
const SECTION_NAME = "UnlockedSecrets"
static func unlock_secret(secret_id: String) -> void:
var config = ConfigFile.new()
var err = config.load(SAVE_PATH)
# If file doesn't exist, we'll create it. If error is OK or ERR_FILE_NOT_FOUND, proceed.
if err != OK and err != ERR_FILE_NOT_FOUND:
push_error("Failed to load secrets config: " + str(err))
return
config.set_value(SECTION_NAME, secret_id, true)
config.save(SAVE_PATH)
static func is_secret_unlocked(secret_id: String) -> bool:
var config = ConfigFile.new()
var err = config.load(SAVE_PATH)
if err != OK:
return false
return config.get_value(SECTION_NAME, secret_id, false)
static func clear_all_secrets() -> void:
var config = ConfigFile.new()
config.save(SAVE_PATH) # Overwrite with empty
class_name SecretProgressThresholdUnlocker
extends Node
## Expert Progress-Based Secret Trigger.
## Unlocks hidden content when game completion % reaches a threshold.
@export var required_completion_percent: float = 100.0
func check_unlock() -> bool:
var current_percent = GlobalStats.get_completion_percent()
if current_percent >= required_completion_percent:
_perform_unlock()
return true
return false
func _perform_unlock() -> void:
print("Secret True Ending Unlocked.")
## Tip: Use '100% Completion' triggers specifically for non-gameplay meta-content (e.g., concept art).
class_name SecretRandomEncounterSpawner
extends Node
## Expert Rare Encounter Spawner.
## Weighted random system for spawning 'Secret Vendors' or rare entities.
@export var rare_entity_scene: PackedScene
@export var spawn_chance: float = 0.01 # 1% chance
func attempt_spawn(spawn_parent: Node, spawn_pos: Vector3) -> void:
if randf() <= spawn_chance:
var instance = rare_entity_scene.instantiate()
spawn_parent.add_child(instance)
instance.global_position = spawn_pos
## Rule: Rare encounters should have a 'Pity' timer if they are required for achievements.
class_name SecretSequenceComboMatcher
extends Node
## Expert Time-Sensitive Combo Matcher.
## Handles complex input sequences with a decay timer to prevent brute-forcing.
signal combo_achieved(combo_name: String)
@export var sequences: Dictionary = {"Konami": ["ui_up", "ui_up", "ui_down", "ui_down", "ui_left", "ui_right", "ui_left", "ui_right"]}
@export var input_timeout: float = 0.5
var current_buffer: Array[String] = []
var last_input_time: float = 0.0
func _input(event: InputEvent) -> void:
if not event.is_pressed() or event.is_echo(): return
for action in InputMap.get_actions():
if event.is_action_pressed(action):
_add_to_buffer(action)
func _add_to_buffer(action: String) -> void:
var current_time = Time.get_ticks_msec() / 1000.0
if current_time - last_input_time > input_timeout:
current_buffer.clear()
current_buffer.append(action)
last_input_time = current_time
_check_matches()
func _check_matches() -> void:
for combo_name in sequences:
var target = sequences[combo_name]
if current_buffer == target:
combo_achieved.emit(combo_name)
current_buffer.clear()
## Rule: Always clear the buffer on a successful match to prevent double-procs.
class_name SecretDiscoveryGlimmer
extends Node3D
## Expert Discovery 'Glimmer' VFX.
## A subtle visual cue for hidden objects that only appears occasionally.
@export var glimmer_light: OmniLight3D
@export var glimmer_frequency: float = 10.0 # Seconds between glimmers
func _ready() -> void:
_glimmer_loop()
func _glimmer_loop() -> void:
while true:
await get_tree().create_timer(glimmer_frequency + randf_range(-2, 2)).timeout
var tween = create_tween()
tween.tween_property(glimmer_light, "light_energy", 2.0, 0.5)
tween.tween_property(glimmer_light, "light_energy", 0.0, 0.5)
## Tip: Use 'Random Offset' in frequencies to make glimmers feel more organic and less mechanical.
class_name SecretVisibilityDetector
extends Node3D
## Expert Dot-Product Hidden Wall Detection.
## Triggers a fade if the player is looking directly at a 'faked' wall.
@export var sensitivity: float = 0.95 # Higher = more direct look required
func _process(_delta: float) -> void:
var camera = get_viewport().get_camera_3d()
if not camera: return
var to_node = (global_position - camera.global_position).normalized()
var look_dot = camera.get_quaternion() * Vector3.FORWARD.dot(to_node)
if look_dot > sensitivity:
_on_player_looking()
func _on_player_looking() -> void:
# Trigger shader transition or visibility toggle
pass
## Tip: Use Dot Product instead of Raycasts for 'Look-at' triggers to reduce physics overhead.