All skills
thedivergentai avatar

/godot-game-loop-harvest

@9d6e91e

Data-driven resource harvesting (mining, logging, foraging) for Godot 4: apply_hit tool/tier validation via HarvestToolData enums, HarvestResourceData yields, harvestable_node shake/deplete, respawn_manager world persistence, UNIX offline progress, autosave, and noise vein proc-gen. Trigger keywords: apply_hit, HarvestResourceData, HarvestToolData, offline UNIX, respawn_manager, tool tier, harvestable_node, FastNoiseLite veins.

Use this Skill: https://skilld.dev/gh/thedivergentai/gd-agentic-skills/godot-game-loop-harvest

This session only. Nothing lands on disk.

referencesharvest-elite-patterns.md

≈504 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Harvest Elite Patterns (load on demand)

MANDATORY for offline UNIX gains, worker-thread batching, popup pools, and noise vein placement beyond harvestable_node.gd.

Offline progress (UNIX)

WHY Time.get_unix_time_from_system(): OS.get_ticks_msec() tracks uptime, not real-world absence.

Persist last-exit UNIX timestamp in harvest_autosave_manager.gd / harvest_loop_patterns.gd.

Proc-gen veins (FastNoiseLite)

var noise := FastNoiseLite.new()

func _should_spawn(pos: Vector2) -> bool:
	return noise.get_noise_2dv(pos) > 0.5

Persist depleted node IDs + world seed via harvest_respawn_manager.gd — do not re-roll veins every load without a fixed seed.

Tool durability

Keep durability on harvest_tool_data.gd Resource — emit durability_changed / tool_broken. duplicate(true) before runtime mutation.

WorkerThreadPool for bulk sim

CAUTION: Never touch SceneTree off main thread. Batch math on workers; apply results with call_deferred.

Popup pool (WHY)

CAUTION: Instantiating Labels per hit fragments memory. Pool damage/harvest popups; see godot-performance-optimization.

Idle / UI-heavy harvest games

OS.low_processor_usage_mode reduces battery drain when simulation is light.

Mutex on shared inventory

Background gather sims must lock shared warehouse data — harvest_inventory_manager.gd.

Deplete without killing juice

Hide mesh + disable collision layer → play VFX/SFX → queue_free on completion signal. Never immediate free on first hit.

Rates in _process

Multiply passive gather rates by delta (prefer _physics_process for fixed-step economy).

Source: SKILL.md on GitHub

No alerts16d4 checks · Risk SAFE
  • Gen Agent Trust Hub16d

    The skill provides a set of standard Godot 4 scripts for resource harvesting and persistence. It follows engine best practices for data management, using sandboxed file paths for saves and official documentation for references. No malicious patterns or security risks were detected.

  • Socket16d

    No alerts

  • Snyk16d

    Risk: LOW · No issues

  • Runlayer6mo

    6 files scanned · No issues

Signed by skilld at 9d6e91e. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 3 weeks ago.

Activeupdated 2 months ago

README badge

README badge for thedivergentai/gd-agentic-skills/godot-game-loop-harvest