Loading...
Loading...
Build a survival-crafting game: resource gathering, inventory, crafting and a tech tree, needs (hunger/thirst/temperature), and base building. Use for a survival or crafting/base-building game.
npx skill4agent add gamedev-skills/awesome-gamedev-agent-skills survival-craftingrpgroguelikegodot-resourcesunity-scriptableobjectsprocedural-gen| 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. |
# 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# 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
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# 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 foreverdtdtsave-systemsgodot-resourcesunity-scriptableobjectsprocedural-genlevel-designsave-systemsgame-aigodot-tilemapunity-tilemap-2dgodot-3d-essentialsgame-ui-uxgodot-ui-controlreferences/needs-and-crafting.md