Godot genre metroidvania

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

Godot genre metroidvania is an AI agent skill from the GitHub repository thedivergentai/GD-Agentic-Skills. Expert blueprint for Metroidvanias including ability-gated exploration (locks/keys), interconnected world design (backtracking with shortcuts), persistent state tracking (collectibles, boss defeats), room transitions (seamless loading), map systems (grid-based revelation), and ability versatility (c

How to use this skill

Skill file

NEVER Do (Expert Anti-Patterns)

World Design & Exploration

Persistence & Mapping

Physics & Controls


🛠 Expert Components (scripts/)

Golden-path order (MANDATORY reads)

  1. Persistence / flags — metroid_game_state.gd + persistent_progression_system.gd
  2. Ability definitions / gates — ability_unlock_resource.gd + progression_gate_manager.gd
  3. Room stream / switch — background_room_streamer.gd + safe_scene_switcher.gd
  4. Map fog — minimap_fog_manager.gd (orchestrator) with minimap_fog.gd / minimap_fog_revealer.gd

Original Expert Patterns

Modular Components


Core Loop

  1. Exploration → blocked by a lock
  2. Discovery → key ability / boss
  3. Acquisition → new traversal/combat tool
  4. Backtracking → shortcuts + dual-use abilities
  5. Progression → new biome opens

Skill Chain

| Phase | Skills | Purpose |

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

| 1. Character | godot-characterbody-2d, godot-state-machine-advanced | Tight movement + ability states |

| 2. World | godot-tilemap-mastery, godot-scene-management | Rooms, biomes, threaded transitions |

| 3. Systems | godot-save-load-systems, godot-ability-system | Persist gates/collectibles; unlock keys |

| 4. UI | godot-ui-containers, godot-inventory-system | Map / inventory / HUD |

| 5. Balance | godot-monte-carlo-balancer | Soft-lock risk, backtrack length |


Architecture (script-first — no inline recipes)

1. Game State & Persistence

MANDATORY: metroid_game_state.gd + persistent_progression_system.gd. Rooms never own global ability flags. Room metadata uses resource_local_to_scene so instanced rooms do not share collectible state.

2. Room Transitions & Fast Travel

MANDATORY: background_room_streamer.gd + safe_scene_switcher.gd.

Fast travel must match NEVER (threaded load + deferred swap) — never ResourceLoader.load() / sync change_scene:

class_name FastTravelSystem extends Node

var _pending_path: String = ""
var _spawn_id: StringName = &""

func travel_to_room(scene_path: String, spawn_id: StringName) -> void:
    _pending_path = scene_path
    _spawn_id = spawn_id
    var err := ResourceLoader.load_threaded_request(scene_path)
    if err != OK:
        push_error("Fast travel request failed: %s" % scene_path)
        return
    set_process(true)

func _process(_delta: float) -> void:
    var status := ResourceLoader.load_threaded_get_status(_pending_path)
    if status == ResourceLoader.THREAD_LOAD_IN_PROGRESS:
        return
    set_process(false)
    if status != ResourceLoader.THREAD_LOAD_LOADED:
        push_error("Fast travel load failed: %s" % _pending_path)
        return
    var packed := ResourceLoader.load_threaded_get(_pending_path) as PackedScene
    # SceneTree work must be deferred — never from a worker thread
    call_deferred("_swap_room", packed, _spawn_id)

func _swap_room(packed: PackedScene, spawn_id: StringName) -> void:
    GlobalState.target_spawn_id = spawn_id
    get_tree().change_scene_to_packed(packed)

3. Ability Gating

MANDATORY: ability_unlock_resource.gd + progression_gate_manager.gd + ability_state_machine.gd. Gates query StringName abilities from the Autoload — do not hardcode ability strings in room scripts.

4. Map / Fog

MANDATORY: minimap_fog_manager.gd. Use Vector2i cells only.


Design Principles (from Dreamnoid)

Common Pitfalls

  1. Softlocks on one-way valves — always design an escape with current abilities
  2. Backtracking tedium — shortcuts + faster movement after unlocks
  3. Empty dead ends — every remote path needs a reward
  4. Sync room loads — violates NEVER; use threaded request + deferred swap

Expert knowledge (on demand)

LLM-ignorance rule: If a general agent would not know it before reading, load the reference — never delete expert deltas.

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.