---
name: godot-genre-stealth
description: "Expert blueprint for stealth games (Splinter Cell, Hitman, Dishonored, Thief) covering AI detection systems, vision cones, sound propagation, alert states, light/shadow mechanics, and systemic design. Use when building stealth-action, tactical infiltration, or immersive sim games requiring enemy awareness systems. Keywords vision cone, detection, alert state, sound propagation, light level, systemic AI, gradual detection."
title: godot-genre-stealth
canonical_url: https://skilld.dev/gh/thedivergentai/game-dev-agentic-skills/godot-genre-stealth
last_updated: 2026-09-29T08:11:16.000Z
---

> Index of every page on this site: [llms.txt](https://skilld.dev/llms.txt)

> **Skill from skilld.dev.** Follow the user's requested action.
> If the user asked to fork this Skill, follow the fork workflow below. Do not execute the Skill instructions while copying it.
> Otherwise, follow the instructions below for this session. You do not need to install anything.
>
> 21 supporting files sit beside this SKILL.md. When the Skill refers to one, fetch https://skilld.dev/api/skills-raw/thedivergentai/game-dev-agentic-skills/godot-genre-stealth/PATH with PATH replaced.
>
> If the user asked to install this Skill, run `npx skilld install thedivergentai/game-dev-agentic-skills/godot-genre-stealth`. Install writes the Skill files into the project, so every session loads them.
>
> ## Fork workflow
>
> A fork creates an editable local Skill with its original author and licence. The request authorizes copying and local installation.
> 1. Check `./skills/godot-genre-stealth`, the project lockfile, and selected Agent targets together. If the local directory or installed Skill exists, stop. Never overwrite an existing directory or Agent target.
> 2. Read [source metadata](https://skilld.dev/api/v1/skills/thedivergentai/game-dev-agentic-skills/godot-genre-stealth) once. Use sourceUrl, sourceCommit, skillPath, sourceGone, and license. If the source is gone or its path is missing, stop. If license is null, read licence files at the source commit.
> 3. Fetch only the source commit into a temporary Git repository. Do not clone full history. Derive repository_url from sourceUrl, including repository renames. If sourceCommit is absent, resolve the sourceUrl ref once. Set source_commit to that actual commit. Run these commands in one shell call:
>
> ```sh
> git init --quiet "$temporary_dir"
> git -C "$temporary_dir" fetch --quiet --depth=1 "$repository_url" "$source_commit"
> git -C "$temporary_dir" checkout --quiet --detach FETCH_HEAD
> ```
>
> Read applicable licence declarations and notices at that commit. If copying is not permitted, report the restriction and stop.
> 4. Inspect source entries together, then copy the directory containing skillPath into `./skills/godot-genre-stealth`. Use the user's path if selected. Keep the original SKILL.md, relative links, scripts, binary assets, and executable modes. Exclude .git metadata. Reject symlinks and paths outside the Skill directory. After checking entries, use cp -a where available. A regular source directory needs no custom copy script. Do not save this page wrapper as SKILL.md.
> Preserve author credit, notices, and applicable licence files from repository or parent directories. Add PROVENANCE.md with the Skill page, source URL, actual commit, original path, and licence. Retain any existing PROVENANCE.md and record new provenance separately. Batch source inspection, copying, and provenance work where practical.
> 5. In the project root, run `skilld install ./skills/godot-genre-stealth --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/godot-genre-stealth --mode copy --plain`. This known command needs no help lookup. Install does not support --json. Use detected Agent targets, or add --agent for the targets the user selected. Install the local path, never the upstream selector. If installation fails, preserve the local copy and report the exact failure.
> 6. Confirm the local lockfile source and installed Agent copies once. Report the local path, actual commit, and Agent targets. After edits, reinstall the same local path. Upstream updates must not replace it. Do not publish or push unless the user asks.

## NEVER Do (Expert Anti-Patterns)

### Detection & Awareness
- NEVER use binary "Seen/Not Seen" detection; strictly use a **Gradual Detection Meter** (0-100%) that builds based on distance, light level, and speed.
- NEVER use standard `RayCast3D` nodes for massive amounts of vision checks; strictly use **`PhysicsDirectSpaceState3D.intersect_ray()`** to query the PhysicsServer instantly and nodelessly.
- NEVER allow AI to see through solid geometry; strictly use raycasts between AI eyes and player sample points (Head/Torso/Feet).
- NEVER use a single sample point for visibility; strictly sample **at least 3 points** (Head, Torso, Feet) to prevent detection bugs when partially in cover.
- NEVER use static "Guard Paths"; strictly implement **Dynamic Investigating** where guards leave their route to check on suspicious sounds/activities.
- NEVER trigger "Detection" immediately upon line-of-sight; strictly use a **Detection Meter** with a decay rate to provide a "forgiveness window" for the player to recover.
- NEVER assume a random navmesh point is safe; strictly verify cover points by **Raycasting toward the Threat** to ensure geometry successfully breaks the line of sight.
- NEVER forget to pass the guard's own **RID** into the raycast exclude array; if omitted, the ray will hit the guard's own body, causing false blocking.
- NEVER run complex AI detection for off-screen guards; strictly use `VisibleOnScreenNotifier3D` to pause heavy logic for distant enemies.

### Systemic & World Logic
- NEVER use a simple `distance_to()` check for hearing; strictly calculate sound travel along the **Navigation Path** to determine if a wall blocks noise.
- NEVER make combat as viable as stealth; strictly ensure "going loud" triggers intense reinforcements or high-lethality states to preserve the stealth loop.
- NEVER hide the "Why" of detection; strictly provide immediate feedback via **UI icons (?, !)** or audio barks ("What was that?").
- NEVER ignore the return value of `intersect_ray()`; strictly check `is_empty()` first to prevent runtime crashes.
- NEVER assume a raycast won't hit the guard itself; strictly **exclude the guard's RID** from Query Parameters.

### Optimization & Performance
- NEVER tightly couple AI to player scripts; strictly use **duck-typing** (e.g., `if body.has_method("get_detected")`) so guards can spot decoys or dead bodies without brittle dependencies.
- NEVER maintain hardcoded arrays to trigger base-wide alarms; strictly add guards to a **"guards" group** and use `get_tree().call_group()` for dynamic notification.
- NEVER use standard Strings for AI state; strictly use `StringName` (&"alert") for O(1) pointer-level comparisons in high-frequency loops.
- NEVER bake massive NavigationMeshes synchronously; strictly use `use_async_iterations` to prevent main thread stalls during runtime bakes.
- NEVER rely on `Node.find_child()` during gameplay; strictly use **Groups** or exported references for O(1) player tracking.
- NEVER leave CollisionShapes enabled on incapacitated bodies; strictly disable them or move them to a "corpse" layer to prevent pathing interference.

---

## 🛠 Expert Components (scripts/)

> **MANDATORY reads** before implementing the matching system:
> 1. [stealth_patterns.gd](https://skilld.dev/api/skills-raw/thedivergentai/game-dev-agentic-skills/godot-genre-stealth/scripts/stealth_patterns.gd) — space-state LoS, cone DOT, hearing helpers
> 2. [stealth_ai_controller.gd](https://skilld.dev/api/skills-raw/thedivergentai/game-dev-agentic-skills/godot-genre-stealth/scripts/stealth_ai_controller.gd) — multi-sample rays + RID exclude + path-length hearing
> 3. [stealth_vision_cone.gd](https://skilld.dev/api/skills-raw/thedivergentai/game-dev-agentic-skills/godot-genre-stealth/scripts/stealth_vision_cone.gd) / [vision_cone_3d.gd](https://skilld.dev/api/skills-raw/thedivergentai/game-dev-agentic-skills/godot-genre-stealth/scripts/vision_cone_3d.gd) — cone authorship

### Original Expert Patterns
- [stealth_patterns.gd](https://skilld.dev/api/skills-raw/thedivergentai/game-dev-agentic-skills/godot-genre-stealth/scripts/stealth_patterns.gd) - Nodeless LoS, cone tests, AI_Audible bus, async investigate.
- [stealth_ai_controller.gd](https://skilld.dev/api/skills-raw/thedivergentai/game-dev-agentic-skills/godot-genre-stealth/scripts/stealth_ai_controller.gd) - Alert meter AI using PhysicsDirectSpaceState (not RayCast3D nodes).

### Modular Components
- [stealth_vision_cone.gd](https://skilld.dev/api/skills-raw/thedivergentai/game-dev-agentic-skills/godot-genre-stealth/scripts/stealth_vision_cone.gd) - 2D/logic cone helpers.
- [vision_cone_3d.gd](https://skilld.dev/api/skills-raw/thedivergentai/game-dev-agentic-skills/godot-genre-stealth/scripts/vision_cone_3d.gd) - 3D cone debug / query helpers.
- [visibility_manager.gd](https://skilld.dev/api/skills-raw/thedivergentai/game-dev-agentic-skills/godot-genre-stealth/scripts/visibility_manager.gd) - Player exposure / light gem aggregation.
- [light_detector.gd](https://skilld.dev/api/skills-raw/thedivergentai/game-dev-agentic-skills/godot-genre-stealth/scripts/light_detector.gd) - Light probe / overlap exposure.
- [sound_occlusion_manager.gd](https://skilld.dev/api/skills-raw/thedivergentai/game-dev-agentic-skills/godot-genre-stealth/scripts/sound_occlusion_manager.gd) - Occlusion / bus routing for AI hearing.

---

## Core Loop
1. **Hide / move** → 2. **Vision & light exposure** → 3. **Sound propagation** → 4. **Alert escalation** → 5. **Investigate / escape**

## Decision Trees

### Perception
| Need | Action |
|------|--------|
| LoS + exclude self/player RIDs | **MANDATORY** [stealth_ai_controller.gd](https://skilld.dev/api/skills-raw/thedivergentai/game-dev-agentic-skills/godot-genre-stealth/scripts/stealth_ai_controller.gd) + [stealth_patterns.gd](https://skilld.dev/api/skills-raw/thedivergentai/game-dev-agentic-skills/godot-genre-stealth/scripts/stealth_patterns.gd) |
| Light-scaled detection | [visibility_manager.gd](https://skilld.dev/api/skills-raw/thedivergentai/game-dev-agentic-skills/godot-genre-stealth/scripts/visibility_manager.gd) / [light_detector.gd](https://skilld.dev/api/skills-raw/thedivergentai/game-dev-agentic-skills/godot-genre-stealth/scripts/light_detector.gd) |
| Hearing through geometry | Path-length via NavigationServer (controller) + [sound_occlusion_manager.gd](https://skilld.dev/api/skills-raw/thedivergentai/game-dev-agentic-skills/godot-genre-stealth/scripts/sound_occlusion_manager.gd) |

### When to load modules
| Task | Load |
|------|------|
| Guard AI spine | patterns + ai_controller |
| Author cones | vision_cone scripts |
| Player light gem | visibility + light_detector |
| Loud world props | sound_occlusion_manager |

Do **not** paste long vision/alert/ability tutorials into the skill body — keep decision trees here and implement from scripts.

## Skill Chain

| Phase | Skills | Purpose |
|-------|--------|---------|
| 1. Physics | `godot-raycasting-queries` | Space-state LoS |
| 2. Nav | `godot-navigation-pathfinding` | Investigate / path hearing |
| 3. AI | `godot-state-machine-advanced` | IDLE→ALERT FSM |
| 4. Audio | `godot-audio-systems` | AI_Audible buses |
| 5. Balance | `godot-monte-carlo-balancer` | Detection thresholds |

## Common Pitfalls

| Pitfall | Solution |
|---------|----------|
| RayCast3D per guard | Multi-sample `intersect_ray` + RID exclude |
| `distance_to` hearing | Navigation path length |
| Off-screen CPU | `VisibleOnScreenNotifier` suspend |

## Deep recipes (on demand)

| Topic | Reference / script |
|-------|-------------------|
| Design pillars | [design-principles.md](https://skilld.dev/api/skills-raw/thedivergentai/game-dev-agentic-skills/godot-genre-stealth/references/design-principles.md) |
| Vision / sound / light | [ai-detection-system.md](https://skilld.dev/api/skills-raw/thedivergentai/game-dev-agentic-skills/godot-genre-stealth/references/ai-detection-system.md) + [stealth_ai_controller.gd](https://skilld.dev/api/skills-raw/thedivergentai/game-dev-agentic-skills/godot-genre-stealth/scripts/stealth_ai_controller.gd) |
| Alert FSM & UI feedback | [alert-states.md](https://skilld.dev/api/skills-raw/thedivergentai/game-dev-agentic-skills/godot-genre-stealth/references/alert-states.md) + [visibility_manager.gd](https://skilld.dev/api/skills-raw/thedivergentai/game-dev-agentic-skills/godot-genre-stealth/scripts/visibility_manager.gd) |
| Player tools (lean, gadgets) | [player-abilities.md](https://skilld.dev/api/skills-raw/thedivergentai/game-dev-agentic-skills/godot-genre-stealth/references/player-abilities.md) |
| Cover & encounter layout | [level-design.md](https://skilld.dev/api/skills-raw/thedivergentai/game-dev-agentic-skills/godot-genre-stealth/references/level-design.md) |
| UI communication | [ui-communication.md](https://skilld.dev/api/skills-raw/thedivergentai/game-dev-agentic-skills/godot-genre-stealth/references/ui-communication.md) |

## 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
- [Ray-casting](https://docs.godotengine.org/en/stable/tutorials/physics/ray-casting.html) — Node casts vs PhysicsDirectSpaceState3D.intersect_ray() for many AI LoS checks without RayCast3D spam.
- [Physics introduction](https://docs.godotengine.org/en/stable/tutorials/physics/physics_introduction.html) — collision layers/masks that filter vision rays, hearing spheres, and corpse layers.
- [PhysicsDirectSpaceState3D](https://docs.godotengine.org/en/stable/classes/class_physicsdirectspacestate3d.html) — nodeless intersect_ray / intersect_shape contracts for composite vision and cover verification.
- [PhysicsRayQueryParameters3D](https://docs.godotengine.org/en/stable/classes/class_physicsrayqueryparameters3d.html) — mask, exclude RIDs, and collide flags so guards never self-block LoS queries.
- [Lights and shadows](https://docs.godotengine.org/en/stable/tutorials/3d/lights_and_shadows.html) — Omni/Spot energy and shadows that drive light-gem exposure and shadow-layer hiding.
- [Audio buses](https://docs.godotengine.org/en/stable/tutorials/audio/audio_buses.html) — dedicated AI-audible buses so loud footsteps/impacts route into hearing systems.
- [Navigation introduction (3D)](https://docs.godotengine.org/en/stable/tutorials/navigation/navigation_introduction_3d.html) — regions, agents, and async bake for patrols and investigate paths.
- [Using navigation paths](https://docs.godotengine.org/en/stable/tutorials/navigation/navigation_using_navigationpaths.html) — path length as wall-aware sound travel instead of raw distance_to().
- [NavigationServer3D](https://docs.godotengine.org/en/stable/classes/class_navigationserver3d.html) — map_get_path, random cover points, and avoidance masks for investigating guards.
- [Groups](https://docs.godotengine.org/en/stable/tutorials/scripting/groups.html) — guards / player / lights groups and call_group for base-wide alarms without hardcoded arrays.
- [VisibleOnScreenNotifier3D](https://docs.godotengine.org/en/stable/classes/class_visibleonscreennotifier3d.html) — pause heavy detection when off-screen so distant AI do not burn the physics budget.
- [Screen-reading shaders](https://docs.godotengine.org/en/stable/tutorials/shaders/screen-reading_shaders.html) — hint_screen_texture vision-cone feedback overlays (not Godot 3 SCREEN_TEXTURE).

### Related Skills

#### Prerequisites
- [godot-project-foundations](https://github.com/thedivergentai/gd-agentic-skills/blob/main/skills/godot-project-foundations/SKILL.md) — scene tree, groups, and import/project setup before wiring guards, lights, and player sample points.
- [godot-physics-3d](https://github.com/thedivergentai/gd-agentic-skills/blob/main/skills/godot-physics-3d/SKILL.md) — CharacterBody3D, layers/masks, and collision shapes that vision rays and hearing volumes must hit honestly.
- [godot-raycasting-queries](https://github.com/thedivergentai/gd-agentic-skills/blob/main/skills/godot-raycasting-queries/SKILL.md) — PhysicsServer query parameters, RID excludes, and multi-sample LoS recipes this genre depends on every frame.

#### Complements
- [godot-navigation-pathfinding](https://github.com/thedivergentai/gd-agentic-skills/blob/main/skills/godot-navigation-pathfinding/SKILL.md) — NavigationAgent patrols, investigate targets, and path-length hearing that respects walls.
- [godot-ai-navigation](https://github.com/thedivergentai/gd-agentic-skills/blob/main/skills/godot-ai-navigation/SKILL.md) — FOV sensors and perception stacks that feed suspicion/alert state machines.
- [godot-audio-systems](https://github.com/thedivergentai/gd-agentic-skills/blob/main/skills/godot-audio-systems/SKILL.md) — 3D streams and bus layouts for AI-audible noise without coupling to player SFX buses.
- [godot-3d-lighting](https://github.com/thedivergentai/gd-agentic-skills/blob/main/skills/godot-3d-lighting/SKILL.md) — light energy, shadows, and probe setups that make light-level detection fair and readable.
- [godot-state-machine-advanced](https://github.com/thedivergentai/gd-agentic-skills/blob/main/skills/godot-state-machine-advanced/SKILL.md) — StringName IDLE/SUSPICIOUS/ALERTED/COMBAT machines instead of ad-hoc string compares.
- [godot-signal-architecture](https://github.com/thedivergentai/gd-agentic-skills/blob/main/skills/godot-signal-architecture/SKILL.md) — alert_state_changed and detection-meter signals that keep UI, barks, and AI decoupled.
- [godot-shaders-basics](https://github.com/thedivergentai/gd-agentic-skills/blob/main/skills/godot-shaders-basics/SKILL.md) — screen-space cone tint and outline feedback so players always see why they were spotted.
- [godot-camera-systems](https://github.com/thedivergentai/gd-agentic-skills/blob/main/skills/godot-camera-systems/SKILL.md) — lean/peek and frustum-driven VisibleOnScreenNotifier suspend for off-screen guard budgets.
- [godot-monte-carlo-balancer](https://github.com/thedivergentai/gd-agentic-skills/blob/main/skills/godot-monte-carlo-balancer/SKILL.md) — simulate detection rates, FOV ranges, hearing falloff, and forgiveness windows before shipping difficulty.

#### Downstream / consumers
- [godot-genre-horror](https://github.com/thedivergentai/gd-agentic-skills/blob/main/skills/godot-genre-horror/SKILL.md) — stalker cones, hiding spots, and suspicion meters that reuse sensory AI patterns.
- [godot-combat-system](https://github.com/thedivergentai/gd-agentic-skills/blob/main/skills/godot-combat-system/SKILL.md) — lethal escalation and takedown windows once ALERTED/COMBAT breaks the stealth loop.

#### Master
- [godot-master](https://github.com/thedivergentai/gd-agentic-skills/blob/main/skills/godot-master/SKILL.md) — library router and mirrored module entry for cross-skill discovery.
