Home Unique Items & Procedural Economy

Unique Items & Procedural Economy


1. Summary

Flatland3 has no chase for identical end-game “gear.” There are no interchangeable BiS swords every player converges on. Every object minted into the world is a unique item_instance with a permanent identity, provenance, and rolled attributes — even when two items look similar on paper.

Players build completely unique loadouts over time: different weapons, armor, accessories, enchant stacks, and skill pairings. Items are crafted (by players or NPC settlements), procedurally generated (monster drops, chests, world placement), then modified (enchant, repair, rename). Once created, an item lives until destroyed (durability → 0 with no repair) — it can be traded, lost, banked, buried, or forgotten forever.

NPC towns use the same crafting rules as players via settlement worker pools — including food. Stock replenishes over real craft time, not infinite vendor menus.


2. Locked decisions

# Decision
U1 No gear paradigm — no template-tier chase; power comes from unique instance builds + skills + enchants, not everyone owning the same named legendary set.
U2 Every mint = unique instance — global instance_id; two “iron longswords” are different records even if stats match.
U3 Everything is crafted — no abstract vendor spawn. NPC shops sell instances produced by settlement workers over time.
U4 NPC settlements = worker pools — same recipes/stations as players; basic output only (short sword, long sword, shield, leather armor, minimal rations); no player death risks for NPCs.
U5 Procedural generation — monster drops, hidden chests, authored placements mint new unique instances via loot tables + generators (not template clones from void).
U6 Item permanence — instances persist in DB until destroyed (durability break) or admin cull; no item despawns from “being old.”
U7 Front-load & balance — world-build / ops tools seed settlements, drop tables, and stock rates so new realms stay playable (01 world build).

3. Design principles

Principle Meaning
Identity over template UI shows instance name, maker, age, enchants — not “Longsword ×1”
Craft is creation Craft, loot, and chest open = mint events audited centrally
NPCs play fair sim Town smith takes time to forge; shelf empty until next batch
Player depth wins NPC basics are floor; players enchant, masterwork, and specialize above it
Discovery matters Procedural world loot + hidden chests reward exploration
Permanent world history Famous swords have traceable owners in audit log

4. Item instance model (authoritative)

struct ItemInstance {
    instance_id: Uuid,              // globally unique, never reused
    template_id: ItemTemplateId,    // schema / base kind (longsword, oak_log, …)
    mint_source: MintSource,        // craft, loot, chest, settlement, world_place, …
    minted_at: Timestamp,
    minted_by: Option<ActorId>,     // player, worker, generator id

    // Rolled at mint — varies per instance
    quality: QualityTier,
    stat_roll: StatBlock,           // damage, armor, mass variance, …
    cosmetic_seed: u64,             // subtle visual / name flavor
    custom_name: Option<String>,    // player rename

  // Lifecycle
    durability: f32,
    soul_bound: bool,
    enchantments: Vec<EnchantmentInstance>,
    quantity: u32,                    // 1 for equipment; >1 for splittable bulk (ore, coins)

    provenance: ProvenanceChain,    // optional compact history for legendaries
}

enum MintSource {
    PlayerCraft { recipe_id, character_id },
    SettlementCraft { settlement_id, worker_id, recipe_id },
    MonsterLoot { monster_instance_id, loot_table_id },
    Chest { chest_id, generator_id },
    WorldPlace { segment_id, placement_id },
    BrokerEscrow,
    // ...
}

4.1 Templates vs instances

Layer Role
Template Recipe schema, base mass, allowed enchants, craft requirements — not a tradable object
Instance The only thing that exists in inventory, shops, corpses, chests

No interchangeable “gear slots” filled by template ID — equip binds specific instance_id.

4.2 Splittable bulk (materials & coins)

Raw materials and currency may have quantity > 1 on one instance (one UUID, one ledger row). Split and merge create new instance_ids — traceability preserved.

Finished equipment, tools, accessories, meals default to quantity: 1 always.

4.3 When instances are destroyed

Cause Result
Durability → 0, no repair Destroyed — removed from world permanently
Consumable use Instance consumed (food eaten, scroll used)
Admin / event Rare scripted destruction

No “vendor buyback deletes item” without audit — NPC purchase moves instance to settlement stock or melts down per recipe.


5. Procedural generation

Loot and placement do not duplicate a static template item. They run a generator that mints a fresh instance:

# assets/loot/dire_wolf.yaml
loot_table:
  - weight: 40
    generator: weapon_melee_basic
    params: { material_pool: [iron, leather], skill_tier: 2 }
  - weight: 25
    generator: armor_piece_light
  - weight: 35
    generator: material_bulk
    params: { template: wolf_pelt, qty_range: [1, 3] }
fn mint_from_generator(gen: GeneratorId, params: GenParams, source: MintSource) -> ItemInstance {
    let template = roll_template(params);
    let quality = roll_quality(params.tier, rng);
    let stat_roll = roll_stats(template, quality, rng);
    let cosmetic_seed = rng.next_u64();
    central.mint_instance(/* ... */)  // single authority
}

