重要前提
安装AI Skills的关键前提是:必须科学上网,且开启TUN模式,这一点至关重要,直接决定安装能否顺利完成,在此郑重提醒三遍:科学上网,科学上网,科学上网。查看完整安装教程 →
godot-genre-survival by thedivergentai/gd-agentic-skills
npx skills add https://github.com/thedivergentai/gd-agentic-skills --skill godot-genre-survival资源稀缺、需求管理和通过制作实现的进程定义了生存类游戏。
is_equal_approx() 或 <= 来防止因 0.0 精度导致的遗漏。广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
MeshInstance3D 节点;严格使用 MultiMeshInstance3D 进行批处理绘制调用。ResourceLoader.load_threaded_request() 以防止卡顿。ConfigFile 或 JSON 以便于平衡和修改。| 阶段 | 技能 | 目的 |
|---|
resources, custom-resources | 物品数据(重量、堆叠大小)、配方grid-containers, drag-and-drop | 库存管理、制作菜单tilemaps, noise-generation | 程序化地形、资源生成state-machines, signals | 玩家状态(需求)、交互系统file-system, json-serialization | 保存世界状态、库存、玩家状态库存中的所有东西都是一个 Item。
# item_data.gd
extends Resource
class_name ItemData
@export var id: String
@export var name: String
@export var icon: Texture2D
@export var max_stack: int = 64
@export var weight: float = 1.0
@export var consumables: Dictionary # { "hunger": 10, "health": 5 }
一个基于网格的数据结构。
# inventory.gd
extends Node
signal inventory_updated
var slots: Array[ItemSlot] = [] # Array of Resources or Dictionaries
@export var size: int = 20
func add_item(item: ItemData, amount: int) -> int:
# 1. Check for existing stacks
# 2. Add to empty slots
# 3. Return amount remaining (that couldn't fit)
pass
一种通用的采集、拾取或打开物品的方式。
# interactable.gd
extends Area2D
class_name Interactable
@export var prompt: String = "交互"
func interact(player: Player) -> void:
_on_interact(player)
func _on_interact(player: Player) -> void:
pass # Override this
随时间减少的简单浮点数值。
# needs_manager.gd
var hunger: float = 100.0
var thirst: float = 100.0
var decay_rate: float = 1.0
func _process(delta: float) -> void:
hunger -= decay_rate * delta
thirst -= decay_rate * 1.5 * delta
if hunger <= 0:
take_damage(delta)
检查玩家是否有材料 -> 移除材料 -> 添加结果。
func craft(recipe: Recipe) -> bool:
if not has_ingredients(recipe.ingredients):
return false
remove_ingredients(recipe.ingredients)
inventory.add_item(recipe.result_item, recipe.result_amount)
return true
根据工具质量缩放资源产量(item_data.gd 元数据):
通过检查防止“重生点蹲守”:
func get_spawn_point() -> Vector3:
var point = find_random_point()
for bed in get_tree().get_nodes_in_group("player_beds"):
if point.distance_to(bed.global_position) < safe_radius:
return get_spawn_point() # Re-roll
return point
TileMap(Godot 3)或 TileMapLayer(Godot 4)构建世界。Inventory 资源已正确设置 export 变量,可直接将其保存到磁盘。每周安装量
48
代码仓库
GitHub 星标数
59
首次出现
2026年2月10日
安全审计
已安装于
opencode48
gemini-cli47
codex47
amp46
github-copilot46
kimi-cli46
Resource scarcity, needs management, and progression through crafting define survival games.
is_equal_approx() or <= to prevent 0.0 precision misses.MeshInstance3D nodes for foliage; strictly use MultiMeshInstance3D for batched draw calls.ResourceLoader.load_threaded_request() to prevent hitches.ConfigFile or JSON for easy balancing and modding.| Phase | Skills | Purpose |
|---|---|---|
| 1. Data | resources, custom-resources | Item data (weight, stack size), Recipes |
| 2. UI | grid-containers, drag-and-drop | Inventory management, crafting menu |
| 3. World | tilemaps, noise-generation | Procedural terrain, resource spawning |
| 4. Logic | , |
Everything in the inventory is an Item.
# item_data.gd
extends Resource
class_name ItemData
@export var id: String
@export var name: String
@export var icon: Texture2D
@export var max_stack: int = 64
@export var weight: float = 1.0
@export var consumables: Dictionary # { "hunger": 10, "health": 5 }
A grid-based data structure.
# inventory.gd
extends Node
signal inventory_updated
var slots: Array[ItemSlot] = [] # Array of Resources or Dictionaries
@export var size: int = 20
func add_item(item: ItemData, amount: int) -> int:
# 1. Check for existing stacks
# 2. Add to empty slots
# 3. Return amount remaining (that couldn't fit)
pass
A universal way to harvest, pickup, or open things.
# interactable.gd
extends Area2D
class_name Interactable
@export var prompt: String = "Interact"
func interact(player: Player) -> void:
_on_interact(player)
func _on_interact(player: Player) -> void:
pass # Override this
Simple float values that deplete over time.
# needs_manager.gd
var hunger: float = 100.0
var thirst: float = 100.0
var decay_rate: float = 1.0
func _process(delta: float) -> void:
hunger -= decay_rate * delta
thirst -= decay_rate * 1.5 * delta
if hunger <= 0:
take_damage(delta)
Check if player has ingredients -> Remove ingredients -> Add result.
func craft(recipe: Recipe) -> bool:
if not has_ingredients(recipe.ingredients):
return false
remove_ingredients(recipe.ingredients)
inventory.add_item(recipe.result_item, recipe.result_amount)
return true
### 4. Tiered Tool Scaling
Scaling resource yield with tool quality (`item_data.gd` metadata):
- **Stone Axe**: 1 yield per hit, 3s harvest time.
- **Steel Axe**: 5 yield per hit, 1.5s harvest time.
- **Auto-Saw**: Constant yield stream while within proximity.
### 5. Spawn Safe Zones
Preventing "Spawn Camping" via check:
```gdscript
func get_spawn_point() -> Vector3:
var point = find_random_point()
for bed in get_tree().get_nodes_in_group("player_beds"):
if point.distance_to(bed.global_position) < safe_radius:
return get_spawn_point() # Re-roll
return point
## Godot-Specific Tips
* **TileMaps**: Use `TileMap` (Godot 3) or `TileMapLayer` (Godot 4) for the world.
* **FastNoiseLite**: Built-in noise generator for procedural terrain (trees, rocks, biomes).
* **ResourceSaver**: Save the `Inventory` resource directly to disk if it's set up correctly with `export` vars.
* **Y-Sort**: Essential for top-down 2D games so player sorts behind/in-front of trees correctly.
## Common Pitfalls
1. **Tedium**: Harvesting takes too long. **Fix**: Scale resource gathering with tool tier (Stone Axe = 1 wood, Steel Axe = 5 wood).
2. **Inventory Clutter**: Too many unique items that don't stack. **Fix**: Be generous with stack sizes and storage options.
3. **No Goals**: Player survives but gets bored. **Fix**: Add a tech tree or a "boss" to work towards.
## Reference
- Master Skill: [godot-master](../godot-master/SKILL.md)
Weekly Installs
48
Repository
GitHub Stars
59
First Seen
Feb 10, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode48
gemini-cli47
codex47
amp46
github-copilot46
kimi-cli46
GSAP React 动画库使用指南:useGSAP Hook 与最佳实践
3,900 周安装
state-machinessignals| Player stats (Needs), Interaction system |
| 5. Save | file-system, json-serialization | Saving world state, inventory, player stats |