Survival Crafting
A playbook for survival-crafting games — the gather → craft → build loop, survival needs, the
crafting/tech progression, and base building. This is a compositional skill: it orchestrates
inventory data, world content, persistence, and threats. It does not re-teach those primitives;
it defines the loop and the pressure systems (needs, scarcity, escalation) that make survival
tense rather than tedious.
When to use
- Use when the player gathers resources, crafts items/structures, manages survival needs, and
builds a base against escalating threats: survival sandbox, crafting/base-building game.
- Use when designing needs (hunger/thirst/temperature), a crafting tech tree, gathering loops,
or base placement/building.
When not to use: crafting as a minor RPG feature → rpg. Permadeath grid dungeon →
roguelike. For inventory/items as data assets, use godot-resources /
unity-scriptableobjects; for world generation, procedural-gen.
Core loop
Gather raw resources → craft tools/items → build and upgrade a base → manage survival needs
→ explore farther for better resources → survive escalating threats → repeat at a higher tier.
Each loop should unlock the next loop (better tools → reach new biomes → new resources →
better crafts). When that ladder breaks, the game becomes a grind.
Must-have systems
- Resource nodes + gathering — harvestable world objects; tool requirements/tiers; respawn.
- Inventory — stacks, capacity (slots or weight), drop/transfer, hotbar.
- Crafting — recipes (inputs → output), a crafting station/tech gate, a tech tree.
- Survival needs — hunger, thirst, temperature, stamina, health, with decay + consequences.
- Base building — placeable structures, a build grid/snapping, storage, crafting stations.
- World + day/night — biomes/resources (often procedural); a time cycle driving threats.
- Threats — hostile creatures/weather/events that escalate; combat or avoidance.
- Save/load — world state, inventory, base, needs, progression; large-world persistence.
Design knobs
| Knob |
Effect |
Notes |
| Needs decay rates |
pressure cadence |
Slow enough to explore, fast enough to matter. |
| Need-failure consequence |
stakes |
Damage over time, not instant death. |
| Resource scarcity / respawn |
exploration push |
Scarce near base → travel for more. |
| Tool tiers / gating |
progression ladder |
Better tool → new node types. |
| Recipe complexity / tech depth |
long-term goals |
Multi-step chains, not flat lists. |
| Inventory limit (slots/weight) |
logistics tension |
Forces base trips and storage. |
| Threat escalation curve |
difficulty over time |
Night/seasonal/event ramps. |
| Day length |
rhythm |
Day = gather, night = defend. |
Patterns
1. Needs decay with graded consequences
# Pseudocode in the per-frame/per-tick update. dt = seconds. Needs fall; failure bleeds HP.
def update_needs(p, dt):
p.hunger = max(0, p.hunger - HUNGER_RATE * dt)
p.thirst = max(0, p.thirst - THIRST_RATE * dt)
p.temp = approach(p.temp, ambient_temperature(p), TEMP_RATE * dt)
# Consequences are graded, not binary: warnings, then attrition — never instant death.
if p.hunger == 0 or p.thirst == 0:
p.hp -= STARVE_DAMAGE * dt # damage over time creates urgency with recovery room
if p.temp < COLD_THRESHOLD or p.temp > HEAT_THRESHOLD:
p.hp -= EXPOSURE_DAMAGE * dt
if p.hunger > 0 and p.thirst > 0 and not exposed(p):
p.hp = min(p.max_hp, p.hp + REGEN_RATE * dt) # safe + fed => heal
2. Crafting: validate, then atomically consume inputs
# Pseudocode. Recipes are data: inputs -> output, with an optional station/tech requirement.
recipe = {"id": "stone_axe",
"inputs": {"wood": 3, "stone": 2}, "output": ("stone_axe", 1),
"station": "workbench", "requires_tech": "basic_tools"}
def can_craft(recipe, inv, tech, station):
if recipe.get("requires_tech") and recipe["requires_tech"] not in tech: return False
if recipe.get("station") and recipe["station"] != station: return False
return all(inv.count(item) >= n for item, n in recipe["inputs"].items())
def craft(recipe, inv, tech, station):
if not can_craft(recipe, inv, tech, station): return False
if not inv.can_add_after_removing(recipe["inputs"], *recipe["output"]):
return notify("No room for the result") # check space BEFORE consuming anything
for item, n in recipe["inputs"].items(): inv.remove(item, n) # consume all, then add
inv.add(*recipe["output"]) # atomic: no partial craft
return True
The space check must count the slots the inputs free up (crafting 3 wood into 1 plank can
succeed in a full bag). If space is short, refuse, or drop the result on the ground; never
consume the inputs and then fail the add.
3. Gathering gated by tool tier
# Pseudocode. A node yields only if the held tool meets its required tier.
def harvest(node, tool):
if tool.tier < node.required_tier:
return notify("Need a better tool") # e.g. stone node needs a pickaxe, not fists
node.hp -= tool.power
if node.hp <= 0:
spawn_drops(node.drop_table) # weighted drops (see roguelike loot pattern)
node.start_respawn(node.respawn_time) # node returns later; world isn't depleted forever
Pitfalls / failure modes
- Needs that kill instantly → frustration and save-scumming. Make failure damage over time,
with clear warnings and a recovery path (Pattern 1).
- Grind without a ladder → gathering that never unlocks new gathering. Each tier must open
the next (better tool → new node → new resource → better craft).
- Non-atomic crafting → inputs consumed but output not granted on an edge case, most often
a full inventory. Validate inputs and space first, then consume-and-add as one step
(Pattern 2).
- Inventory with no limits → no logistics tension and no reason for a base/storage. Cap by
slots or weight.
- Permanently depleting the world → players strip the map and quit. Respawn nodes or
regenerate resources over time.
- Per-frame decay unscaled by
dt → needs drain at different speeds on different hardware.
Scale by dt.
- No save / fragile save of a large world → a crash wipes hours. Persist world+base+needs
incrementally; version it (see
save-systems).
- Flat threat curve → no late-game pressure. Escalate via night/season/event tiers.
Composition (build it from these skills)
- Items/recipes as data:
godot-resources / unity-scriptableobjects — items, recipes, tech tree, drop tables.
- World:
procedural-gen for biomes/resource placement; level-design for authored areas.
- Persistence:
save-systems for large-world state, base, inventory, needs, and versioning.
- Threats:
game-ai for creatures; the engine physics skill for melee/collision.
- Building/placement:
godot-tilemap / unity-tilemap-2d (2D) or godot-3d-essentials (3D) plus UI snapping.
- UI:
game-ui-ux for inventory/crafting/HUD layout and scaling; godot-ui-control for the concrete inventory, crafting menu, needs HUD, and build mode.
References
- For the full needs model and thresholds, the crafting tech-tree graph, gather/respawn tuning,
base-building grids, and threat escalation, read
references/needs-and-crafting.md.
1---2name: survival-crafting3description: >4 Build a survival-crafting game: resource gathering, inventory, crafting and a tech tree,5 needs (hunger/thirst/temperature), and base building. Use for a survival or crafting/base-building game.6metadata:7 source: https://skillmd.com/skills/junmystery/survival-crafting8---910# Survival Crafting1112A playbook for survival-crafting games — the gather → craft → build loop, survival needs, the13crafting/tech progression, and base building. This is a **compositional** skill: it orchestrates14inventory data, world content, persistence, and threats. It does not re-teach those primitives;15it defines the loop and the pressure systems (needs, scarcity, escalation) that make survival16tense rather than tedious.1718## When to use1920- Use when the player **gathers resources, crafts items/structures, manages survival needs, and21 builds a base** against escalating threats: survival sandbox, crafting/base-building game.22- Use when designing needs (hunger/thirst/temperature), a crafting tech tree, gathering loops,23 or base placement/building.2425**When *not* to use:** crafting as a minor RPG feature → `rpg`. Permadeath grid dungeon →26`roguelike`. For inventory/items as data assets, use `godot-resources` /27`unity-scriptableobjects`; for world generation, `procedural-gen`.2829## Core loop3031**Gather raw resources → craft tools/items → build and upgrade a base → manage survival needs32→ explore farther for better resources → survive escalating threats → repeat at a higher tier.**33Each loop should unlock the *next* loop (better tools → reach new biomes → new resources →34better crafts). When that ladder breaks, the game becomes a grind.3536## Must-have systems37381. **Resource nodes + gathering** — harvestable world objects; tool requirements/tiers; respawn.392. **Inventory** — stacks, capacity (slots or weight), drop/transfer, hotbar.403. **Crafting** — recipes (inputs → output), a crafting station/tech gate, a tech tree.414. **Survival needs** — hunger, thirst, temperature, stamina, health, with decay + consequences.425. **Base building** — placeable structures, a build grid/snapping, storage, crafting stations.436. **World + day/night** — biomes/resources (often procedural); a time cycle driving threats.447. **Threats** — hostile creatures/weather/events that escalate; combat or avoidance.458. **Save/load** — world state, inventory, base, needs, progression; large-world persistence.4647## Design knobs4849| Knob | Effect | Notes |50|------|--------|-------|51| Needs decay rates | pressure cadence | Slow enough to explore, fast enough to matter. |52| Need-failure consequence | stakes | Damage over time, not instant death. |53| Resource scarcity / respawn | exploration push | Scarce near base → travel for more. |54| Tool tiers / gating | progression ladder | Better tool → new node types. |55| Recipe complexity / tech depth | long-term goals | Multi-step chains, not flat lists. |56| Inventory limit (slots/weight) | logistics tension | Forces base trips and storage. |57| Threat escalation curve | difficulty over time | Night/seasonal/event ramps. |58| Day length | rhythm | Day = gather, night = defend. |5960## Patterns6162### 1. Needs decay with graded consequences6364```python65# Pseudocode in the per-frame/per-tick update. dt = seconds. Needs fall; failure bleeds HP.66def update_needs(p, dt):67 p.hunger = max(0, p.hunger - HUNGER_RATE * dt)68 p.thirst = max(0, p.thirst - THIRST_RATE * dt)69 p.temp = approach(p.temp, ambient_temperature(p), TEMP_RATE * dt)7071 # Consequences are graded, not binary: warnings, then attrition — never instant death.72 if p.hunger == 0 or p.thirst == 0:73 p.hp -= STARVE_DAMAGE * dt # damage over time creates urgency with recovery room74 if p.temp < COLD_THRESHOLD or p.temp > HEAT_THRESHOLD:75 p.hp -= EXPOSURE_DAMAGE * dt76 if p.hunger > 0 and p.thirst > 0 and not exposed(p):77 p.hp = min(p.max_hp, p.hp + REGEN_RATE * dt) # safe + fed => heal78```7980### 2. Crafting: validate, then atomically consume inputs8182```python83# Pseudocode. Recipes are data: inputs -> output, with an optional station/tech requirement.84recipe = {"id": "stone_axe",85 "inputs": {"wood": 3, "stone": 2}, "output": ("stone_axe", 1),86 "station": "workbench", "requires_tech": "basic_tools"}8788def can_craft(recipe, inv, tech, station):89 if recipe.get("requires_tech") and recipe["requires_tech"] not in tech: return False90 if recipe.get("station") and recipe["station"] != station: return False91 return all(inv.count(item) >= n for item, n in recipe["inputs"].items())9293def craft(recipe, inv, tech, station):94 if not can_craft(recipe, inv, tech, station): return False95 if not inv.can_add_after_removing(recipe["inputs"], *recipe["output"]):96 return notify("No room for the result") # check space BEFORE consuming anything97 for item, n in recipe["inputs"].items(): inv.remove(item, n) # consume all, then add98 inv.add(*recipe["output"]) # atomic: no partial craft99 return True100```101102The space check must count the slots the inputs free up (crafting 3 wood into 1 plank can103succeed in a full bag). If space is short, refuse, or drop the result on the ground; never104consume the inputs and then fail the add.105106### 3. Gathering gated by tool tier107108```python109# Pseudocode. A node yields only if the held tool meets its required tier.110def harvest(node, tool):111 if tool.tier < node.required_tier:112 return notify("Need a better tool") # e.g. stone node needs a pickaxe, not fists113 node.hp -= tool.power114 if node.hp <= 0:115 spawn_drops(node.drop_table) # weighted drops (see roguelike loot pattern)116 node.start_respawn(node.respawn_time) # node returns later; world isn't depleted forever117```118119## Pitfalls / failure modes120121- **Needs that kill instantly** → frustration and save-scumming. Make failure damage over time,122 with clear warnings and a recovery path (Pattern 1).123- **Grind without a ladder** → gathering that never unlocks new gathering. Each tier must open124 the next (better tool → new node → new resource → better craft).125- **Non-atomic crafting** → inputs consumed but output not granted on an edge case, most often126 a full inventory. Validate inputs and space first, then consume-and-add as one step127 (Pattern 2).128- **Inventory with no limits** → no logistics tension and no reason for a base/storage. Cap by129 slots or weight.130- **Permanently depleting the world** → players strip the map and quit. Respawn nodes or131 regenerate resources over time.132- **Per-frame decay unscaled by `dt`** → needs drain at different speeds on different hardware.133 Scale by `dt`.134- **No save / fragile save of a large world** → a crash wipes hours. Persist world+base+needs135 incrementally; version it (see `save-systems`).136- **Flat threat curve** → no late-game pressure. Escalate via night/season/event tiers.137138## Composition (build it from these skills)139140- **Items/recipes as data:** `godot-resources` / `unity-scriptableobjects` — items, recipes, tech tree, drop tables.141- **World:** `procedural-gen` for biomes/resource placement; `level-design` for authored areas.142- **Persistence:** `save-systems` for large-world state, base, inventory, needs, and versioning.143- **Threats:** `game-ai` for creatures; the engine physics skill for melee/collision.144- **Building/placement:** `godot-tilemap` / `unity-tilemap-2d` (2D) or `godot-3d-essentials` (3D) plus UI snapping.145- **UI:** `game-ui-ux` for inventory/crafting/HUD layout and scaling; `godot-ui-control` for the concrete inventory, crafting menu, needs HUD, and build mode.146147## References148149- For the full needs model and thresholds, the crafting tech-tree graph, gather/respawn tuning,150 base-building grids, and threat escalation, read `references/needs-and-crafting.md`.