Skip to content

Farming & food chain (crops, farmland, food production) #12

Description

@MichaelFisher1997

Largely standalone from #1-#4 (only needs the hoe tool from #4 to till soil, and bread recipe in #1). Closes the survival food loop — currently food is eaten but never produced.

Context

Eating is fully wired today (PlayerState.ts:81 eat(), right-click eat handler in Game.ts:723-726, hunger/saturation tick in PlayerState.ts:135-141, five food items in Items.ts:39-45). But there are no wheat seeds, no hoe, no farmland block, no crop-growth tick, no animals. cooked_beef is only obtainable from the creative palette — the food chain has no production side.

Scope

  • src/game/gen/BlockIds.ts — append WHEAT_CROP (multi-stage block), FARMLAND. Coordinated edit with Blocks.ts + Textures.ts per AGENTS.md.
  • src/engine/Textures.ts — crop growth-stage textures (3-4 stages), farmland (dry + hydrated variants).
  • src/game/Items.ts — add wheat_seeds, wheat items; add to DROP_TABLE (tall grass drops seeds).
  • Hoe tool (from Water overhaul: liquid simulation, flow physics, rendering, interaction #4) — right-click grass/dirt → farmland block; consumes durability.
  • Crop growth tick — new farming system (or extend the liquid/ambient tick loop) advancing wheat stages gated on:
    • light level (reuse the sun/block-light channel)
    • farmland hydration (adjacent water block within N blocks)
    • random tick probability per in-game day
  • Right-click harvest on mature wheat → drops wheat + seeds (replantable).
  • src/game/Recipes.ts (from Voxel lighting + day/night cycle (sun, moon, two-channel shading) #1) — 3 wheat → 1 bread.

Out of scope

Livestock breeding and passive animals are Phase 3 (mobs & creatures). This issue covers crop farming only; animal-derived food stays creative-palette-only until mobs land.

Acceptance criteria

  • Till grass/dirt with a hoe to create farmland.
  • Plant wheat seeds on farmland; crops advance through growth stages over in-game days when hydrated and lit.
  • Mature wheat is harvestable into wheat + seeds.
  • Craft bread from wheat.
  • Breaking tall grass has a chance to drop seeds.

Roadmap reference

Phase 2 — "Farming & food chain".

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestphase-2Phase 2 — Crafting & survival depth (active)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions