godot-game-loop-harvest
Data-driven resource harvesting (mining, logging, foraging) for Godot 4: apply_hit tool/tier validation via HarvestToolData enums, HarvestResourceData yields…
от thedivergentai★ 1 019 звёзд на GitHub
Установить godot-game-loop-harvest в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Script Catalog (MANDATORY by path)
| Path | MANDATORY reads |
|---|---|
| Hit / gather | harvestable_node.gd, resource_data.gd, harvest_tool_data.gd |
| Offline / autosave | harvest_loop_patterns.gd, harvest_autosave_manager.gd, harvest_inventory_manager.gd |
| Vein / respawn / world | harvest_respawn_manager.gd + FastNoiseLite vein notes below |
Setup (short)
- Author
HarvestResourceData/HarvestToolData.tres(tool enum + tier, yield range, optional drop scene). - Attach
harvestable_node.gdtoStaticBody3D; assign data +mesh_to_shake; keep interaction on Layer 1. - Autoload
harvest_respawn_manager.gdasHarvestRespawnManagerwhen world persistence is required.
Hit path
Raycast/interact → apply_hit(tool_data: HarvestToolData):
if collider is HarvestableNode:
collider.apply_hit(player_tool)
| Signal | Payload | Wire to |
|---|---|---|
harvested |
(data, amount) |
Inventory / harvest_inventory_manager |
took_damage |
(curr, max) |
HUD bar / popup pool |
interaction_failed |
(reason: StringName) |
"wrong_tool" / "low_tier" feedback |
NEVER Do
- NEVER use float for accumulated harvest counts — use
int. - NEVER gather rates in
_processwithoutdelta— framerate-scales economy. - NEVER trust
OS.get_ticks_msec()for offline progress — useTime.get_unix_time_from_system(). - NEVER check tool type via free-form strings — use
HarvestToolData.ToolType/StringNameenums (see scripts). - NEVER mutate shared Resource templates —
duplicate(true)before runtime durability/health mutation. - NEVER
queue_free()before VFX/SFX finish — hide mesh, swap collision layer, free after juice. - NEVER skip saving UNIX timestamp on exit — offline gains depend on it.
- NEVER couple harvest logic to UI counters — signals only.
- NEVER scale collision shapes non-uniformly — edit shape resource sizes.
Vein proc-gen (noise)
Use FastNoiseLite thresholds for organic clusters; spawn HarvestableNode instances where noise.get_noise_2dv(pos) > threshold. Persist depleted IDs via respawn manager — do not re-roll veins every load without a seed.
Tool durability
Keep durability on HarvestToolData (Resource), not the player node. Emit durability/break signals from the tool Resource after successful hits.
MANDATORY for offline UNIX math, worker-thread batching, popup pools, and vein proc-gen depth: harvest-elite-patterns.md. Do NOT Load when hit path + respawn manager suffice.
Reference
Progressive disclosure: Skim Official Documentation only for the APIs you are implementing (Resources, StaticBody3D hits, signals, timers, save/offline time). Open Related Skills when wiring inventory, autoloads, raycasts, or economy balance—do not preload the whole lattice.
Official Documentation
- Resources — Author
HarvestResourceData/HarvestToolDataas shareable.tresassets so designers tune health, yield ranges, and tool gates without editing harvest scripts. - Resource — Call
duplicate(true)before mutating runtime harvest/tool state so one node’s depletion or durability cannot rewrite the shared template Resource. - GDScript exports —
@export/@export_grouppower Inspector-authored tool tiers, yield ranges, respawn times, and drop scenes on harvest data Resources. - Using signals — Emit
harvested,took_damage, andinteraction_failedso inventory, HUD bars, and feedback UI subscribe without coupling toHarvestableNodeinternals. - StaticBody3D — World harvestables are static colliders players query/hit; keep them on an interaction layer and move to an inactive layer while depleted.
- Collision shapes (3D) — Size shape resources directly; non-uniform scale on collision shapes breaks hit tests for pickaxes/axes against trees and ore nodes.
- Idle and Physics Processing — Multiply continuous gather rates by
delta(prefer_physics_processfor fixed-step economy ticks) so harvest speed is not framerate-dependent. - Time —
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- references/harvest-elite-patterns.md
- references/migration-notes.md
- scripts/harvest_autosave_manager.gd
- scripts/harvest_inventory_manager.gd
- scripts/harvest_loop_patterns.gd
- scripts/harvest_respawn_manager.gd
- scripts/harvest_tool_data.gd
- scripts/harvestable_node.gd
- scripts/resource_data.gd
FAQ
Что делает скилл godot-game-loop-harvest?
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.
Как установить скилл godot-game-loop-harvest?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл godot-game-loop-harvest запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
skill-creator
AnthropicCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
discernment-nudge
AnthropicAfter you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
data-consolidate
AnthropicJoins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
inspection-to-capa
AnthropicRuns the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…