Crafting Recipes And Service Integration
What This System Is
Crafting recipes define item inputs, outputs, availability conditions, relationship deltas, and service integration so NPCs can expose crafting as authored gameplay options.
How Authors Use It
Authors add recipe rows to game data and reference them from NPC service definitions through crafting_recipe_ids. Inputs should be authored as costs, outputs as granted items, and conditions as availability gates. Relationship or faction requirements can lock recipes until the player qualifies.
Rules And Invariants
Input costs and availability gates are separate. A recipe that requires three ore should consume three ore, not merely check that the player owns ore. Output quantities must be positive. Recipe ids and item ids must stay stable once services reference them.
Validation And Debugging
Missing recipe ids, zero quantities, missing item references, and relationship-gate typos should appear in game-data or NPC-service validation. If a recipe appears in preview but fails at authority, compare prepared service projection with gameplay authority cost checks.
Examples
A blacksmith recipe can require faction_rep:blacksmith_relationship>=3, consume ore and gold, output a sword, and apply a small relationship delta after success. If the option is locked, inspect both availability conditions and service lock reasons.