Same generator used for: NPC death loot (19 §11), chests, quest rewards, world-build placements.

5.1 Authored world placement

Segment pipeline (01) supports item placement nodes:

placement:
  id: ruins_chest_03
  generator: chest_armor_uncommon
  respawn: never              # one-time unique chest
  # or respawn: { days: 30, new_instance: true }  # new unique each cycle

5.2 “Same stats, still unique”

Two instances may have identical stat_roll — they remain different instance_id, different cosmetic_seed, different provenance, different enchant history. Collectors and traders care about identity.


6. NPC settlements & town design

Towns are authored in the world-build pipeline with settlement profiles:

settlement:
  id: northhold
  worker_pool:
    max_workers: 12
    wages: settlement_treasury
  facilities:
    - forge
    - kitchen
    - market_shelf
  job_cycles:
    - id: basic_weapons
      steps: [withdraw ore_stock, craft short_sword, craft long_sword, deposit market_shelf]
      repeat: true
    - id: basic_armor
      steps: [craft leather_vest, craft wooden_shield, deposit market_shelf]
    - id: stand_rations
      steps: [craft npc_hardtack, deposit food_stand]
  stock_targets:
    short_sword: { min: 2, max: 6 }
    npc_hardtack: { min: 10, max: 30 }

6.1 Same rules as players

Rule Settlement Player
Recipes Same graph (09) Same
Stations / time Real craft_time_ticks Same
Failure rolls Yes, partial material loss Same
Skill Worker NPC skills (authored baseline) Trained
Death / corpse No player-style permadeath risk Full risk
Output tier Basic only — no high enchants, no masterwork chase Full depth

6.2 Shop shelves = instance stock

Buying from NPC shop:

1. Player pays coins
2. Specific instance_id moves shop_inventory → player
3. Shelf count drops until workers craft more

Empty shelf = wait for settlement workers or buy elsewhere / player stalls.

6.3 Food stands (revised)

NPC food is crafted by settlement kitchen workers — still minimal stats (15 §4.5) but each unit is a unique instance (e.g. Northhold hardtack #8f3a…). Stands run out; replenishment takes time.

6.4 Front-load & balance

Tool Purpose
Settlement seed stock Launch with N pre-minted instances per shelf
Treasury & input stock Ore, leather in settlement storage for workers
Rate tuning craft_time_ticks, worker count vs expected player population
Ops dashboard Alert when capital city weapon shelf empty > 24h

World-builders design towns; live ops tune without breaking unique-item rules.


7. Player uniqueness path

Typical divergence — no two max-level players identical:

Starter procedural drop (unique rusted dagger)
  → craft unique iron longsword (own stat roll)
  → enchant flame_edge (failures cost reagents)
  → second weapon for swap / dual slot
  → unique leather vest from player tailor
  → accessory with vitality_charm
  → skill build (swords + evocation vs axes + restoration)

Power ceiling is soft — bounded by ruleset generators and enchant tiers, but path and loadout are not homogenized.


8. Economy implications (10)

Topic Rule
Broker Materials — commodity books by template (bulk). Equipmentinstance listings with inspect
Stalls Always instance-priced
Price discovery Avg of recent instance sales per template category — not one global BiS price
Arbitrage Haul specific goods or materials between regions

Remove language of “chasing gear” — market is antiques, crafts, and supplies.


9. Combat & attributes (11, 12)

Effective combat stats sum this instance’s stat_roll + enchants + skills — not “any longsword.”

Inspect shows:

Iron Longsword
  Instance: 7c2e91b4-…
  Forged: Northhold settlement, day 12
  Damage: 18–24 (rolled)
  Quality: fine
  Enchants: Flame Edge II

10. Content pipeline

assets/
  generators/*.yaml       # procedural mint params
  loot_tables/*.yaml
  settlements/*.yaml      # worker pools, job cycles, stock targets
  placements/*.yaml       # chests, ruins (in segments)
tools/
  validate-settlement-jobs.mjs
  seed-settlement-stock.mjs   # ops / world-build

11. Phasing

Phase Scope
3 instance_id on all mints; craft mints unique
4 Generators for monster drops; splittable ore lots
5 Settlement worker pools + shelf stock; NPC food crafted
6 Chest placements; world-build settlement designer
7 Provenance UI; instance broker listings; legend tracking

12. Open questions

Resolved (2026-07-06):

# Decision
U1 No BiS gear chase — unique builds
U2 Global unique instance_id per mint
U3 All goods crafted; NPCs use workers
U4 Settlements: basic recipes, same sim rules, no player risks
U5 Procedural generators for loot/chests/placements
U6 Permanent items until durability destruction
U7 Front-load via world-build + ops tuning

Crafting graph: 09-crafting-and-recipes.html
Workers (player): 13-workers-and-automation.html
Enchanting: 17-enchanting-and-item-modifiers.html