# E3.M1 — ResourceNodeAndGatherLoop

## Summary

| Field | Value |
|--------|--------|
| **Module ID** | E3.M1 |
| **Epic** | [Epic 3 — Crafting Economy](../epics/epic_03_crafting_economy.md) |
| **Stage target** | Prototype |
| **Status** | In Progress (see [dependency register](module_dependency_register.md); prototype gather XP anchor [NEO-41](../../plans/NEO-41-implementation-plan.md)) |

## Purpose

World resource nodes, gather interactions, and yield outputs feeding inventory ([E3.M3](E3_M3_ItemizationAndInventorySchema.md)) and XP ([E2.M2](E2_M2_XpAwardAndLevelEngine.md)).

## Responsibilities

- Spawn/manage nodes per `ResourceNodeDef`; resolve `GatherResult` via `ResourceYieldTable`; integrate interaction range via [E1.M3](E1_M3_InteractionAndTargetingLayer.md).

## Key contracts

| Contract | Role |
|----------|------|
| `ResourceNodeDef` | Node type, capacity, regen. |
| `GatherResult` | Items and depletion state. |
| `ResourceYieldTable` | Probabilities or fixed yields. |

## Module dependencies

- **E1.M3** — InteractionAndTargetingLayer.
- **E2.M2** — XpAwardAndLevelEngine.

## Dependents (by design)

- **E3.M2** — RefinementAndRecipeExecution (inputs).
- **E4.M2** — SpawnEcologyController.

## Related implementation slices

Epic 3 **Slice 2** — 4–6 node types; `resource_gathered`, `gather_node_depleted`.

**Prototype implementation anchor (NEO-41):** until **`GatherResult`** / yield tables exist, the repo treats a **successful** **`POST …/interact`** on an entry with **`kind: resource_node`** (`prototype_resource_node_alpha`) as **gather completion** for **skill XP** only — **`salvage`** + **`activity`** via [`SkillProgressionGrantOperations`](../../../server/NeonSprawl.Server/Game/Skills/SkillProgressionGrantOperations.cs) (same rules as NEO-38). Migrate this hook when a dedicated gather pipeline lands.

## Source anchors

- Master plan: [`neon_sprawl_vision.plan.md`](../../../neon_sprawl_vision.plan.md) — Epic 3.
- [Module dependency register](module_dependency_register.md)
