godot-game-loop-harvest

Implements data-driven resource harvesting loops with tool tiers, respawn persistence, and offline progress in Godot 4.

Updated Aug 22, 2026
One-click install
npx skills add https://github.com/DecioLuvier/Shatterless --skill godot-game-loop-harvest-decioluvier
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: godot-game-loop-harvest
Source: https://github.com/DecioLuvier/Shatterless/tree/main/.claude/skills/godot/references/godot-game-loop-harvest
Command: npx skills add https://github.com/DecioLuvier/Shatterless --skill godot-game-loop-harvest-decioluvier

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? Building a resource gathering loop (mining, logging, foraging) in Godot 4 involves many subtle pitfalls: framerate-dependent gather rates, broken offline progress math, mutated shared Resources, and lost world state on reload. This Skill provides a complete, data-driven architecture for harvestable nodes, tool validation, respawn persistence, and autosave so these systems work correctly from the start. ## Core Features & Use Cases - Hit and gather pipeline: apply_hit(tool_data) on HarvestableNode validates tool type and tier via HarvestToolData enums, emits harvested, took_damage, and interaction_failed signals for decoupled inventory and HUD wiring. - World persistence and offline progress: harvest_respawn_manager.gd autoload tracks depleted node IDs, while UNIX timestamps via Time.get_unix_time_from_system() power offline gains and interval autosave to user://. - Procedural veins and durability: FastNoiseLite threshold spawning for organic ore clusters, plus tool durability stored on duplicated Resource data with break signals. - Use Case: Add a mineable copper vein to a survival game: author HarvestResourceData and HarvestToolData .tres files, attach harvestable_node.gd to a StaticBody3D, and connect the harvested signal to your inventory manager. ## Quick Start Ask the AI to implement a harvestable tree node in Godot 4 using this skill, with tool tier validation, shake feedback, and respawn persistence through the HarvestRespawnManager autoload.

Frequently Asked Questions about godot-game-loop-harvest

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I make a harvestable resource node in Godot 4?▼

Attach harvestable_node.gd to a StaticBody3D, assign HarvestResourceData and a mesh to shake, then call apply_hit(tool_data) from a player raycast. The node validates tool type and tier, then emits harvested, took_damage, or interaction_failed signals.

How to calculate offline progress in a Godot idle game?▼

Persist Time.get_unix_time_from_system() on exit and compare it with the current timestamp on load to compute elapsed real-world seconds. Never use OS.get_ticks_msec(), which tracks uptime rather than actual absence.

How do I validate tool type and tier for gathering in Godot?▼

Store tool type as a HarvestToolData.ToolType enum and tier as an int on a Resource, then compare them inside apply_hit. Avoid free-form string checks, and emit interaction_failed with reasons like wrong_tool or low_tier.

Why does my Godot harvest rate change with framerate?▼

Gather rates computed in _process without multiplying by delta scale with framerate. Multiply passive rates by delta, or move economy ticks to _physics_process for fixed-step behavior.

How do I persist depleted resource nodes across save loads in Godot?▼

Register harvest_respawn_manager.gd as an Autoload and record depleted node IDs plus absolute respawn timestamps in your save data. Nodes resolve /root/HarvestRespawnManager on load to restore their depleted state.

Why does editing one tool change all tools of the same type in Godot?▼

Resource instances are shared by default, so mutating durability on a loaded .tres affects every user of that template. Call duplicate(true) before runtime mutation of durability or health values.