
Godot Mechanic Revival
- 129 installs
- 454 repo stars
- Updated July 28, 2026
- thedivergentai/gd-agentic-skills
Use godot-mechanic-revival for development tasks
About
godot-mechanic-revival: A skill for development. This provides functionality for development workflows.
- godot-mechanic-revival
Godot Mechanic Revival by the numbers
- 129 all-time installs (skills.sh)
- +8 installs in the week ending Jul 27, 2026 (Skillselion tracking)
- Ranked #2,731 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-revivalAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 129 |
|---|---|
| repo stars | ★ 454 |
| Last updated | July 28, 2026 |
| Repository | thedivergentai/gd-agentic-skills ↗ |
What it does
Use godot-mechanic-revival for development tasks
Files
Revival & Resurrection Mechanics
Overview
This skill provides a robust framework for handling player mortality and return. It moves beyond simple "Game Over" screens to integrated risk/reward systems like those found in Sekiro, Hades, or Dark Souls.
NEVER Do (Expert Revival Rules)
Lifecycle & State
- NEVER respawn the player with existing velocity — Always zero out
velocityandangular_velocityinrevival_state_reset_guard.gdor the player will fly into a wall upon respawning. - NEVER trust the nearest checkpoint by distance — Always use a 'Progress Index' (
revival_checkpoint_validator.gd). Players in non-linear games may wander back to the start area; don't downgrade their respawn point. - NEVER skip 'Invincibility Frames' (I-frames) — Respawning inside a hazard or near an enemy without a 2s invincibility buffer leads to "Death Loops" and player frustration.
Persistence & Data
- NEVER save checkpoints solely in RAM — If the game crashes, the player loses progress. Use
revival_checkpoint_persistence.gdto write touser://immediately. - NEVER hardcode checkpoint coordinates — Use
Marker3DorArea3Dnodes in the scene. Hardcoded coords break as soon as level geometry changes. - NEVER delete the player node on death —
queue_free()ing the player breaks UI refs and references from enemies. Disable processing, hide the mesh, and 'Revive' the existing instance instead.
UX & Pacing
- NEVER respawn instantly — An instant snap is disorienting. Always use a 1-2s delay with a screen fade or death animation to allow the player to process the failure.
- NEVER reset the entire world on player death — In modern design, opened doors and collected unique items should stay persisted. Use a bitmask in the checkpoint resource to track 'World Progress'.
---
Available Scripts
MANDATORY: Read the appropriate script before implementing the corresponding pattern.
revival_global_manager.gd
Expert singleton for managing the global respawn loop and death transitions.
revival_checkpoint_persistence.gd
Resource-based system for saving last checkpoint and world state to disk.
revival_health_restitution.gd
Professional I-frame and health replenishment logic for post-revive stability.
revival_soul_grave.gd
Expert 'Soul Retrieval' mechanic for spawning graves at death coordinates.
revival_checkpoint_validator.gd
Progress-aware validator that prevents backtracking from overwriting newer checkpoints.
revival_death_timer.gd
Professional respawn delay manager with UI and animation hooks.
revival_ghost_mode.gd
Expert 'Spirit World' transition logic involving collision layer swapping.
revival_state_reset_guard.gd
Essential utility for purging velocity and state locks upon player respawn.
revival_checkpoint_visuals.gd
Material-swapping logic for providing clear 'Active' feedback to players.
revival_auto_save_manager.gd
Automatic save-trigger logic for ensuring checkpoint persistence.
revival_spectral_shader.gdshader
Translucent, glowing "ghost" effect for downed players.
revival_async_restorer.gd
Smooth stat restoration logic using Tweens for organic recovery.
revival_death_analytics.gd
Persistent logging of death telemetry (cause, location, time) for balancing.
---
Expert Revival Patterns
1. Spectral Visual Feedback
Don't just hide the player. Use a Spectral Shader to communicate the "Downed" state.
- Implementation: Apply a
ShaderMaterialwith additive blending and a pulsingALPHAto the player mesh. - Juice: Combine with a grayscale
ColorRectpost-process effect to sell the "Spirit Realm" transition.
2. Death Analytics Ledger
Use Death Analytics to find "Difficulty Spikes".
- Tracking: Log
global_positionandcause_of_deathto a JSON file. - Optimization: Export these logs to a heatmap tool to identify areas where players are struggling.
Reference
- Master Skill: godot-master
class_name ConsequenceTracker
extends Node
## Tracks cumulative deaths and modifies game state accordingly.
## Useful for dynamic difficulty (God Hand style) or narrative penalties (Dragonrot).
signal difficulty_changed(new_level: int)
@export var death_count: int = 0
@export var revive_count: int = 0
# Configurable thresholds for consequences
@export var difficulty_increase_threshold: int = 5
func record_death() -> void:
death_count += 1
_check_consequences()
func record_revive() -> void:
revive_count += 1
# Maybe reviving REDUCES the death penalty?
# Or maybe it costs more meta-currency.
func _check_consequences() -> void:
# Example: Every 5 deaths, increase world difficulty (or decrease for mercy)
if death_count % difficulty_increase_threshold == 0:
var difficulty_level = int(death_count / difficulty_increase_threshold)
difficulty_changed.emit(difficulty_level)
print("World Tendency Shifted: Custom Difficulty Level " + str(difficulty_level))
class_name CorpseRunDropper
extends Node
## Spawns a physical object ("Grave") at the death location containing % of lost currency.
## Designed for Souls-like games.
@export var grave_scene: PackedScene
@export var currency_loss_percentage: float = 1.0 # 1.0 = 100% loss
# Connect this to your player's death signal manually or via signal bus.
func on_player_death(player_position: Vector3, current_currency: int) -> int:
if not grave_scene:
push_warning("CorpseRunDropper: No grave_scene assigned.")
return current_currency # Return without modifying
var lost_amount = int(current_currency * currency_loss_percentage)
var remaining = current_currency - lost_amount
_spawn_grave(player_position, lost_amount)
return remaining
func _spawn_grave(pos: Vector3, amount: int) -> void:
if amount <= 0:
return
var grave = grave_scene.instantiate()
# Safety Check: Ensure the scene actually supports our "Grave" protocol
if not grave.has_method("setup"):
push_error("CorpseRunDropper: Grave scene '%s' does not have a 'setup(amount)' method!" % grave_scene.resource_path)
grave.queue_free()
return
# Add to main scene root so it persists after player respawn (if player is reloaded)
# Usually, levels persist, so this is fine.
get_tree().current_scene.add_child(grave)
grave.global_position = pos
grave.setup(amount)
class_name RevivalAsyncRestorer
extends Node
## Expert Asynchronous Restoration logic.
## Smoothly refills actor stats (Health, Mana, Energy) over time using Tweens.
@export var restoration_duration: float = 3.0
## Begins a smooth restoration of a specific property.
func restore_property(target: Node, property: String, target_value: float) -> void:
if not target or not property in target:
return
var tween = create_tween().bind_node(self)
# Organic S-curve restoration
tween.set_trans(Tween.TRANS_SINE)
tween.set_ease(Tween.EASE_IN_OUT)
tween.tween_property(target, property, target_value, restoration_duration)
## Convenience for full health/mana recovery
func full_revive(actor: Node, max_hp: float, max_mp: float) -> void:
restore_property(actor, "health", max_hp)
restore_property(actor, "mana", max_mp)
class_name RevivalAutoSaveManager
extends Node
## Expert Auto-Save Bridge.
## Triggers the global Save System when a new checkpoint is reached.
func _on_checkpoint_activated() -> void:
if has_node("/root/SaveManager"):
get_node("/root/SaveManager").save_game()
print("Checkpoint Auto-Saved.")
## Rule: In modern ARPGs/Platformers, checkpoints should ALWAYS trigger an auto-save.
class_name RevivalCheckpointPersistence
extends Resource
## Expert Checkpoint Persistence Resource.
## Stores the last activated checkpoint and associated world state.
@export var last_checkpoint_id: String = ""
@export var checkpoint_pos: Vector3 = Vector3.ZERO
@export var triggered_events: Array[String] = []
func save_state() -> void:
ResourceSaver.save(self, "user://checkpoint_data.res")
static func load_state() -> RevivalCheckpointPersistence:
if ResourceLoader.exists("user://checkpoint_data.res"):
return ResourceLoader.load("user://checkpoint_data.res")
return RevivalCheckpointPersistence.new()
## Tip: Resource-based saving is faster and more type-safe for checkpoint data than JSON.
class_name RevivalCheckpointValidator
extends Area3D
## Expert Checkpoint Validator.
## Ensures players can't downgrade their progress index.
@export var checkpoint_id: String = ""
@export var progress_index: int = 0
func _on_area_entered(area: Area3D) -> void:
if area.is_in_group("Player"):
var current_progress = RevivalGlobalManager.get_progress()
if progress_index >= current_progress:
RevivalGlobalManager.set_active_checkpoint(global_position, checkpoint_id, progress_index)
## Rule: Always use a 'Progress Index' to prevent backtracking from overriding endgame checkpoints.
class_name RevivalCheckpointVisuals
extends Node3D
## Expert Checkpoint Visual Feedback.
## Displays 'Active' vs 'Inactive' states using Emissive materials.
@export var active_material: StandardMaterial3D
@export var inactive_material: StandardMaterial3D
@onready var mesh: MeshInstance3D = $MeshInstance3D
func set_active(is_active: bool) -> void:
mesh.material_override = active_material if is_active else inactive_material
## Tip: Use a 'WorldEnvironment' glow to make active checkpoints highly visible.
class_name RevivalDeathAnalytics
extends Node
## Bridge for logging death events to a local JSON file.
## Essential for difficulty balancing and heatmap generation.
const LOG_PATH = "user://death_analytics.json"
## Logs a death event with context.
static func log_death(peer_id: int, position: Vector3, cause: String) -> void:
var time = Time.get_datetime_dict_from_system()
var timestamp = "%04d-%02d-%02d %02d:%02d:%02d" % [
time.year, time.month, time.day,
time.hour, time.minute, time.second
]
var entry = {
"timestamp": timestamp,
"peer_id": peer_id,
"x": snappedf(position.x, 0.01),
"y": snappedf(position.y, 0.01),
"z": snappedf(position.z, 0.01),
"cause": cause
}
var file = FileAccess.open(LOG_PATH, FileAccess.READ_WRITE)
if not file:
file = FileAccess.open(LOG_PATH, FileAccess.WRITE)
if file:
file.seek_end()
file.store_line(JSON.stringify(entry))
file.close()
class_name RevivalDeathTimer
extends Timer
## Expert Respawn Timer.
## Manages transition duration and UI callbacks for game-over screens.
@export var respawn_time: float = 3.0
func start_death_timer() -> void:
wait_time = respawn_time
one_shot = true
start()
# Trigger UI 'YOU DIED' here
timeout.connect(_on_timeout)
func _on_timeout() -> void:
RevivalGlobalManager.trigger_death()
## Tip: Use 'one_shot' timers for death logic to avoid recursive respawns if dying during the timer.
class_name RevivalGhostMode
extends Node
## Expert Ghost/Spirit Mode logic.
## Swaps collision masks and modulates visuals upon death.
func enter_ghost_mode(player: CharacterBody3D) -> void:
# Disable 'standard' collision, enable 'ghost' layer (e.g. Layer 5)
player.collision_layer = 1 << 4
player.collision_mask = 1 << 0 | 1 << 4 # Walls + Ghosts only
player.modulate.a = 0.5 # Transparency
# Trigger 'Spirit World' shader here...
## Rule: Ghost mode requires a 'Revival Shrine' interaction to return to the living state.
class_name RevivalGlobalManager
extends Node
## Expert Global Respawn Manager.
## Handles player death, screen transitions, and state restitution.
signal player_died
signal player_respawned
var active_checkpoint_pos: Vector3 = Vector3.ZERO
var respawn_delay: float = 2.0
func trigger_death() -> void:
player_died.emit()
await get_tree().create_timer(respawn_delay).timeout
_perform_respawn()
func _perform_respawn() -> void:
var player = get_tree().get_first_node_in_group("Player")
if player:
player.global_position = active_checkpoint_pos
# Reset state (health, velocity, etc.)
if player.has_method("revive"):
player.revive()
player_respawned.emit()
## Rule: Singletons should manage 'Player' lifecycle to decouple UI/World from player existence.
class_name RevivalHealthRestitution
extends Node
## Expert Health Restitution Logic.
## Handles 'Revive' item effects with temporary invincibility.
@export var i_frame_duration: float = 2.0
func apply_revive(target: Node) -> void:
if target.has_method("set_invincible"):
target.set_invincible(true)
# Visual Feedback: Pulsing opacity
var tween = target.create_tween().set_loops(4)
tween.tween_property(target, "modulate:a", 0.2, 0.25)
tween.tween_property(target, "modulate:a", 1.0, 0.25)
await target.get_tree().create_timer(i_frame_duration).timeout
target.set_invincible(false)
## Rule: Invincibility frames (I-frames) are mandatory after revival to prevent 'Death Loops'.
class_name RevivalManager
extends Node
## Manages the player's ability to resurrect after reaching 0 Health.
## Can be configured for "Lives" (Classic) or "Charges" (Sekiro-like).
signal revival_available
signal revival_consumed(charges_remaining: int)
signal true_death
@export var max_charges: int = 1
@export var starting_charges: int = 1
@export var recharge_on_checkpoint: bool = true
var current_charges: int = 0
func _ready() -> void:
current_charges = starting_charges
func can_revive() -> bool:
return current_charges > 0
## Call this when the player "dies". Returns true if revival logic started.
## If false, the player is truly dead (Game Over).
func attempt_revive() -> bool:
if current_charges > 0:
revival_available.emit()
# Logic usually pauses here to wait for UI input (Accept/Die)
# For this skill, we provide the consume method to be called by UI.
return true
true_death.emit()
return false
## Call this when the player confirms they want to use a charge.
func consume_charge() -> void:
if current_charges > 0:
current_charges -= 1
revival_consumed.emit(current_charges)
# Trigger actual resurrection logic (Health restore, I-frames) elsewhere.
func recharge(amount: int = 1) -> void:
current_charges = min(current_charges + amount, max_charges)
func full_restore() -> void:
current_charges = max_charges
class_name RevivalSoulGrave
extends Node3D
## Expert Soul Retrieval (Dark Souls style).
## Persistence object left at death site containing lost resources.
var lost_currency: int = 0
func _on_body_entered(body: Node) -> void:
if body.is_in_group("Player"):
if body.has_method("add_currency"):
body.add_currency(lost_currency)
queue_free()
## Rule: Ensure graves are spawned slightly above the ground offset to avoid physics clipping.
shader_type spatial;
render_mode blend_mix, depth_draw_opaque, cull_disabled;
## Expert Spectral Shader for downed/ghostly players.
## Simulates a translucent, glowing soul effect.
uniform vec4 ghost_color : source_color = vec4(0.4, 0.8, 1.0, 0.4);
uniform float glow_intensity : hint_range(0.0, 5.0) = 2.0;
uniform float wave_speed : hint_range(0.0, 10.0) = 1.0;
void fragment() {
// Simple sine wave for "pulsing" soul effect
float pulse = (sin(TIME * wave_speed) + 1.0) * 0.5;
ALBEDO = ghost_color.rgb;
ALPHA = ghost_color.a * (0.5 + pulse * 0.5);
// Add emissive glow
EMISSION = ghost_color.rgb * glow_intensity;
}
class_name RevivalStateResetGuard
extends Node
## Expert Physics & State Reset Guard.
## Essential for preventing the 'Post-Respawn Jitter' or death momentum.
func clean_player_state(player: CharacterBody3D) -> void:
player.velocity = Vector3.ZERO
# Clear impulse buffers or state machine locks
if player.has_node("StateMachine"):
player.get_node("StateMachine").transition_to("Idle")
## Rule: Always zero out velocity on respawn. Failing to do so can cause 'momentum physics' crashes.