Loading...
Loading...
Expert blueprint for survival games (Minecraft, Don't Starve, The Forest, Rust) covering needs systems, resource gathering, crafting recipes, base building, and progression balancing. Use when building open-world survival, crafting-focused, or resource management games. Keywords survival, needs system, crafting, inventory, hunger, resource gathering, base building.
npx skill4agent add thedivergentai/gd-agentic-skills godot-genre-survival| Phase | Skills | Purpose |
|---|---|---|
| 1. Data | | Item data (weight, stack size), Recipes |
| 2. UI | | Inventory management, crafting menu |
| 3. World | | Procedural terrain, resource spawning |
| 4. Logic | | Player stats (Needs), Interaction system |
| 5. Save | | Saving world state, inventory, player stats |
# 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 = "Interact"
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 trueTileMapTileMapLayerInventoryexport